Computational formula for the variance
In probability theory and statistics, the computational formula for the variance Var(X) of a random variable X is the formula
where E(X) is the expected value of X. The result is called the König-Huygens theorem in French language literature.
A closely related identity can be used to calculate the sample variance, which is often used as an unbiased estimate of the population variance:
The second result is sometimes, unwisely, used in practice to calculate the variance. The problem is that subtracting two values having a similar value can lead to catastrophic cancellation.[1]
Contents |
[edit] Proof
The computational formula for the population variance follows in a straightforward manner from the linearity of expected values and the definition of variance:
[edit] Generalization to covariance
This formula can be generalized for covariance, with two random variables Xi and Xj:
as well as for the n by n covariance matrix of a random vector of length n:
and for the n by m cross-covariance matrix between two random vectors of length n and m:
where expectations are taken element-wise and
and
are random vectors of respective lengths n and m.
[edit] Applications
Its applications in systolic geometry include Loewner's torus inequality.
[edit] See also
|
|
This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed. (July 2010) |
- ^ Donald E. Knuth (1998). The Art of Computer Programming, volume 2: Seminumerical Algorithms, 3rd edn., p. 232. Boston: Addison-Wesley.
![\operatorname{Var}(X) = \operatorname{E}(X^2) - [\operatorname{E}(X)]^2\,](http://upload.wikimedia.org/wikipedia/en/math/d/2/7/d27b022e1878d94dd536abd9e9a46b28.png)

![\begin{array}{ccl}
\operatorname{Var}(X)&=&\operatorname{E}\left[(X - \operatorname{E}(X))^2\right]\\
&=&\operatorname{E}\left[X^2 - 2X\operatorname{E}(X) + [\operatorname{E}(X)]^2\right]\\
&=&\operatorname{E}(X^2) - \operatorname{E}[2X\operatorname{E}(X)] + [\operatorname{E}(X)]^2\\
&=&\operatorname{E}(X^2) - 2\operatorname{E}(X)\operatorname{E}(X) + [\operatorname{E}(X)]^2\\
&=&\operatorname{E}(X^2) - 2[\operatorname{E}(X)]^2 + [\operatorname{E}(X)]^2\\
&=&\operatorname{E}(X^2) - [\operatorname{E}(X)]^2
\end{array}](http://upload.wikimedia.org/wikipedia/en/math/8/4/3/8439ccff8b1c520d36bd9033966c7e5f.png)


