Skip to content
BIASED

Conditional expectation

Block 1 of 8~2 min

The mean of a slice

The topic The multivariate Gaussian ended with a slice. Take (X1,X2)∼N(0,Σ)(X_1, X_2) \sim \mathcal N(0, \Sigma) with Σ11=2\Sigma_{11} = 2, Σ12=1.2\Sigma_{12} = 1.2 and Σ22=1\Sigma_{22} = 1. Fixing X1=x1X_1 = x_1 leaves a normal distribution for X2X_2, namely N(0.6 x1, 0.28)\mathcal N(0.6\, x_1,\ 0.28). Its mean slides along a straight line as x1x_1 changes. This topic asks the same question for any pair of variables: once we know XX, what is the best guess for YY, and how much error is left?

That is supervised learning in one sentence: features XX, a target YY. Before any model is trained, probability theory already names the best possible guess, provided the joint distribution is known.

The conditional expectation is the expectation of the conditional distribution from the topic Joint distributions and independence. For discrete and continuous YY it reads

E[Y∣X=x]=∑yy pY∣X(y∣x)orE[Y∣X=x]=∫y pY∣X(y∣x) dy.\mathbb E[Y \mid X = x] = \sum_y y\, p_{Y \mid X}(y \mid x) \qquad \text{or} \qquad \mathbb E[Y \mid X = x] = \int y\, p_{Y \mid X}(y \mid x)\, dy .

Back to the two dice. XX is the first die and YY is the larger of the two. Given X=3X = 3, the larger value is 3 whenever the second die shows 1, 2 or 3, with probability 3/63/6. Otherwise it is the second die itself: 4, 5 or 6, each with probability 1/61/6. So

E[Y∣X=3]=3⋅3+4+5+66=4.\mathbb E[Y \mid X = 3] = \frac{3 \cdot 3 + 4 + 5 + 6}{6} = 4 .

Without any information the mean of YY is 161/36≈4.47161/36 \approx 4.47. A low first die pulls the guess down.

Answers are saved on the server and tied to this browser until you sign in.