Word counts in a class for a 4-word vocabulary are (3,1,0,0). 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 Dir(α1,…,αK) with counts nk gives posterior Dir(α1+n1,…,αK+nK), whose mean is E[θk]=nk+αN+Kα.

Steps

  1. Write the likelihood for counts nk with N=∑knk: p(data∣θ)∝∏kθknk.
  2. Write the prior: p(θ)∝∏kθkα−1, on the simplex θk≥0, ∑kθk=1.
  3. Multiply: p(θ∣data)∝∏kθknk+α−1. This has the same form as the prior, so the posterior is Dir(n1+α,…,nK+α). This is conjugacy: the counts simply add to the prior's pseudo-counts.
  4. A Dirichlet(a1,…,aK) has mean ak/∑jaj. So E[θk∣data]=nk+αN+Kα. This is also the probability that the next word is k (the posterior predictive).
  5. Numbers with α=1, K=4, N=4: the posterior is Dir(4,2,1,1) and the mean is (4,2,1,1)/8=(0.5,0.25,0.125,0.125). The unseen words get probability 0.125 instead of the MLE value 0.
  6. This is add-one (Laplace) smoothing. For comparison, the MLE is nk/N=(0.75,0.25,0,0), and the MAP estimate is nk+α−1N+Kα−K, which equals the MLE when α=1. So the smoothed estimate is the posterior mean, not the MAP.

Common mistakes

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 λ1=1, λ2=2 and λ3=3 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 σ2, using Chebyshev's inequality? If σ2=4, how many samples guarantee P(∣Xˉn−μ∣≥0.5)≤0.01?