Day 4 · Interactive

Conjugate priors: how data reshapes belief

Pick a likelihood, set a conjugate prior, and feed in data. Watch the prior × likelihood → posterior update happen live. Because each pair is conjugate, the posterior stays in the same family and its parameters have a simple "add the data" form.

Prior
Data (the likelihood)
– – prior — likelihood (scaled) — posterior
Show the plotted values as a table

Things to try

  1. The prior is pseudo-data. In Beta–Binomial, a $\text{Beta}(\alpha,\beta)$ prior acts like $\alpha$ prior "successes" and $\beta$ prior "failures." Add real data and the posterior is $\text{Beta}(\alpha + y,\, \beta + n - y)$ — literally add the counts.
  2. Flat prior = the likelihood. Set the Beta prior to $\text{Beta}(1,1)$ (the Uniform). The posterior lands right on the scaled likelihood, and its mode is the MLE $y/n$.
  3. Data overwhelms the prior. Keep the prior fixed and increase $n$. The likelihood sharpens and drags the posterior onto it — with enough data the prior barely matters.
  4. A strong prior fights back. Make the prior very informative (large $\alpha+\beta$, or a tight Normal prior SD). Now it takes a lot of data to move the posterior.
  5. Same recipe, three families. Switch families and notice the pattern is always the same: posterior parameters = prior parameters + a simple function of the data.

← Back to the Day 4 lab · see also the likelihood & MCMC explorer.