LESSON 4.3 · ABOUT 20 MINUTES
Conditional moments
Compute an average or spread inside a restricted population.
By the end of this lesson
- Calculate conditional expectation, variance, and standard deviation.
- Connect conditional and unconditional expectation.
Conditional mean
Treat p(x|y) as a new PMF. Then E[X|Y=y]=Σ x·p(x|y). The conditional mean can change as the observed value y changes.
Conditional spread
Compute E[X²|Y=y], then subtract E[X|Y=y]² to find conditional variance. Its nonnegative square root is the conditional standard deviation.
Average the averages
E[X]=Σ_y E[X|Y=y]p_Y(y). Weight the group means by group probabilities; do not simply average group means unless the groups are equally likely.
Var(X | Y=y) = E[X² | Y=y] − E[X | Y=y]²
Worked example
Using [[0.1,0.2],[0.3,0.4]], find E[X|Y=0] and Var(X|Y=0).
Conditionally X is Bernoulli with P(X=1|Y=0)=0.75. Mean=0.75; second moment=0.75; variance=0.75−0.75²=0.1875.