IncrementalAverage.variance

Computes the variance, a measure of the spread of a distribution to quantify how far a set of data values is spread out.

Note that the Welford's algorithm implementation is used to compute the spread of a distribution incrementally when a value is added through addToAverage(). http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance

#Online_algorithm

In standard statistical practice, a correction factor of 0 provides a maximum likelihood estimate of the variance for normally distributed variables, while a correction factor of 1 provides an unbiased estimator of the variance of a hypothetical infinite population. The correction factor will be subtracted from the number of elements added (sample points) when working out the divisor. For more information about correction factors that could be set please see http://en.wikipedia.org/wiki/Standard_deviation#Estimation

struct IncrementalAverage
double
variance
(
double correction_factor = 0
)

Parameters

correction_factor double

correction factor to normalise the divisor used in the calculation

Return Value

Type: double

The variance of the set of data values added

Meta