Conditional Expectation
Conditional expectation is just expectation computed with conditional probability:
For discrete:
E[X∣Y]=∑xx⋅pX∣Y(x∣y)dx
For continuous:
E[X∣Y]=∫∞−∞x⋅fX∣Y(x∣y)dx
- Law of total expectation allows us to decompose expectation into smaller expectations:
E[X]=∑yE[X∣Y=y]pY(y)E[X]=∫∞−∞E[X∣Y=y]fY(y)dycompact form:E[X]=EY[EX|Y[X|Y]]
Here the subscripts on the expectation tell you what distribution to use.