A coin has unknown heads probability θ with prior θ∼Beta(2,2). After 10 tosses you see 7 heads and 3 tails. Find the posterior, the MLE, the MAP estimate and the posterior mean. What is the probability that the next toss is heads, and the probability that the next two tosses are both heads?

Probabilistic models, Conjugate priors
Level L2 Elementary. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you can use Beta–Binomial conjugacy and tell the MLE, MAP and posterior mean apart.

Key idea

A Beta prior is conjugate to the Binomial likelihood. Multiply θa−1(1−θ)b−1 by θh(1−θ)t to get Beta(a+h, b+t). The predictive probability of heads is the posterior mean.

Steps

  1. Combine prior and likelihood: the prior density is proportional to θ1(1−θ)1 and the likelihood for 7 heads and 3 tails is proportional to θ7(1−θ)3, giving posterior ∝θ8(1−θ)4. This is Beta(2+7, 2+3)=Beta(9,5).
  2. MLE ignores the prior: θ^=7/10=0.7.
  3. MAP is the mode of Beta(a,b): (a−1)/(a+b−2)=8/12≈0.667.
  4. Posterior mean is a/(a+b)=9/14≈0.643. The prior pulls both estimates from 0.7 towards 0.5.
  5. Next toss: P(H∣data)=∫θ p(θ∣data)dθ=9/14≈0.643.
  6. Next two tosses: E[θ2]=a(a+1)(a+b)(a+b+1)=9⋅1014⋅15=90210≈0.429. This is more than (9/14)2≈0.413, because the tosses are not independent once θ is unknown.

Common mistakes

How long your answer should be

Half a page; 4 minutes.

Read this

Previous in Probabilistic models: In the model y=wx+ε with prior w∼N(0,1) and noise ε∼N(0,0.25), you observe (x,y)=(1,2) and (2,3). Find the posterior mean and variance of w. How is the posterior mean related to ridge regression?
Next in Probabilistic models: You want samples from p(x)=6x(1−x) on [0,1] (the Beta(2,2) density) using a Uniform(0,1) proposal. Find the smallest valid envelope constant M, the acceptance rule and the acceptance probability. What changes if you only know the unnormalised density p~(x)=x(1−x)?