Statistics
Intermediate
8 min

Law of Total Variance

Var(X) splits into an average within-group variance plus the variance of the group means: within-group + between-group.

1. The idea

The law of total variance decomposes into two interpretable pieces: .

The first term, , is the average 'within-group' variability — how spread out is inside each scenario of . The second term, , is the 'between-group' variability — how much the conditional means themselves differ across scenarios.

This decomposition explains why mixing regimes with different means increases overall variance even if each regime individually has low variance: the between-group term adds extra spread.

2. Why it matters

This identity underlies why regime-switching or mixture models can look far riskier in aggregate than any single regime, a frequent subtlety in risk and volatility interview questions.

3. Core mathematics

Law of total variance

4. How to recognize it

Think of this when…

  • X's distribution differs across regimes/groups defined by Y
  • You are asked for overall variance given per-group means and variances
  • The question tests whether mixing populations can increase variance beyond any individual group's

5. Worked example

Worked example

A trading strategy is in regime A (prob 0.5, mean return 2, variance 1) or regime B (prob 0.5, mean return 6, variance 1). Find the unconditional variance of return.

  1. 1

    Within-group term: both regimes have variance 1, so the average is 1.

  2. 2

    Between-group term: the overall mean is . Compute variance of the conditional means around 4.

  3. 3

    Add the two components.

  4. Answer: , far above either regime's own variance of 1

6. Common mistakes

  • Reporting only the within-group variance and ignoring the between-group term
  • Computing the between-group term as the variance of Y instead of the variance of the conditional means E[X|Y]
  • Assuming variance of a mixture equals the weighted average of the component variances

7. Quick check

If all regimes have the same conditional mean but different variances, the between-group term equals:

8. Practice

2 QuantSolve questions use this concept.

Practice this concept

9. Related methods