Quant Memo
Core

Conjugate Priors

Special prior-and-likelihood pairings where the posterior stays in the same family as the prior, turning Bayesian updating into simple arithmetic on counts. The exact, closed-form corner of Bayesian statistics.

Prerequisites: Bayes' Theorem, Bayesian Inference

Bayesian updating, in general, means multiplying a prior by a likelihood and then wrestling with an ugly normalizing integral to get the posterior. Conjugate priors are the happy exception where that integral has a clean answer, because the prior and the likelihood are chosen to fit together so that the posterior comes out in the very same family as the prior. When that happens, updating your beliefs stops being calculus and becomes bookkeeping: you just add the new data to a running count.

The idea

A prior is conjugate to a likelihood if the resulting posterior belongs to the same family, only with updated parameters. The classic pair is the Beta prior with the Binomial likelihood. If your belief about a success probability pp is a Beta distribution with parameters α\alpha and β\beta, and you then observe ss successes and ff failures, the posterior is simply

Beta(α,β)  s successes, f failures  Beta(α+s, β+f).\text{Beta}(\alpha, \beta) \ \xrightarrow{\ s \text{ successes},\ f \text{ failures}\ } \ \text{Beta}(\alpha + s, \ \beta + f) .

That is the whole update: add the successes to α\alpha, add the failures to β\beta. No integral. The parameters α\alpha and β\beta act like pseudo-counts, imaginary successes and failures you are pretending to have seen before the real data arrived, which is a wonderfully intuitive way to encode a prior.

Beta(α, β) prior + s, f observed counts = Beta(α+s, β+f) posterior
Conjugate updating for the Beta–Binomial pair: the posterior is the same shape of distribution as the prior, with the observed successes and failures simply added to the parameters.

A prior is conjugate when the posterior lands in the same family, so Bayesian updating reduces to arithmetic. For Beta–Binomial: Beta(α,β)\text{Beta}(\alpha,\beta) plus ss successes and ff failures becomes Beta(α+s, β+f)\text{Beta}(\alpha+s,\ \beta+f).

The common conjugate pairs

A handful cover most textbook cases:

Data / likelihoodConjugate priorPosterior update
Bernoulli / Binomial (rate pp)Beta(α,β)(\alpha,\beta)Beta(α+s, β+f)(\alpha + s,\ \beta + f)
Poisson (rate λ\lambda)Gamma(a,b)(a,b)Gamma(a+xi, b+n)(a + \textstyle\sum x_i,\ b + n)
Exponential (rate λ\lambda)Gamma(a,b)(a,b)Gamma(a+n, b+xi)(a + n,\ b + \textstyle\sum x_i)
Normal, known variance (mean μ\mu)Normal(μ0,σ02)(\mu_0, \sigma_0^2)precision-weighted blend of prior and data means
Multinomial (probs p\mathbf p)Dirichlet(α)(\boldsymbol\alpha)Dirichlet(α+counts)(\boldsymbol\alpha + \text{counts})

In every row, the posterior is the prior's family with data folded into the parameters.

Worked example: a biased coin

You suspect a coin is roughly fair but are not sure, so you set a mild prior of Beta(2,2)\text{Beta}(2, 2), which peaks gently at p=0.5p = 0.5 and encodes the weak belief "as if I had already seen 2 heads and 2 tails." Now you flip it 10 times and get 8 heads, 2 tails. The posterior is

Beta(2+8, 2+2)=Beta(10,4).\text{Beta}(2 + 8, \ 2 + 2) = \text{Beta}(10, 4) .

Its mean is 1010+4=10140.714\tfrac{10}{10 + 4} = \tfrac{10}{14} \approx 0.714. Compare the three numbers: the prior mean was 0.50.5, the raw data (maximum-likelihood) estimate is 8/10=0.88/10 = 0.8, and the posterior mean 0.7140.714 sits between them, pulled toward the data but held back by the prior. That shrinkage is the entire value of the Bayesian view, and here you can read exactly how much the prior weighed in: its 4 pseudo-observations against the data's 10 real ones.

Read the prior parameters as pseudo-observations: a Beta(2,2)\text{Beta}(2,2) prior is "2 imaginary heads and 2 imaginary tails." The more real data you gather, the more those imaginary counts get swamped and the closer the posterior mean drifts to the raw data estimate.

Where conjugacy misleads

  • Convenience is not correctness. A conjugate prior is chosen because the math is clean, not because it is the right description of your beliefs. Do not let tractability quietly dictate your prior.
  • Small data, strong prior. With few observations the prior can dominate the answer. Beta(50,50)(50,50) would barely have budged from 0.50.5 after those same 10 flips, always ask how much your prior is doing.
  • Most real models are not conjugate. The moment you add a hierarchy, an unknown variance alongside an unknown mean, or a nonstandard likelihood, closed-form conjugacy breaks. That is exactly when you reach for MCMC, which samples the posterior without needing it in closed form.

Conjugacy is a mathematical convenience, not a modeling truth. If a conjugate prior does not honestly reflect your beliefs, or the model is too rich for any conjugate pair, do not force it, use MCMC instead of distorting the prior to keep the algebra tidy.

Conjugate priors are the exactly-solvable base case of Bayesian inference, a direct application of Bayes' theorem, and the natural contrast to MCMC, which takes over precisely where the clean formulas run out.

Related concepts

Practice in interviews

Further reading

  • Gelman et al., Bayesian Data Analysis (Ch. 2)
  • Murphy, Machine Learning: A Probabilistic Perspective (Ch. 3–5)
  • Bishop, Pattern Recognition and Machine Learning (Ch. 2)
ShareTwitterLinkedIn