/** * {@inheritDoc} */ @Override public void increment(final double d) { if (n < 1) { m3 = m2 = m1 = 0.0; } double prevM2 = m2; super.increment(d); nDevSq = nDev * nDev; double n0 = n; m3 = m3 - 3.0 * nDev * prevM2 + (n0 - 1) * (n0 - 2) * nDevSq * dev; }
/** * @see org.apache.commons.math.stat.descriptive.StorelessUnivariateStatistic#increment(double) */ public void increment(final double d) { if (n < 1) { m3 = m2 = m1 = 0.0; } double prevM2 = m2; super.increment(d); nDevSq = nDev * nDev; double n0 = (double) n; m3 = m3 - 3.0 * nDev * prevM2 + (n0 - 1) * (n0 - 2) * nDevSq * dev; }
/** * {@inheritDoc} * <p>If all values are available, it is more accurate to use * {@link #evaluate(double[])} rather than adding values one at a time * using this method and then executing {@link #getResult}, since * <code>evaluate</code> leverages the fact that is has the full * list of values together to execute a two-pass algorithm. * See {@link Variance}.</p> */ @Override public void increment(final double d) { if (incMoment) { moment.increment(d); } }
/** * {@inheritDoc} * <p>If all values are available, it is more accurate to use * {@link #evaluate(double[])} rather than adding values one at a time * using this method and then executing {@link #getResult}, since * <code>evaluate</code> leverages the fact that is has the full * list of values together to execute a two-pass algorithm. * See {@link Variance}.</p> */ public void increment(final double d) { if (incMoment) { moment.increment(d); } }
/** * {@inheritDoc} */ @Override public void increment(final double d) { if (n < 1) { m3 = m2 = m1 = 0.0; } double prevM2 = m2; super.increment(d); nDevSq = nDev * nDev; double n0 = n; m3 = m3 - 3.0 * nDev * prevM2 + (n0 - 1) * (n0 - 2) * nDevSq * dev; }
/** * {@inheritDoc} * <p>If all values are available, it is more accurate to use * {@link #evaluate(double[])} rather than adding values one at a time * using this method and then executing {@link #getResult}, since * <code>evaluate</code> leverages the fact that is has the full * list of values together to execute a two-pass algorithm. * See {@link Variance}.</p> */ @Override public void increment(final double d) { if (incMoment) { moment.increment(d); } }
/** * Add a value to the data * @param value the value to add */ public void addValue(double value) { sumImpl.increment(value); sumsqImpl.increment(value); minImpl.increment(value); maxImpl.increment(value); sumLogImpl.increment(value); secondMoment.increment(value); // If mean, variance or geomean have been overridden, // need to increment these if (!(meanImpl instanceof Mean)) { meanImpl.increment(value); } if (!(varianceImpl instanceof Variance)) { varianceImpl.increment(value); } if (!(geoMeanImpl instanceof GeometricMean)) { geoMeanImpl.increment(value); } n++; }
/** * Add a value to the data * @param value the value to add */ public void addValue(double value) { sumImpl.increment(value); sumsqImpl.increment(value); minImpl.increment(value); maxImpl.increment(value); sumLogImpl.increment(value); secondMoment.increment(value); // If mean, variance or geomean have been overridden, // need to increment these if (!(meanImpl instanceof Mean)) { meanImpl.increment(value); } if (!(varianceImpl instanceof Variance)) { varianceImpl.increment(value); } if (!(geoMeanImpl instanceof GeometricMean)) { geoMeanImpl.increment(value); } n++; }
/** * Add a value to the data * * @param value the value to add */ public void addValue(double value) { sumImpl.increment(value); sumsqImpl.increment(value); minImpl.increment(value); maxImpl.increment(value); sumLogImpl.increment(value); secondMoment.increment(value); // If mean, variance or geomean have been overridden, // need to increment these if (!(meanImpl instanceof Mean)) { meanImpl.increment(value); } if (!(varianceImpl instanceof Variance)) { varianceImpl.increment(value); } if (!(geoMeanImpl instanceof GeometricMean)) { geoMeanImpl.increment(value); } n++; }