/** * Returns an array of the results of a statistic. * @param stats univariate statistic array * @return results array */ private double[] getResults(StorelessUnivariateStatistic[] stats) { double[] results = new double[stats.length]; for (int i = 0; i < results.length; ++i) { results[i] = stats[i].getResult(); } return results; }
/** * Returns the maximum of the values that have been added. * <p> * Double.NaN is returned if no values have been added. * </p> * @return the maximum */ public double getMax() { return maxImpl.getResult(); }
/** * Returns the geometric mean of the values that have been added. * <p> * Double.NaN is returned if no values have been added. * </p> * @return the geometric mean */ public double getGeometricMean() { return geoMeanImpl.getResult(); }
/** * Returns the mean of the values that have been added. * <p> * Double.NaN is returned if no values have been added. * </p> * @return the mean */ public double getMean() { return meanImpl.getResult(); }
/** * Returns the minimum of the values that have been added. * <p> * Double.NaN is returned if no values have been added. * </p> * @return the minimum */ public double getMin() { return minImpl.getResult(); }
/** * Returns the sum of the logs of the values that have been added. * <p> * Double.NaN is returned if no values have been added. * </p> * @return the sum of logs * @since 1.2 */ public double getSumOfLogs() { return sumLogImpl.getResult(); }
/** * Returns the sum of the values that have been added * @return The sum or <code>Double.NaN</code> if no values have been added */ public double getSum() { return sumImpl.getResult(); }
/** * Returns the sum of the squares of the values that have been added. * <p> * Double.NaN is returned if no values have been added. * </p> * @return The sum of squares */ public double getSumsq() { return sumsqImpl.getResult(); }
/** * Returns the (sample) variance of the available values. * * <p>This method returns the bias-corrected sample variance (using {@code n - 1} in * the denominator). Use {@link #getPopulationVariance()} for the non-bias-corrected * population variance.</p> * * <p>Double.NaN is returned if no values have been added.</p> * * @return the variance */ public double getVariance() { return varianceImpl.getResult(); }
/** * {@inheritDoc} */ @Override public double getResult() { if (sumOfLogs.getN() > 0) { return FastMath.exp(sumOfLogs.getResult() / sumOfLogs.getN()); } else { return Double.NaN; } }
/** * Returns the geometric mean of the values that have been added. * <p> * Double.NaN is returned if no values have been added. * </p> * @return the geometric mean */ public double getGeometricMean() { return geoMeanImpl.getResult(); }
/** * Returns the maximum of the values that have been added. * <p> * Double.NaN is returned if no values have been added. * </p> * @return the maximum */ public double getMax() { return maxImpl.getResult(); }
/** * Returns the minimum of the values that have been added. * <p> * Double.NaN is returned if no values have been added. * </p> * @return the minimum */ public double getMin() { return minImpl.getResult(); }
/** * Returns the sum of the values that have been added * @return The sum or <code>Double.NaN</code> if no values have been added */ public double getSum() { return sumImpl.getResult(); }
/** * Returns the sum of the values that have been added * @return The sum or <code>Double.NaN</code> if no values have been added */ public double getSum() { return sumImpl.getResult(); }
/** * Returns the sum of the logs of the values that have been added. * <p> * Double.NaN is returned if no values have been added. * </p> * @return the sum of logs * @since 1.2 */ public double getSumOfLogs() { return sumLogImpl.getResult(); }
public double getMin() { if (this.statistics.containsKey(StatisticType.Min)) { return this.statistics.get(StatisticType.Min).getResult(); } throw new CoreException("You didn't choose the statistic type Min"); }
public double getSumOfLogs() { if (this.statistics.containsKey(StatisticType.SumOfLogs)) { return this.statistics.get(StatisticType.SumOfLogs).getResult(); } throw new CoreException("You didn't choose the statistic type SumOfLogs"); }
@Override public void result(JsonElement partition, JsonObject result) { double rv = statImpl.getResult(); if (Java7Helper.doubleIsFinite(rv)) result.addProperty(stat.name(), rv); }
@Override public void summary() { getLog().accept(toString()); this.statistics.forEach( (type, statistic) -> getLog().accept(type.name() + ": " + statistic.getResult())); }