/** * Returns the product of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * * @param values the input array * @return the product of the values or Double.NaN if the array is empty * @throws IllegalArgumentException if the array is null */ public static double product(final double[] values) { return PRODUCT.evaluate(values); }
/** * Copies source to dest. * <p>Neither source nor dest can be null.</p> * * @param source DescriptiveStatistics to copy * @param dest DescriptiveStatistics to copy to * @throws NullPointerException if either source or dest is null */ public static void copy(DescriptiveStatistics source, DescriptiveStatistics dest) { // Copy data and window size dest.eDA = source.eDA.copy(); dest.windowSize = source.windowSize; // Copy implementations dest.maxImpl = source.maxImpl.copy(); dest.meanImpl = source.meanImpl.copy(); dest.minImpl = source.minImpl.copy(); dest.sumImpl = source.sumImpl.copy(); dest.varianceImpl = source.varianceImpl.copy(); dest.sumsqImpl = source.sumsqImpl.copy(); dest.geometricMeanImpl = source.geometricMeanImpl.copy(); dest.kurtosisImpl = source.kurtosisImpl; dest.skewnessImpl = source.skewnessImpl; dest.percentileImpl = source.percentileImpl; } }
/** * Copies source to dest. * <p>Neither source nor dest can be null.</p> * * @param source DescriptiveStatistics to copy * @param dest DescriptiveStatistics to copy to * @throws NullPointerException if either source or dest is null */ public static void copy(DescriptiveStatistics source, DescriptiveStatistics dest) { // Copy data and window size dest.eDA = source.eDA.copy(); dest.windowSize = source.windowSize; // Copy implementations dest.maxImpl = source.maxImpl.copy(); dest.meanImpl = source.meanImpl.copy(); dest.minImpl = source.minImpl.copy(); dest.sumImpl = source.sumImpl.copy(); dest.varianceImpl = source.varianceImpl.copy(); dest.sumsqImpl = source.sumsqImpl.copy(); dest.geometricMeanImpl = source.geometricMeanImpl.copy(); dest.kurtosisImpl = source.kurtosisImpl; dest.skewnessImpl = source.skewnessImpl; dest.percentileImpl = source.percentileImpl; } }
@Override public double evaluate(double[] values, int begin, int length) { return delegate.evaluate(values, begin, length); } }
@Override public double evaluate(double[] values) { return delegate.evaluate(values); }
/** * Returns the product of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * * @param values the input array * @return the product of the values or Double.NaN if the array is empty * @throws IllegalArgumentException if the array is null */ public static double product(final double[] values) { return prod.evaluate(values); }
/** * Returns the product of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * * @param values the input array * @return the product of the values or Double.NaN if the array is empty * @throws IllegalArgumentException if the array is null */ public static double product(final double[] values) { return PRODUCT.evaluate(values); }
/** * Returns the sum of the squares of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * * @param values input array * @return the sum of the squared values or <code>Double.NaN</code> if the * array is empty * @throws IllegalArgumentException if the array is null */ public static double sumSq(final double[] values) { return SUM_OF_SQUARES.evaluate(values); }
/** * Returns the sum of the squares of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * * @param values input array * @return the sum of the squared values or <code>Double.NaN</code> if the * array is empty * @throws IllegalArgumentException if the array is null */ public static double sumSq(final double[] values) { return sumSq.evaluate(values); }
/** * Returns the sum of the squares of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * * @param values input array * @return the sum of the squared values or <code>Double.NaN</code> if the * array is empty * @throws IllegalArgumentException if the array is null */ public static double sumSq(final double[] values) { return SUM_OF_SQUARES.evaluate(values); }
/** * Returns the sum of the values in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the input array * is null.</p> * * @param values array of values to sum * @return the sum of the values or <code>Double.NaN</code> if the array * is empty * @throws IllegalArgumentException if the array is null */ public static double sum(final double[] values) { return SUM.evaluate(values); }
/** * Returns the arithmetic mean of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * <p> * See {@link org.apache.commons.math.stat.descriptive.moment.Mean} for * details on the computing algorithm.</p> * * @param values the input array * @return the mean of the values or Double.NaN if the array is empty * @throws IllegalArgumentException if the array is null */ public static double mean(final double[] values) { return MEAN.evaluate(values); }
/** * Returns the arithmetic mean of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * <p> * See {@link org.apache.commons.math.stat.descriptive.moment.Mean} for * details on the computing algorithm.</p> * * @param values the input array * @return the mean of the values or Double.NaN if the array is empty * @throws IllegalArgumentException if the array is null */ public static double mean(final double[] values) { return MEAN.evaluate(values); }
/** * Returns the sum of the values in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the input array * is null.</p> * * @param values array of values to sum * @return the sum of the values or <code>Double.NaN</code> if the array * is empty * @throws IllegalArgumentException if the array is null */ public static double sum(final double[] values) { return SUM.evaluate(values); }
/** * Returns the sum of the values in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the input array * is null.</p> * * @param values array of values to sum * @return the sum of the values or <code>Double.NaN</code> if the array * is empty * @throws IllegalArgumentException if the array is null */ public static double sum(final double[] values) { return sum.evaluate(values); }
/** * Returns the sum of the natural logs of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * <p> * See {@link org.apache.commons.math.stat.descriptive.summary.SumOfLogs}. * </p> * * @param values the input array * @return the sum of the natural logs of the values or Double.NaN if * the array is empty * @throws IllegalArgumentException if the array is null */ public static double sumLog(final double[] values) { return sumLog.evaluate(values); }
/** * Returns the sum of the natural logs of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * <p> * See {@link org.apache.commons.math.stat.descriptive.summary.SumOfLogs}. * </p> * * @param values the input array * @return the sum of the natural logs of the values or Double.NaN if * the array is empty * @throws IllegalArgumentException if the array is null */ public static double sumLog(final double[] values) { return SUM_OF_LOGS.evaluate(values); }
/** * Returns the sum of the entries in the specified portion of * the input array, or <code>Double.NaN</code> if the designated subarray * is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * * @param values the input array * @param begin index of the first array element to include * @param length the number of elements to include * @return the sum of the values or Double.NaN if length = 0 * @throws IllegalArgumentException if the array is null or the array index * parameters are not valid */ public static double sum(final double[] values, final int begin, final int length) { return SUM.evaluate(values, begin, length); }
/** * Returns the arithmetic mean of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * <p> * See {@link org.apache.commons.math.stat.descriptive.moment.Mean} for * details on the computing algorithm.</p> * * @param values the input array * @return the mean of the values or Double.NaN if the array is empty * @throws IllegalArgumentException if the array is null */ public static double mean(final double[] values) { return mean.evaluate(values); }
/** * Returns the sum of the natural logs of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * <p> * See {@link org.apache.commons.math.stat.descriptive.summary.SumOfLogs}. * </p> * * @param values the input array * @return the sum of the natural logs of the values or Double.NaN if * the array is empty * @throws IllegalArgumentException if the array is null */ public static double sumLog(final double[] values) { return SUM_OF_LOGS.evaluate(values); }