Explore modules

Law of Total Variance

Visualize how total variance decomposes into within-group variance and between-group variance.

Free theory article

Visualize how total variance decomposes into within-group variance and between-group variance.

Concept & interpretation

The Law of Total Variance states that the total variance of a random variable X can be decomposed into two components: the expected value of the conditional variance (within-group variance) and the variance of the conditional expected value (between-group variance).

Experiment

You can verify this decomposition using the interactive Law of Total Variance.

  1. Set "Group-plus probability p" to 0.25.
  2. Set "Mean magnitude d" to 2.
  3. Set "Within-group spread s" to 1.
  4. Observe that the Within Variance is 1.000000.
  5. Observe that the Between Variance is 3.000000.
  6. Read all four atom values/probabilities and their weighted variance terms. The Direct Total Variance and separate decomposition sum are both 4.000000.
  7. Set Group-plus probability p to 0. The plus branch has zero mass and is marked unused. The mean is −2, within variance 1, between variance 0 and direct total 1.
  8. Set Group-plus probability p to 0.5, Mean magnitude d to 0 and Within-group spread s to 0. All atoms coincide at zero; their combined mass is 1 and every variance is zero.
  9. Set Group-plus probability p to 0.75, Mean magnitude d to 2 and Within-group spread s to 0.5. Mean is 1, within variance 1/4, between variance 3 and direct total 13/4.
Read the full free theory article