Word counts in a class for a 4-word vocabulary are . With a symmetric Dirichlet prior on the word probabilities , what is the posterior, and how does the posterior mean give add- (Laplace) smoothing as used in naive Bayes?
Probability and statistics, Conjugate priors
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can show that the Dirichlet is conjugate to the categorical/multinomial likelihood and link its posterior mean to Laplace smoothing.
Key idea
Prior with counts gives posterior , whose mean is .
Steps
- Write the likelihood for counts with : .
- Write the prior: , on the simplex , .
- Multiply: . This has the same form as the prior, so the posterior is . This is conjugacy: the counts simply add to the prior's pseudo-counts.
- A Dirichlet has mean . So . This is also the probability that the next word is (the posterior predictive).
- Numbers with , , : the posterior is Dir and the mean is . The unseen words get probability instead of the MLE value .
- This is add-one (Laplace) smoothing. For comparison, the MLE is , and the MAP estimate is , which equals the MLE when . So the smoothed estimate is the posterior mean, not the MAP.
Common mistakes
- Using in the denominator instead of . The probabilities then do not sum to 1.
- Saying add-one smoothing is the MAP estimate with . A Dirichlet prior is flat, so its MAP equals the MLE and the zero counts stay zero.
- Leaving zero probabilities in naive Bayes, so one unseen word sets the whole class likelihood to 0.
How long your answer should be
Half a page; 4 minutes.
Last checked on 4 December 2026.
Read this
Previous in Probability and statistics: Three independent jobs have exponential run times with rates , and per hour. What is the distribution of the time until the first job finishes, and what is the probability that job 1 is the first to finish?
Next in Probability and statistics: How do you prove the weak law of large numbers for i.i.d. random variables with mean and finite variance , using Chebyshev's inequality? If , how many samples guarantee ?