Law of Iterated Expectations (LIE)

"The Expectation of the Conditional Expectation is the Expectation"

1. Mathematical Expression

$$E[X] = E[E[X|Y]]$$

Left $E[X]$: The unconditional expectation of random variable $X$ (big picture view).

Inner $E[X|Y]$: This is a random variable with respect to $Y$. When $Y$ takes different values, we observe the conditional average of $X$ (hierarchical view).

Outer $E[\cdot]$: Take the weighted average of these hierarchical means.

Discrete Form Expansion:

$$E[X] = \sum_{y} E[X|Y=y] \cdot P(Y=y)$$

This is the core formula demonstrated in the visualization below.

2. Intuitive Understanding: Hierarchical Thinking

Imagine you want to calculate the average height of all students in a school ($E[X]$):

  1. First, group students by grade (condition $Y$).
  2. Calculate the average height for each grade (conditional expectation $E[X|Y=y]$).
  3. Take the weighted average of these grade averages, weighted by grade size.
  4. The result equals the overall school average height.

Applications:

Econometrics Machine Learning Decision Theory Financial Engineering

3. Calculation Steps Breakdown

Step 1: Calculate Conditional Expectations

For each subgroup Y, calculate the mean of X:
E[X|A] = 40.0 E[X|B] = 70.0 E[X|C] = 55.0

Step 2: Get Weights

Probability weights for each subgroup:
P(A) = 30% P(B) = 50% P(C) = 20%

Step 3: Weighted Sum

40.0×0.30 + 70.0×0.50 + 55.0×0.20

Step 4: Get Unconditional Expectation

E[X] = 59.0

Multi-layer Population Expectation Decomposition

气泡大小代表权重 $P(Y)$, 内部高度代表 $E[X|Y]$

最终全期望 $E[X]$

0.00

Law of Iterated Expectations holds

Group A: E[X|Y=A]

0.0

30%
Group B: E[X|Y=B]

0.0

50%
Group C: E[X|Y=C]

0.0

20%

Verify Formula:

E[X] = Σ E[X|Y=y]·P(Y=y)

Key Insights

Significance of the Law

The Law of Iterated Expectations shows that we can calculate overall expectation by first computing conditional expectations at each level, then integrating them through weighted averaging. This provides a methodology for decomposing complex problems.

Visual Interpretation

In the visualization, each bubble's size represents the subgroup weight P(Y), and the column height represents the conditional expectation E[X|Y]. The baseline for E[X] shows where the weighted average falls.