Conjugate
Priors
Master conjugate prior families for common Bayesian models: how choosing the right prior makes the posterior analytically tractable.
The Bayesian Update in One Equation
At the heart of Bayesian inference lies Bayes' theorem. Given data \(x\) and parameter \(\theta\):
What Makes a Prior Conjugate?
A prior \(p(\theta)\) is conjugate to a likelihood \(p(x \mid \theta)\) if the resulting posterior \(p(\theta \mid x)\) belongs to the same distributional family as the prior.
Why does this matter? It means you can write the posterior in closed form: no integrals to evaluate, no MCMC needed. You simply update the prior's parameters.
Prior × Likelihood = Posterior
The Conjugate Prior Theorem
After observing data \(x_1, \dots, x_n\), the posterior has the same form with updated hyperparameters:
How Hyperparameter Updates Work
The posterior's hyperparameters are simple additions: the prior pseudo-counts \((\chi_0, \nu_0)\) plus the sufficient statistics from the observed data. The distributional family never changes.
Beta-Binomial Conjugacy
Gamma-Poisson Conjugacy
Normal-Normal Conjugacy
When the likelihood is Normal with known variance \(\sigma^2\) and unknown mean \(\mu\):
Conjugate vs Non-Conjugate Priors
| Conjugate Prior | Non-Conjugate Prior | |
|---|---|---|
| Posterior form | Closed-form | No closed form |
| Computation | Update hyperparameters | MCMC / Variational |
| Flexibility | Limited to conjugate family | Any prior shape |
| Speed | Instant | Slow (iterative) |
| Best for | Standard models, online learning | Complex / multi-modal beliefs |
The Precision-Weighted Average
In the Normal-Normal case, the posterior mean is a weighted average of the prior mean and the sample mean, weighted by their respective precisions (inverse variances):
Step-by-Step: Applying a Conjugate Prior
Example 1: Beta-Binomial
A new drug has an unknown success rate \(p\). Before the trial, we believe \(p\) is around 0.5 with moderate uncertainty: \(p \sim \text{Beta}(2, 2)\). In a trial of \(n = 10\) patients, \(x = 7\) respond.
Example 2: Gamma-Poisson
A call center receives calls at rate \(\lambda\) per hour. Prior belief: \(\lambda \sim \text{Gamma}(10, 2)\), meaning we expect about \(10/2 = 5\) calls/hr. Over \(n = 5\) hours, we observe \(\sum x_i = 35\) total calls.
Example 3: Normal-Normal
Estimating the mean weight \(\mu\) of a species. Known \(\sigma^2 = 4\). Prior: \(\mu \sim N(50, 25)\). We observe \(n = 10\) animals with \(\bar{x} = 53\).
Common Mistakes
Conjugate Pair Reference Table
| Likelihood | Conjugate Prior | Posterior |
|---|---|---|
| \(\text{Binomial}(n, p)\) | \(\text{Beta}(\alpha, \beta)\) | \(\text{Beta}(\alpha\!+\!x,\;\beta\!+\!n\!-\!x)\) |
| \(\text{Poisson}(\lambda)\) | \(\text{Gamma}(\alpha, \beta)\) | \(\text{Gamma}(\alpha\!+\!\Sigma x_i,\;\beta\!+\!n)\) |
| \(N(\mu, \sigma^2_{\text{known}})\) | \(N(\mu_0, \sigma_0^2)\) | \(N(\mu_n, \sigma_n^2)\) |
| \(N(\mu_{\text{known}}, \sigma^2)\) | \(\text{Inv-Gamma}(\alpha, \beta)\) | \(\text{Inv-Gamma}(\alpha\!+\!\tfrac{n}{2},\;\beta\!+\!\tfrac{\Sigma(x_i-\mu)^2}{2})\) |
| \(\text{Exponential}(\lambda)\) | \(\text{Gamma}(\alpha, \beta)\) | \(\text{Gamma}(\alpha\!+\!n,\;\beta\!+\!\Sigma x_i)\) |
Question 1 of 5
What is the conjugate prior for the Binomial likelihood?
Question 2 of 5
You place a \(\text{Gamma}(4, 2)\) prior on a Poisson rate \(\lambda\). After observing \(n = 6\) days with a total count of \(\sum x_i = 30\), what is the posterior distribution?
Question 3 of 5
In Normal-Normal conjugacy (known \(\sigma^2\)), the posterior mean is a weighted average of the prior mean and the sample mean. What determines the weights?
Question 4 of 5
If you start with a \(\text{Beta}(1, 1)\) prior (i.e., \(\text{Uniform}(0,1)\)) and observe 0 successes in 5 Bernoulli trials, what is the posterior mean of \(p\)?
Question 5 of 5
Which of the following is NOT an advantage of using conjugate priors?