The "population variance" ( sum((x_i - mean)^2) / n ) can also
be computed using this statistic. The isBiasCorrected
property determines whether the "population" or "sample" value is
returned by the evaluate and getResult methods.
To compute population variances, set this property to false.Note that this implementation is not synchronized. If
multiple threads access an instance of this class concurrently, and at least
one of the threads invokes the increment() or
clear() method, it must be synchronized externally.
variance = sum((x_i - mean)^2) / (n - 1)
where mean is the Mean and
nis the number of sample observations.The definitional formula does not have good numerical properties, so this implementation uses updating formulas based on West's algorithm as described in Chan, T. F. andJ. G. Lewis 1979, Communications of the ACM, vol. 22 no. 9, pp. 526-531..
The "population variance" ( sum((x_i - mean)^2) / n ) can also be computed using this statistic. The
isBiasCorrectedproperty determines whether the "population" or "sample" value is returned by theevaluateandgetResultmethods. To compute population variances, set this property tofalse.Note that this implementation is not synchronized. If multiple threads access an instance of this class concurrently, and at least one of the threads invokes theincrement()orclear()method, it must be synchronized externally.