Variance
Variance is a measure of dispersion or spread. It is the second central moment.
Description
Variance is measure of how much observations vary from the expected value. If the expected value is expressed in 'units', then variance is expressed in 'units squared'. This can pose challenges to interpretation, so a closely related statistic is the standard deviation: the square root of variance.
For a random variable X, the variance is usually notated as Var(X) or Var[X]. In contexts where the distribution in question is understood, especially error when analyzing a model, more common notations are σ2 for population variance or s2 for sample variance. (This enables notation like si2, for the variance of errors for observation i.)
Formulation
Formally, the second central moment (implicitly taking the expected value as the center) of a continuous quantitative (numeric) random variable is:
where Ω is the sample space and f is the probability density function for that distribution.
And for a discrete quantitative random variable:
where Ω is the set of possible values and f is the probability mass function for that distribution (although the distributions of discrete random variables are commonly given as tables, rather than mathematical functions).
But when working with a set of observations X, where for each observation i there is an observed value xi, the most common formulas for variance are:
To get from the first to the second, the derivation for discrete variables is:
Σ (x - μ)2 P(x=X)
Σ (x2 - 2μx + μ2) P(x=X)
Σ [x2 P(x=X)] - 2μ Σ [x P(x=X)] + μ2 Σ [P(x=X)]
[E[X2]] - 2μ [μ] + μ2 [1]
E[X2] - 2μ2 + μ2
E[X2] - μ2
E[X2] - (E[X])2
The derivation for continuous variables is:
∫ (x - μ)2 f(x) dx
∫ (x2 - 2μx + μ2) f(x) dx
∫ [x2 f(x) dx] - 2μ ∫ [x f(x) dx] + μ2 ∫ [f(x) dx]
[E[X2]] - 2μ [μ] + μ2 [1]
E[X2] - 2μ2 + μ2
E[X2] - μ2
E[X2] - (E[X])2
(Recall that definitionally, 1 = ∫ f(x) dx for any probability density function.)
It should also be clear that you can pick out the formulation as Var(X) = Σ(X2)/n - (E[X])2, which can be useful in certain situations.
Variance as a Function
If the variance of a random variable X is known, adding a constant to X does not change the variance. Multiplying X by a constant factor scales the known variance by the square of the factor. Succinctly: Var(aX + b) = a2 Var(X)
The variance of a ratio, i.e. Var(X/Y) where both X and Y are variable, is nonlinear.
