Samiksha Jaiswal (Editor)

Law of total variance

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

In probability theory, the law of total variance or variance decomposition formula, also known as Eve's law, states that if X and Y are random variables on the same probability space, and the variance of Y is finite, then

Contents

Var ( Y ) = E [ Var ( Y | X ) ] + Var ( E [ Y | X ] ) .

Some writers on probability call this the "conditional variance formula". In language perhaps better known to statisticians than to probabilists, the two terms are the "unexplained" and the "explained" components of the variance respectively (cf. fraction of variance unexplained, explained variation). In actuarial science, specifically credibility theory, the first component is called the expected value of the process variance (EVPV) and the second is called the variance of the hypothetical means (VHM).

There is a general variance decomposition formula for c ≥ 2 components (see below). For example, with two conditioning random variables:

Var [ Y ] = E [ Var ( Y | X 1 , X 2 ) ] + E [ Var ( E [ Y | X 1 , X 2 ] | X 1 ) ] + Var ( E [ Y | X 1 ] ) ,

which follows from the law of total conditional variance:

Var ( Y | X 1 ) = E [ Var ( Y | X 1 , X 2 ) | X 1 ] + Var ( E [ Y | X 1 , X 2 ] | X 1 ) .

Note that the conditional expected value E( Y | X ) is a random variable in its own right, whose value depends on the value of X. Notice that the conditional expected value of Y given the event X = x is a function of x (this is where adherence to the conventional and rigidly case-sensitive notation of probability theory becomes important!). If we write E( Y | X = x ) = g(x) then the random variable E( Y | X ) is just g(X). Similar comments apply to the conditional variance.

One special case, (similar to the Law of total expectation) states that if A 1 , , A n is a partition of the whole outcome space, i.e. these events are mutually exclusive and exhaustive, then

Var ( X ) = i = 1 n Var ( X | A i ) Pr ( A i ) + i = 1 n E [ X | A i ] 2 ( 1 Pr ( A i ) ) Pr ( A i ) 2 i = 2 n j = 1 i 1 E [ X | A i ] Pr ( A i ) E [ X | A j ] Pr ( A j ) .

In this formula, the first component is the expectation of the conditional variance; the other two rows are the variance of the conditional expectation.

Proof

The law of total variance can be proved using the law of total expectation. First,

Var [ Y ] = E [ Y 2 ] E [ Y ] 2

from the definition of variance. Then we apply the law of total expectation to each term by conditioning on the random variable X:

Now we rewrite the conditional second moment of Y in terms of its variance and first moment:

Since the expectation of a sum is the sum of expectations, the terms can now be regrouped:

Finally, we recognize the terms in parentheses as the variance of the conditional expectation E[Y|X]:

General variance decomposition applicable to dynamic systems

The following formula shows how to apply the general, measure theoretic variance decomposition formula to stochastic dynamic systems. Let Y(t) be the value of a system variable at time t. Suppose we have the internal histories (natural filtrations) H 1 t , H 2 t , , H c 1 , t , each one corresponding to the history (trajectory) of a different collection of system variables. The collections need not be disjoint. The variance of Y(t) can be decomposed, for all times t, into c ≥ 2 components as follows:

Var [ Y ( t ) ] = E ( Var [ Y ( t ) H 1 t , H 2 t , , H c 1 , t ] ) + j = 2 c 1 E ( Var [ E [ Y ( t ) H 1 t , H 2 t , , H j t ] H 1 t , H 2 t , , H j 1 , t ] ) + Var ( E [ Y ( t ) H 1 t ] ) .

The decomposition is not unique. It depends on the order of the conditioning in the sequential decomposition.

The square of the correlation and explained (or informational) variation

In cases where (YX) are such that the conditional expected value is linear; i.e., in cases where

E ( Y X ) = a X + b ,

it follows from the bilinearity of covariance that

a = Cov ( Y , X ) Var ( X )

and

b = E ( Y ) Cov ( Y , X ) Var ( X ) E ( X )

and the explained component of the variance divided by the total variance is just the square of the correlation between Y and X; i.e., in such cases,

Var ( E ( Y X ) ) Var ( Y ) = Corr ( X , Y ) 2 .

One example of this situation is when (X, Y) have a bivariate normal (Gaussian) distribution.

More generally, when the conditional expectation E( Y | X ) is a non-linear function of X

ι Y X = Var ( E ( Y X ) ) Var ( Y ) = Corr ( E ( Y X ) , Y ) 2 ,

which can be estimated as the R squared from a non-linear regression of Y on X, using data drawn from the joint distribution of (X,Y). When E( Y | X ) has a Gaussian distribution (and is an invertible function of X), or Y itself has a (marginal) Gaussian distribution, this explained component of variation sets a lower bound on the mutual information:

I ( Y ; X ) ln ( [ 1 ι Y X ] 1 / 2 ) .

Higher moments

A similar law for the third central moment μ3 says

μ 3 ( Y ) = E ( μ 3 ( Y X ) ) + μ 3 ( E ( Y X ) ) + 3 cov ( E ( Y X ) , var ( Y X ) ) .

For higher cumulants, a simple and elegant generalization exists. See law of total cumulance.

References

Law of total variance Wikipedia