Conditional Expectation and Conditional Variance
What you'll learn: How to compute the expected value and variance of one random variable when you know the specific value of another random variable.
The Core Idea
Imagine you're analyzing exam scores (random variable Y) and study hours (random variable X). The unconditional expectation E[Y] tells you the average score across all students. But what if you know a student studied exactly 5 hours? The conditional expectation E[Y | X = 5] gives you the average score among only those students who studied 5 hours—often a much more useful number!
Similarly, conditional variance Var(Y | X = 5) measures how spread out the scores are within that specific group of 5-hour studiers.
Mathematical Framework
For discrete random variables:
- Conditional Expectation: E[Y | X = x] = Σ y · P(Y = y | X = x)
- Conditional Variance: Var(Y | X = x) = E[Y² | X = x] − (E[Y | X = x])²
For continuous random variables:
- Conditional Expectation: E[Y | X = x] = ∫ y · f(y | x) dy
- Conditional Variance: Var(Y | X = x) = E[Y² | X = x] − (E[Y | X = x])²
The structure mirrors unconditional moments, but you use the conditional distribution f(y | x) or P(Y = y | X = x) instead of the marginal distribution.
Why It Matters
Conditional expectation lets you update predictions based on observed information. If X represents a measurement you can take early, E[Y | X = x] gives your best prediction of Y given that measurement. The conditional variance tells you how confident you should be in that prediction.
Key Takeaway: Conditional expectation and variance measure the center and spread of one variable within a slice of another variable's values, using conditional distributions in place of marginal ones.