Total expectation
The law of total expectation recovers an overall mean by weighting conditional means according to how often their cases occur.
On this page 7 sections
01Average the group averages#
The law of total expectation recovers an overall mean by weighting conditional means according to how often their cases occur. The cases form a complete, disjoint partition of the population.
Let be the mean in case . Weight each mean by its case probability:
One average happens inside each case. The outer average then combines the cases. Equal case weights represent an equally likely mixture. For unequal probabilities, use the actual weights even when equal averaging happens to give the same result.
02Unequal groups need unequal weights#
Suppose cases occur with probabilities , and their conditional means are . Their contributions to the overall mean are and .
The unweighted average of the group means is , which describes a different mixture. Small high-loss groups can matter greatly, but their contribution still uses their probability.
Case probabilities are (0.75,0.25); conditional means are (2,10). Find the overall mean.
Show answer and explanation
The outer weighted average is 1.5+2.5=4.
03Reconstruct the joint weights#
Substitute each conditional mean's weighted sum into the rule. A value in case receives weight . Summing across cases recovers its marginal probability and hence the original expectation.
80% of cases have mean 0 and 20% have mean 10. A draft reports overall mean 5. Repair it.
Show answer and explanation
The correct mixture uses weights 0.8 and 0.2.
In ML, averaging performance separately across groups is not enough to obtain a target population's expected loss. You also need that population's group proportions. Changing the proportions can change the overall mean even when every within-group mean stays fixed.
Recover an unconditional mean by averaging conditional means.
- Recover an unconditional mean by averaging conditional means.
Sources & further reading
- [1]Dive into Deep Learning, §2.6 Probability and Statistics ↗d2l.ai · Article
- [2]Harvard Stat 110, Strategic Practice 10 (2011) ↗stat110.hsites.harvard.edu · Article
- [3]Harvard Stat 110, Strategic Practice and Homework 9 (2011) ↗stat110.hsites.harvard.edu · Article