A coin's probability of heads has prior , and you observe 7 heads in 10 tosses. What is the posterior, and how do the MLE, the MAP estimate and the posterior mean compare?
Probability and statistics, Bayesian inference
Level L2 Elementary. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can use a conjugate prior and know the difference between the mode and the mean of a posterior.
Key idea
The density is proportional to . It is conjugate to coin tosses: the posterior is again a Beta. A prior with heads and tails gives a posterior, here .
Steps
- Write the two pieces. Likelihood: , ignoring the binomial coefficient, which does not depend on . Prior: .
- Multiply them (Bayes' rule, up to a constant): posterior . This is the shape of .
- Compute the three estimates. MLE . MAP is the mode of the posterior, . Posterior mean .
- Give the uncertainty. Posterior variance , a standard deviation of about 0.12.
- Interpret. The prior acts like extra imaginary tosses (pseudo-counts) that pull the estimate towards 0.5, and the pull fades as you collect more data. The posterior mean is also the probability that the next toss is heads. Laplace smoothing, , is the case.
Common mistakes
- Using as the MAP estimate. That is the mean; the mode is (when ).
- Adding the counts to the wrong parameters. Heads go to the first one.
- Saying the prior “adds 2 heads and 2 tails” in every formula. For the mean it adds and ; for the mode it adds only and .
How long your answer should be
Half a page; about 3 minutes.
Read this
- Murphy, Probabilistic Machine Learning: An Introduction: Free PDF. Section 4.6.2, The beta-binomial model: posterior, MAP (4.6.2.6), posterior mean (4.6.2.7), posterior variance (4.6.2.8) and predictive (4.6.2.9).
- Deisenroth, Faisal and Ong, Mathematics for Machine Learning: Free PDF. Section 6.6.1, Conjugacy: Examples 6.11 and 6.12 (Beta-Binomial and Beta-Bernoulli conjugacy) give a short derivation.
- NPTEL: Pattern Recognition (IISc Bangalore, Prof. P.S. Sastry): Module 3, Bayesian estimation of parameters of density functions and MAP estimates: worked Bayesian estimation with conjugate priors.
Previous in Probability and statistics: A bootstrap sample of size is drawn with replacement from data points. What is the probability that a given point is left out, what does it tend to as , and how is this used?
Next in Probability and statistics: A bag holds 4 red and 6 blue balls. You draw 3 balls at random without replacement. What is the probability that exactly 2 are red?