Interactive demo · Statistical Methods for Modern Biology · Chapter 2

Bayesian updating of a proportion

A Beta(α, β) prior for a proportion p and y successes in n binomial trials give the posterior Beta(α + y, β + n − y). Its mean is a weighted average of the prior mean and the observed proportion y/n, with weight w = (α + β)/(α + β + n) on the prior: the prior acts like α + β extra observations. The left panel shows prior (gold, dashed), likelihood (blue, scaled to a density) and posterior (teal) with its 95% credible interval; the right panels show the marginal (beta-binomial) distribution of Y and the posterior obtained by simulation: draw p from the prior, then Y, and keep the draws with Y = y.

Prior α

Prior β

Trials n

Successes y

Second series: trials, successes

Shaded 95% interval

Conditioning simulation

Scoreboard

Try these

In the lecture notes