/** * Computes the empirical distribution using values from the file * in <code>valuesFileURL</code> and <code>binCount</code> bins. * <p> * <code>valuesFileURL</code> must exist and be readable by this process * at runtime.</p> * <p> * This method must be called before using <code>getNext()</code> * with <code>mode = DIGEST_MODE</code></p> * * @param binCount the number of bins used in computing the empirical * distribution * @throws NullArgumentException if the {@code valuesFileURL} has not been set * @throws IOException if an error occurs reading the input file * @throws ZeroException if URL contains no data */ public void computeDistribution(int binCount) throws NullArgumentException, IOException, ZeroException { empiricalDistribution = new EmpiricalDistribution(binCount, randomData.getRandomGenerator()); empiricalDistribution.load(valuesFileURL); mu = empiricalDistribution.getSampleStats().getMean(); sigma = empiricalDistribution.getSampleStats().getStandardDeviation(); }
@Override public double getStandardDeviation() { return delegate.getStandardDeviation(); }
} else { double mean = statistics.getMean(); double sd = statistics.getStandardDeviation(); double sem = sd / Math.sqrt(statistics.getN());
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); } }
} else { double mean = size.getMean(); double sem = size.getStandardDeviation() / Math.sqrt(size.getN()); String meanDescription; if (sem == 0) { long sd = Math.round(size.getStandardDeviation()); return "min. " + describeSize(min) + ", mean " + meanDescription
@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; }
@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; }
/** * Computes the empirical distribution using values from the file * in <code>valuesFileURL</code> and <code>binCount</code> bins. * <p> * <code>valuesFileURL</code> must exist and be readable by this process * at runtime.</p> * <p> * This method must be called before using <code>getNext()</code> * with <code>mode = DIGEST_MODE</code></p> * * @param binCount the number of bins used in computing the empirical * distribution * @throws NullArgumentException if the {@code valuesFileURL} has not been set * @throws IOException if an error occurs reading the input file * @throws ZeroException if URL contains no data */ public void computeDistribution(int binCount) throws NullArgumentException, IOException, ZeroException { empiricalDistribution = new EmpiricalDistribution(binCount, randomData.getRandomGenerator()); empiricalDistribution.load(valuesFileURL); mu = empiricalDistribution.getSampleStats().getMean(); sigma = empiricalDistribution.getSampleStats().getStandardDeviation(); }
double sd = bandwidth.getStandardDeviation(); } else { double mean = bandwidth.getMean(); double sem = bandwidth.getStandardDeviation() / Math.sqrt(bandwidth.getN()); String meanDescription; if (sem == 0) {