@Override public double getMin() { return delegate.getMin(); }
long min = Math.round(statistics.getMin()); long max = Math.round(statistics.getMax());
public Values(StatisticalSummary summary) { this(summary.getMean(), summary.getVariance(), summary.getN(), summary.getMax(), summary.getMin(), summary.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 ); }
@SuppressWarnings("unchecked") public static <V> DataFrame<V> describe(final DataFrame<V> df) { final DataFrame<V> desc = new DataFrame<>(); for (final Object col : df.columns()) { for (final Object row : df.index()) { final V value = df.get(row, col); if (value instanceof StatisticalSummary) { if (!desc.columns().contains(col)) { desc.add(col); if (desc.isEmpty()) { for (final Object r : df.index()) { for (final Object stat : Arrays.asList("count", "mean", "std", "var", "max", "min")) { final Object name = name(df, r, stat); desc.append(name, Collections.<V>emptyList()); } } } } final StatisticalSummary summary = StatisticalSummary.class.cast(value); desc.set(name(df, row, "count"), col, (V)new Double(summary.getN())); desc.set(name(df, row, "mean"), col, (V)new Double(summary.getMean())); desc.set(name(df, row, "std"), col, (V)new Double(summary.getStandardDeviation())); desc.set(name(df, row, "var"), col, (V)new Double(summary.getVariance())); desc.set(name(df, row, "max"), col, (V)new Double(summary.getMax())); desc.set(name(df, row, "min"), col, (V)new Double(summary.getMin())); } } } return desc; }
long min = Math.round(size.getMin()); long max = Math.round(size.getMax()); if (min == max) {
@SuppressWarnings("unchecked") public static <V> DataFrame<V> describe(final DataFrame<V> df) { final DataFrame<V> desc = new DataFrame<>(); for (final Object col : df.columns()) { for (final Object row : df.index()) { final V value = df.get(row, col); if (value instanceof StatisticalSummary) { if (!desc.columns().contains(col)) { desc.add(col); if (desc.isEmpty()) { for (final Object r : df.index()) { for (final Object stat : Arrays.asList("count", "mean", "std", "var", "max", "min")) { final Object name = name(df, r, stat); desc.append(name, Collections.<V>emptyList()); } } } } final StatisticalSummary summary = StatisticalSummary.class.cast(value); desc.set(name(df, row, "count"), col, (V)new Double(summary.getN())); desc.set(name(df, row, "mean"), col, (V)new Double(summary.getMean())); desc.set(name(df, row, "std"), col, (V)new Double(summary.getStandardDeviation())); desc.set(name(df, row, "var"), col, (V)new Double(summary.getVariance())); desc.set(name(df, row, "max"), col, (V)new Double(summary.getMax())); desc.set(name(df, row, "min"), col, (V)new Double(summary.getMin())); } } } return desc; }
public static String describeDuration(StatisticalSummary duration, TimeUnit units) { double min = duration.getMin(); double max = duration.getMax(); if (min == max) { return describeDuration(max, units); } else { double mean = duration.getMean(); double sem = duration.getStandardDeviation() / Math.sqrt(duration.getN()); String meanDescription; if (sem == 0) { meanDescription = describeDuration(mean, units); } else { TimeUnit targetUnits = displayUnitFor(Math.round(mean), units); double scaledMean = convert(mean, units, targetUnits); double scaledSem = convert(sem, units, targetUnits); meanDescription = "(" + toThreeSigFig(scaledMean, 2000, scaledSem) + ") " + SHORT_TIMEUNIT_NAMES.get(targetUnits); } double sd = duration.getStandardDeviation(); return " min. " + describeDuration(min, units) + ", mean " + meanDescription + ", SD " + describeDuration(sd, units) + ", max. " + describeDuration(max, units); } }
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); }
double min = bandwidth.getMin(); double max = bandwidth.getMax(); double sd = bandwidth.getStandardDeviation();