/** * Get the mean of the series. * * @return mean of the series */ public double getMean() { return data.getMean(); }
/** * Get the mean of y values. * * @return y values means */ public double getYMean() { return yData.getMean(); }
/** * Get the mean of x values. * * @return x values means */ public double getXMean() { return xData.getMean(); }
/** * Get the mean of x values. * * @return x values means */ public double getXMean() { return xData.getMean(); }
/** * Get the mean of y values. * * @return y values means */ public double getYMean() { return yData.getMean(); }
/** * Retrieve average response time of the <code>ResponsetimeSample</code> instances. * * @return the average responsetime of all samples */ public final double getAverage() { return responsetimeStats.getMean(); }
/** * Get the mean of the series. * * @return mean of the series */ public double getMean() { return data.getMean(); }
public double getMean() { if (_stats.getN() == 0) { return 0; } return _stats.getMean(); }
public double getMean() { if (_stats.getN() == 0) { return 0; } return _stats.getMean(); }
public static void printTable(TreeBasedTable<Integer, Double, DescriptiveStatistics> table) { System.out.printf("\t%s%n", StringUtils.join(table.columnKeySet(), "\t\t")); for (Map.Entry<Integer, Map<Double, DescriptiveStatistics>> entry : table.rowMap() .entrySet()) { System.out.printf("%s\t", entry.getKey()); for (DescriptiveStatistics ds : entry.getValue().values()) { System.out.printf("%.2f\t%2f\t", ds.getMean(), ds.getStandardDeviation()); } System.out.println(); } }
static void printTable(TreeBasedTable<Integer, Integer, DescriptiveStatistics> table) { System.out.printf("\t%s%n", StringUtils.join(table.columnKeySet(), "\t\t\t")); for (Map.Entry<Integer, Map<Integer, DescriptiveStatistics>> entry : table.rowMap() .entrySet()) { System.out.printf("%s\t", entry.getKey()); for (DescriptiveStatistics ds : entry.getValue().values()) { System.out.printf("%.2f\t%2f\t%d\t", ds.getMean(), ds.getStandardDeviation(), ds.getN()); } System.out.println(); } }
@Override public String getSummaryReport() { final StringBuilder outBuffer = new StringBuilder(); final DescriptiveStatistics ds = computeStats(); outBuffer.append("Aggregate P@" + N + " Statistics:\n"); outBuffer.append(String.format("%-15s\t%6d\n", "num_q", ds.getN())); outBuffer.append(String.format("%-15s\t%6.4f\n", "min", ds.getMin())); outBuffer.append(String.format("%-15s\t%6.4f\n", "max", ds.getMax())); outBuffer.append(String.format("%-15s\t%6.4f\n", "mean", ds.getMean())); outBuffer.append(String.format("%-15s\t%6.4f\n", "std dev", ds.getStandardDeviation())); outBuffer.append(String.format("%-15s\t%6.4f\n", "median", ds.getPercentile(50))); outBuffer.append(String.format("%-15s\t%6.4f\n", "skewness", ds.getSkewness())); outBuffer.append(String.format("%-15s\t%6.4f\n", "kurtosis", ds.getKurtosis())); return outBuffer.toString(); }
@Override public String getSummaryReport() { final StringBuilder outBuffer = new StringBuilder(); final DescriptiveStatistics ds = computeStats(); outBuffer.append("Aggregate P@" + N + " Statistics:\n"); outBuffer.append(String.format("%-15s\t%6d\n", "num_q", ds.getN())); outBuffer.append(String.format("%-15s\t%6.4f\n", "min", ds.getMin())); outBuffer.append(String.format("%-15s\t%6.4f\n", "max", ds.getMax())); outBuffer.append(String.format("%-15s\t%6.4f\n", "mean", ds.getMean())); outBuffer.append(String.format("%-15s\t%6.4f\n", "std dev", ds.getStandardDeviation())); outBuffer.append(String.format("%-15s\t%6.4f\n", "median", ds.getPercentile(50))); outBuffer.append(String.format("%-15s\t%6.4f\n", "skewness", ds.getSkewness())); outBuffer.append(String.format("%-15s\t%6.4f\n", "kurtosis", ds.getKurtosis())); return outBuffer.toString(); }
/** * Generates a text report displaying univariate statistics from values * that have been added. Each statistic is displayed on a separate * line. * * @return String with line feeds displaying statistics */ @Override public String toString() { StringBuilder outBuffer = new StringBuilder(); String endl = "\n"; outBuffer.append("DescriptiveStatistics:").append(endl); outBuffer.append("n: ").append(getN()).append(endl); outBuffer.append("min: ").append(getMin()).append(endl); outBuffer.append("max: ").append(getMax()).append(endl); outBuffer.append("mean: ").append(getMean()).append(endl); outBuffer.append("std dev: ").append(getStandardDeviation()) .append(endl); outBuffer.append("median: ").append(getPercentile(50)).append(endl); outBuffer.append("skewness: ").append(getSkewness()).append(endl); outBuffer.append("kurtosis: ").append(getKurtosis()).append(endl); return outBuffer.toString(); }
/** * Generates a text report displaying univariate statistics from values * that have been added. Each statistic is displayed on a separate * line. * * @return String with line feeds displaying statistics */ public String toString() { StringBuffer outBuffer = new StringBuffer(); outBuffer.append("DescriptiveStatistics:\n"); outBuffer.append("n: " + getN() + "\n"); outBuffer.append("min: " + getMin() + "\n"); outBuffer.append("max: " + getMax() + "\n"); outBuffer.append("mean: " + getMean() + "\n"); outBuffer.append("std dev: " + getStandardDeviation() + "\n"); outBuffer.append("median: " + getPercentile(50) + "\n"); outBuffer.append("skewness: " + getSkewness() + "\n"); outBuffer.append("kurtosis: " + getKurtosis() + "\n"); return outBuffer.toString(); }
/** * Normalize (standardize) the series, so in the end it is having a mean of 0 and a standard deviation of 1. * * @param sample sample to normalize * @return normalized (standardized) sample * @since 2.2 */ public static double[] normalize(final double[] sample) { DescriptiveStatistics stats = new DescriptiveStatistics(); // Add the data from the series to stats for (int i = 0; i < sample.length; i++) { stats.addValue(sample[i]); } // Compute mean and standard deviation double mean = stats.getMean(); double standardDeviation = stats.getStandardDeviation(); // initialize the standardizedSample, which has the same length as the sample double[] standardizedSample = new double[sample.length]; for (int i = 0; i < sample.length; i++) { // z = (x- mean)/standardDeviation standardizedSample[i] = (sample[i] - mean) / standardDeviation; } return standardizedSample; }
/** * Get the mean, variance and the third central moment from an array of doubles. * @param distribution the array of doubles * @return a float of length three. Encodes the mean, the variance and the * third central moment */ private static float[] getThreeMoments(double[] distribution) { DescriptiveStatistics descriptiveStatistics = new DescriptiveStatistics(); for (double val : distribution){ descriptiveStatistics.addValue(val); } float[] outVals = new float[3]; outVals[0] = (float) descriptiveStatistics.getMean(); outVals[1] = (float) descriptiveStatistics.getVariance(); outVals[2] = (float) descriptiveStatistics.getSkewness(); return outVals; }
/** * Compute the current aggregate statistics of the * accumulated results. * * @return the current aggregate statistics */ public AggregateStatistics computeStatistics() { DescriptiveStatistics accuracy = new DescriptiveStatistics(); DescriptiveStatistics errorRate = new DescriptiveStatistics(); for (CMResult<CLASS> result : matrices) { ConfusionMatrix<CLASS> m = result.getMatrix(); accuracy.addValue(m.getAccuracy()); errorRate.addValue(m.getErrorRate()); } AggregateStatistics s = new AggregateStatistics(); s.meanAccuracy = accuracy.getMean(); s.stddevAccuracy = accuracy.getStandardDeviation(); s.meanErrorRate = errorRate.getMean(); s.stddevErrorRate = errorRate.getStandardDeviation(); return s; }
/** * Compute the current aggregate statistics of the * accumulated results. * * @return the current aggregate statistics */ public AggregateStatistics computeStatistics() { DescriptiveStatistics accuracy = new DescriptiveStatistics(); DescriptiveStatistics errorRate = new DescriptiveStatistics(); for (CMResult<CLASS> result : matrices) { ConfusionMatrix<CLASS> m = result.getMatrix(); accuracy.addValue(m.getAccuracy()); errorRate.addValue(m.getErrorRate()); } AggregateStatistics s = new AggregateStatistics(); s.meanAccuracy = accuracy.getMean(); s.stddevAccuracy = accuracy.getStandardDeviation(); s.meanErrorRate = errorRate.getMean(); s.stddevErrorRate = errorRate.getStandardDeviation(); return s; }
private void logStats(double sla, String name, DescriptiveStatistics ds, String units, List<SortableStat> stats) { //logStatOverSLA(ds.getMin(), sla, units + " min " + name, stats); //logStatOverSLA(ds.getMax(), sla, units + " max " + name, stats); logStatOverSLA(ds.getMean(), sla, units + " mean " + name, stats); //logStatOverSLA(ds.getVariance(), sla,units + " variance " + name, stats); logStatOverSLA(ds.getPercentile(50), sla, units + " 50th " + name, stats); logStatOverSLA(ds.getPercentile(75), sla, units + " 75th " + name, stats); logStatOverSLA(ds.getPercentile(90), sla, units + " 90th " + name, stats); //logStatOverSLA(ds.getPercentile(95), sla, units + " 95th " + name, stats); logStatOverSLA(ds.getPercentile(99), sla, units + " 99th " + name, stats); }