/** * Return a {@link StatisticalSummaryValues} instance reporting current * aggregate statistics. * * @return Current values of aggregate statistics */ public StatisticalSummary getSummary() { synchronized (statistics) { return new StatisticalSummaryValues(getMean(), getVariance(), getN(), getMax(), getMin(), getSum()); } }
/** * Return a {@link StatisticalSummaryValues} instance reporting current * statistics. * @return Current values of statistics */ public StatisticalSummary getSummary() { return new StatisticalSummaryValues(getMean(), getVariance(), getN(), getMax(), getMin(), getSum()); }
variance = m2 / (n - 1); return new StatisticalSummaryValues(mean, variance, n, max, min, sum);
private Optional<StatisticalSummary> getStats(Map<String, double[]> loadedMetrics, String metricName) { double[] metricValues = loadedMetrics.get(metricName); if (metricValues.length >= 2) { return Optional.of(new DescriptiveStatistics(metricValues)); } else if (metricValues.length == 1) { double value = metricValues[0]; return Optional.of(new StatisticalSummaryValues(value, 0, 1, value, value, value)); } else { return Optional.empty(); } }
/** * Return a {@link StatisticalSummaryValues} instance reporting current * statistics. * @return Current values of statistics */ public StatisticalSummary getSummary() { return new StatisticalSummaryValues(getMean(), getVariance(), getN(), getMax(), getMin(), getSum()); }
/** * Return a {@link StatisticalSummaryValues} instance reporting current * aggregate statistics. * * @return Current values of aggregate statistics */ public StatisticalSummary getSummary() { synchronized (statistics) { return new StatisticalSummaryValues(getMean(), getVariance(), getN(), getMax(), getMin(), getSum()); } }
/** * Return a {@link StatisticalSummaryValues} instance reporting current * aggregate statistics. * * @return Current values of aggregate statistics */ public StatisticalSummary getSummary() { synchronized (statistics) { return new StatisticalSummaryValues(getMean(), getVariance(), getN(), getMax(), getMin(), getSum()); } }
/** * Return a {@link StatisticalSummaryValues} instance reporting current * statistics. * @return Current values of statistics */ public StatisticalSummary getSummary() { return new StatisticalSummaryValues(getMean(), getVariance(), getN(), getMax(), getMin(), getSum()); }
public static StatisticalSummary scale(StatisticalSummary s, double scale) { double square = scale * scale; return new StatisticalSummaryValues( s.getMean() * scale, s.getVariance() * square, s.getN(), s.getMax() * scale, s.getMin() * scale, s.getSum() * scale ); }
variance = m2 / (n - 1); return new StatisticalSummaryValues(mean, variance, n, max, min, sum);
variance = m2 / (n - 1); return new StatisticalSummaryValues(mean, variance, n, max, min, sum);
public static StatisticalSummary combine(StatisticalSummary s1, StatisticalSummary s2) { if (s1.getN() == 0){ return s2; } else if (s2.getN() == 0) { return s1; } else if (s1.getN() == 0 && s2.getN() == 0) { return emptySummary; } long n = s1.getN() + s2.getN(); double mean = (s1.getN() * s1.getMean() + s2.getN() * s2.getMean()) / n; double s1Diff = (mean - s1.getMean()) * (mean - s1.getMean()); double s2Diff = (mean - s2.getMean()) * (mean - s2.getMean()); double var = (s1.getN() * (s1.getVariance() + s1Diff) + s2.getN() * (s2.getVariance() + s2Diff)) / n; double sum = s1.getSum() + s2.getSum(); double max = Math.max(s1.getMax(), s2.getMax()); double min = Math.min(s1.getMin(), s2.getMin()); return new StatisticalSummaryValues(mean, var, n, max, min, sum); }
StatisticalSummaryValues sumStats = new StatisticalSummaryValues( mean.getDouble(), sd.getDouble() * sd.getDouble(), (long) n.getDouble(), -1, -1, -1);
StatisticalSummaryValues sumStats0 = new StatisticalSummaryValues( mean0.getDouble(), sd0.getDouble() * sd0.getDouble(), (long) n0.getDouble(), -1, -1, -1); StatisticalSummaryValues sumStats1 = new StatisticalSummaryValues( mean1.getDouble(), sd1.getDouble() * sd1.getDouble(), (long) n1.getDouble(), -1, -1, -1);