evaluate methods leverage the fact that they have the full array of values in memory to execute a two-pass algorithm. Specifically, these methods use the "corrected two-pass algorithm" from Chan, Golub, Levesque, Algorithms for Computing the Sample Variance, American Statistician, vol. 37, no. 3 (1983) pp. 242-247.increment or incrementAll and then executing getResult will sometimes give a different, less accurate, result than executing evaluate with the full array of values. The former approach should only be used when the full array of values is not available. 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.
evaluate methods leverage the fact that they have the full array of values in memory to execute a two-pass algorithm. Specifically, these methods use the "corrected two-pass algorithm" from Chan, Golub, Levesque, Algorithms for Computing the Sample Variance, American Statistician, vol. 37, no. 3 (1983) pp. 242-247.increment or incrementAll and then executing getResult will sometimes give a different, less accurate, result than executing evaluate with the full array of values. The former approach should only be used when the full array of values is not available. 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.
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |