B. P. Welford
Note on a method for calculating corrected sums of squares and products
in: Technometrics 4(3)
D.H.D. West
Updating Mean and Variance Estimates: An Improved Method
In: Communications of the ACM, Volume 22 Issue 9
Computes the arithmetic mean of a set of values. Uses the definitional formula:
mean = sum(x_i) / n
where n
is the number of observations.
When {@link #increment(double)} is used to add data incrementally from astream of (unstored) values, the value of the statistic that {@link #getResult()} returns is computed using the following recursiveupdating algorithm:
m =
the first valuem = m + (new value - m) / (number of observations)
If {@link #evaluate(double[])} is used to compute the mean of an arrayof stored values, a two-pass, corrected algorithm is used, starting with the definitional formula computed using the array of stored values and then correcting this by adding the mean deviation of the data values from the arithmetic mean. See, e.g. "Comparison of Several Algorithms for Computing Sample Means and Variances," Robert F. Ling, Journal of the American Statistical Association, Vol. 69, No. 348 (Dec., 1974), pp. 859-866.
Returns Double.NaN
if the dataset is empty.
increment()
or clear()
method, it must be synchronized externally.
@version $Revision: 1006299 $ $Date: 2010-10-10 16:47:17 +0200 (dim. 10 oct. 2010) $
Computes the arithmetic mean of a set of values. Uses the definitional formula:
mean = sum(x_i) / n
where n
is the number of observations.
When {@link #increment(double)} is used to add data incrementally from astream of (unstored) values, the value of the statistic that {@link #getResult()} returns is computed using the following recursiveupdating algorithm:
m =
the first valuem = m + (new value - m) / (number of observations)
If {@link #evaluate(double[])} is used to compute the mean of an arrayof stored values, a two-pass, corrected algorithm is used, starting with the definitional formula computed using the array of stored values and then correcting this by adding the mean deviation of the data values from the arithmetic mean. See, e.g. "Comparison of Several Algorithms for Computing Sample Means and Variances," Robert F. Ling, Journal of the American Statistical Association, Vol. 69, No. 348 (Dec., 1974), pp. 859-866.
Returns Double.NaN
if the dataset is empty.
increment()
or clear()
method, it must be synchronized externally.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|