Statistics
Population variance
stats.population-varianceAlso called population variance, pvariance, pvar, var_pop
where
Mean squared deviation from the mean, dividing by n. This is the variance of the observations themselves; NumPy's var uses it by default (ddof=0).
Notation
observations
x ∈ ℝn
number of observations
Size, at least 2
Result: the variance
scalar
Worked examples
Each result is solved exactly and confirmed by two independent computations.
Given
Result
Given
Result
≈ 1.25
Given
Result
≈ 0.0155555555556
Common mistakes
Divides by n − 1
This is the sample variance, which divides by n − 1; the result is n/(n − 1) times too large.
Fix: Divide the sum of squared deviations by n.
Source
NIST/SEMATECH e-Handbook, §1.3.5.6
NIST/SEMATECH e-Handbook of Statistical Methods. https://www.itl.nist.gov/div898/handbook/ Last updated 2022-04-27. doi:10.18434/M32189