/** * {@inheritDoc}. This version returns the standard deviation of all the * aggregated data. * * @see StatisticalSummary#getStandardDeviation() */ public double getStandardDeviation() { synchronized (statistics) { return statistics.getStandardDeviation(); } }
/** * {@inheritDoc} */ @Override public synchronized double getStandardDeviation() { return super.getStandardDeviation(); }
/** * Generates a text report displaying summary statistics from values that * have been added. * @return String with line feeds displaying statistics * @since 1.2 */ @Override public String toString() { StringBuilder outBuffer = new StringBuilder(); String endl = "\n"; outBuffer.append("SummaryStatistics:").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("sum: ").append(getSum()).append(endl); outBuffer.append("mean: ").append(getMean()).append(endl); outBuffer.append("geometric mean: ").append(getGeometricMean()) .append(endl); outBuffer.append("variance: ").append(getVariance()).append(endl); outBuffer.append("population variance: ").append(getPopulationVariance()).append(endl); outBuffer.append("second moment: ").append(getSecondMoment()).append(endl); outBuffer.append("sum of squares: ").append(getSumsq()).append(endl); outBuffer.append("standard deviation: ").append(getStandardDeviation()) .append(endl); outBuffer.append("sum of logs: ").append(getSumOfLogs()).append(endl); return outBuffer.toString(); }
double avg = ss.getSum()/ss.getN(), stdev = ss.getStandardDeviation(), cv = stdev/avg; double allowedMin = avg - 2.5 * stdev, allowedMax = avg + 2.5 * stdev; if (allowedMin > ss.getMin() || allowedMax < ss.getMax() || cv > 0.22) {
/** * The within-bin smoothing kernel. Returns a Gaussian distribution * parameterized by {@code bStats}, unless the bin contains only one * observation, in which case a constant distribution is returned. * * @param bStats summary statistics for the bin * @return within-bin kernel parameterized by bStats */ protected RealDistribution getKernel(SummaryStatistics bStats) { if (bStats.getN() == 1 || bStats.getVariance() == 0) { return new ConstantRealDistribution(bStats.getMean()); } else { return new NormalDistribution(randomData.getRandomGenerator(), bStats.getMean(), bStats.getStandardDeviation(), NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY); } } }
private static Stats getStats(NumericColumn<?> values, SummaryStatistics summaryStatistics) { Stats stats = new Stats("Column: " + values.name()); stats.min = summaryStatistics.getMin(); stats.max = summaryStatistics.getMax(); stats.n = summaryStatistics.getN(); stats.sum = summaryStatistics.getSum(); stats.variance = summaryStatistics.getVariance(); stats.populationVariance = summaryStatistics.getPopulationVariance(); stats.quadraticMean = summaryStatistics.getQuadraticMean(); stats.geometricMean = summaryStatistics.getGeometricMean(); stats.mean = summaryStatistics.getMean(); stats.standardDeviation = summaryStatistics.getStandardDeviation(); stats.sumOfLogs = summaryStatistics.getSumOfLogs(); stats.sumOfSquares = summaryStatistics.getSumsq(); stats.secondMoment = summaryStatistics.getSecondMoment(); return stats; }
public double sharpeRatio() { if (stats.getN() == 0) { return 0.00001; } double stdDev = stats.getStandardDeviation(); return stats.getMean() / (stdDev == 0.0 ? 100.0 : stdDev); }
public void print(String indent) { logHistogram.print(indent); System.out.println(); System.out.printf("%smin:%,11.2f max:%,11.2f avg:%,11.2f stddev:%,11.2f\n", indent, stats.getMin(), stats.getMax(), stats.getMean(), stats.getStandardDeviation()); } }
Double.toString(summStats.getStandardDeviation())); unicodeBlocks(contentTags, data); try {
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TokenStatistics that = (TokenStatistics) o; if (totalTokens != that.totalTokens) return false; if (totalUniqueTokens != that.totalUniqueTokens) return false; if (!doubleEquals(that.entropy, entropy)) return false; // Probably incorrect - comparing Object[] arrays with Arrays.equals if (!Arrays.equals(topN, that.topN)) return false; SummaryStatistics thatS = ((TokenStatistics) o).summaryStatistics; if (summaryStatistics.getN() != thatS.getN()) return false; //if both have n==0, don't bother with the stats if (summaryStatistics.getN() ==0L) return true; //TODO: consider adding others... if (!doubleEquals(summaryStatistics.getGeometricMean(), thatS.getGeometricMean())) return false; if (!doubleEquals(summaryStatistics.getMax(), thatS.getMax())) return false; if (!doubleEquals(summaryStatistics.getMean(), thatS.getMean())) return false; if (!doubleEquals(summaryStatistics.getMin(), thatS.getMin())) return false; if (!doubleEquals(summaryStatistics.getSum(), thatS.getSum())) return false; if (!doubleEquals(summaryStatistics.getStandardDeviation(), thatS.getStandardDeviation())) return false; return true; }
/** * {@inheritDoc} */ @Override public synchronized double getStandardDeviation() { return super.getStandardDeviation(); }
/** * {@inheritDoc}. This version returns the standard deviation of all the * aggregated data. * * @see StatisticalSummary#getStandardDeviation() */ public double getStandardDeviation() { synchronized (statistics) { return statistics.getStandardDeviation(); } }
/** * {@inheritDoc}. This version returns the standard deviation of all the * aggregated data. * * @see StatisticalSummary#getStandardDeviation() */ public double getStandardDeviation() { synchronized (statistics) { return statistics.getStandardDeviation(); } }
@Override protected void printFinalResults(String metricName, SummaryStatistics stats) { System.out.printf("Results for metric %s\n", metricName); System.out.printf(" Mean Number of Cloudlets: %.2f\n", cloudletsNumber.stream().mapToDouble(n -> n).average().orElse(0.0)); System.out.printf(" Cloudlet Completion Time Avg: %.2f | Std dev: %.2f\n", stats.getMean(), stats.getStandardDeviation()); System.out.printf(" Cloudlet Completion Min Avg Time: %.2f | Max avg time: %.2f\n", stats.getMin(), stats.getMax()); System.out.println(); }
public void print(String indent) { logHistogram.print(indent); System.out.println(); System.out.printf("%smin:%,11.2f max:%,11.2f avg:%,11.2f stddev:%,11.2f\n", indent, stats.getMin(), stats.getMax(), stats.getMean(), stats.getStandardDeviation()); } }
@Nonnull public synchronized String globalAsString() { return String.format(PATTERN, "TOTAL ", name, globalStats.getN(), globalStats.getMin() * scale, globalStats.getMean() * scale, globalStats.getMax() * scale, globalStats.getStandardDeviation() * scale); }
private void showConfidenceInterval(SummaryStatistics stats) { // Calculate 95% confidence interval final double intervalSize = computeConfidenceErrorMargin(stats, 0.95); final double lower = stats.getMean() - intervalSize; final double upper = stats.getMean() + intervalSize; System.out.printf( "\tTask Completion Time mean 95%% Confidence Interval: %.2f ∓ %.2f, that is [%.2f to %.2f]\n", stats.getMean(), intervalSize, lower, upper); System.out.printf("\tStandard Deviation: %.2f \n", stats.getStandardDeviation()); } }
private void showConfidenceInterval(SummaryStatistics stats) { // Computes 95% confidence interval double intervalSize = computeConfidenceErrorMargin(stats, 0.95); double lower = stats.getMean() - intervalSize; double upper = stats.getMean() + intervalSize; System.out.printf( "\tThis METRIC mean 95%% Confidence Interval: %.6f ∓ %.4f, that is [%.4f to %.4f]\n", stats.getMean(), intervalSize, lower, upper); System.out.printf("\tStandard Deviation: %.4f \n", stats.getStandardDeviation()); }
private void showConfidenceInterval(SummaryStatistics stats) { // Calculate 95% confidence interval double intervalSize = computeConfidenceErrorMargin(stats, 0.95); double lower = stats.getMean() - intervalSize; double upper = stats.getMean() + intervalSize; System.out.printf( "\tTask Completion Time mean 95%% Confidence Interval: %.2f ∓ %.2f, that is [%.2f to %.2f]\n", stats.getMean(), intervalSize, lower, upper); System.out.printf("\tStandard Deviation: %.2f \n", stats.getStandardDeviation()); } }
private void testSampleMeanAndStdDeviation(int v, double expectedMean, double expectedSd, List<Double> samples, double delta) { SummaryStatistics stats = new SummaryStatistics(); samples.forEach(stats::addValue); double mean = stats.getMean(); double sd = stats.getStandardDeviation(); log.trace("Degrees of freedom: " + v); log.trace("Mean: " + mean); log.trace("Standard deviation: " + sd); Assert.assertEquals(expectedMean, mean, delta); Assert.assertEquals(expectedSd, sd, delta); }