/** * @see org.apache.commons.math.stat.descriptive.DescriptiveStatistics#getValues() */ public synchronized double[] getValues() { return super.getValues(); }
/** * {@inheritDoc} */ @Override public synchronized double[] getValues() { return super.getValues(); }
/** * {@inheritDoc} */ @Override public synchronized double[] getValues() { return super.getValues(); }
/** * Extracts all responsetimes. * * @return the responsetimes as an array */ public final double[] extractResponsetimes() { return responsetimeStats.getValues(); }
/** * Returns the current set of values in an array of double primitives, * sorted in ascending order. The returned array is a fresh * copy of the underlying data -- i.e., it is not a reference to the * stored data. * @return returns the current set of * numbers sorted in ascending order */ public double[] getSortedValues() { double[] sort = getValues(); Arrays.sort(sort); return sort; }
/** * Returns the current set of values in an array of double primitives, * sorted in ascending order. The returned array is a fresh * copy of the underlying data -- i.e., it is not a reference to the * stored data. * @return returns the current set of * numbers sorted in ascending order */ public double[] getSortedValues() { double[] sort = getValues(); Arrays.sort(sort); return sort; }
/** * Returns the current set of values in an array of double primitives, * sorted in ascending order. The returned array is a fresh * copy of the underlying data -- i.e., it is not a reference to the * stored data. * @return returns the current set of * numbers sorted in ascending order */ public double[] getSortedValues() { double[] sort = getValues(); Arrays.sort(sort); return sort; }
/** * Creates a histogram from the values in <tt>stats</tt> discretized with <tt>discretizer</tt>. Correctly handles * {@link DescriptivePiStatistics} objects. * * @param stats a descriptive statistics object * @param discretizer a discretizer * @return a double-double map where the key denotes the bin and the value the bin height. */ public static TDoubleDoubleHashMap createHistogram(DescriptiveStatistics stats, Discretizer discretizer, boolean reweight) { if (stats instanceof DescriptivePiStatistics) return createHistogram((DescriptivePiStatistics) stats, discretizer, reweight); else return createHistogram(stats.getValues(), discretizer, reweight); }
/** * Writes a plain text file with two columns. The first columns contains the map keys, the second the values in the * {@code DescriptiveStatistics} object value. For each key, rows are repeated for all values in the {@code * DescriptiveStatistics} object. * * @param table a map with samples stored in a {@code DescriptiveStatistics} object * @param file the filename * @throws IOException */ public static void writeScatterPlot(TDoubleObjectHashMap<DescriptiveStatistics> table, String file) throws IOException { BufferedWriter writer = new BufferedWriter(new FileWriter(file)); TDoubleObjectIterator<DescriptiveStatistics> it = table.iterator(); for (int i = 0; i < table.size(); i++) { it.advance(); double[] vals = it.value().getValues(); for (int j = 0; j < vals.length; j++) { writer.write(String.valueOf(it.key())); writer.write(TAB); writer.write(String.valueOf(vals[j])); writer.newLine(); } } writer.close(); }
public static String testSpeed(HashMethod hm, List<List<byte[]>> hashData, int hashesPerRound, int m, int k, int rounds) { DescriptiveStatistics speed = new DescriptiveStatistics(); HashFunction hf = hm.getHashFunction(); int hashRounds = hashesPerRound / k; Random r = new Random(); for (int i = 0; i < rounds; i++) { List<byte[]> data = hashData.get(i); long start_hash = System.nanoTime(); for (int i1 = 0; i1 < hashRounds; i1++) { int[] hashes = hf.hash(data.get(i1), m, k); } long end_hash = System.nanoTime(); speed.addValue((1.0 * end_hash - start_hash) / 1000000); } System.out.println("HashMethod : " + hm + ", " + " hashes = " + hashesPerRound + ", size = " + m + ", hashes = " + k + ", rounds = " + rounds); //System.out.println(speed); return Arrays.toString(speed.getValues()).replace("[", "{").replace("]", "}"); }
public void addValue(double value) { switch (currentStrategy) { case HEURISTIC: adaptiveHistogram.addValue(value); break; case EXACT: descriptiveStatistics.addValue(value); break; case AUTO: if(descriptiveStatistics.getN() >= exactProcessorMaxCapacity) { adaptiveHistogram = new AdaptiveHistogram(); double[] values = descriptiveStatistics.getValues(); for(int i = 0; i < values.length; i++) { adaptiveHistogram.addValue(values[i]); } adaptiveHistogram.addValue(value); currentStrategy = EstimationStrategy.HEURISTIC; } else { descriptiveStatistics.addValue(value); } } }
/** * Extracts the values out of the {@code DescriptiveStatistics} object and than cals {@link * #writeBoxplot(TDoubleObjectHashMap, String)}. * * @param table a map with a {@code DescriptiveStatistics} object as value * @param file the filename * @throws IOException */ public static void writeBoxplotStats(TDoubleObjectHashMap<DescriptiveStatistics> table, String file) throws IOException { TDoubleObjectIterator<DescriptiveStatistics> it = table.iterator(); TDoubleObjectHashMap<double[]> newTable = new TDoubleObjectHashMap<double[]>(); for (int i = 0; i < table.size(); i++) { it.advance(); newTable.put(it.key(), it.value().getValues()); } writeBoxplot(newTable, file); }
geometricMean = descriptiveStats.getGeometricMean(); sumOfSquares = descriptiveStats.getSumsq(); secondMoment = new SecondMoment().evaluate(descriptiveStats.getValues()); } else { final SummaryStatistics summaryStats = (SummaryStatistics) s;
geometricMean = descriptiveStats.getGeometricMean(); sumOfSquares = descriptiveStats.getSumsq(); secondMoment = new SecondMoment().evaluate(descriptiveStats.getValues()); } else { final SummaryStatistics summaryStats = (SummaryStatistics) s;