Basic Prerequisites: 01 · From Zero and Probability & Measure Theory.
1. Intuition & Practical Objective
Page 01 gave the update rule. This page builds the dictionary that makes it usable: which prior pairs with which likelihood so the posterior stays in a known family (conjugacy), what it means to choose a noninformative or improper prior, and where the marginal likelihood (the evidence) earns its keep for model comparison.
The practical objective is a lookup you can carry: given my likelihood, what is the conjugate prior, what is the posterior, and what are its parameters? Get this right and every “update” becomes arithmetic; get it wrong (an improper prior whose posterior is also improper) and your whole inference is silently undefined.
The one-sentence essence. “A conjugate prior is a prior from the same exponential family as the posterior, so updating is bookkeeping - and the marginal likelihood is the same integral whether you use it to normalize or to compare models.”
2. Mathematical Ground Truth & Derivations
Bayes’ theorem, twice. The event form is ; the parameter form is C&B eq. 7.2.6:
The numerator is the joint density ; the denominator is its integral over - the probability of the data under the prior. Every Bayesian quantity is a functional of the numerator after normalization.
Conjugacy (C&B Def 7.2.2). A class of priors is conjugate for a likelihood class if the posterior stays in for every , every prior in , and every . The exponential families generate these pairs (the prior’s exponent is chosen to complete the likelihood’s exponent). The working dictionary:
| Likelihood | Conjugate prior | Posterior update | Posterior mean |
|---|---|---|---|
| / | |||
| , known | precision adds (below) | ||
| , known | |||
| , known |
Normal–Normal with known variance (C&B Ex 7.2.10) - the precision result. With and ,
Precisions add. Information (reciprocal variance) is additive: the posterior precision is the prior precision plus the data precision . This is the single most useful Bayesian intuition - and its matrix version () is the same statement for vectors. As (vague prior) : the datum wins when the prior has no precision.
The multivariate normal prior is the Gaussian-process/regression prior. With a design matrix , the posterior above is a posterior over regression coefficients, and its mean is the ridge solution (§04) - the deep link between Bayesian regression and penalized least squares. See Linear Algebra for precision matrices and Gaussian conditionals.
Sequential vs batch. Because factorizes for independent data, updating observation-by-observation (using the current posterior as the next prior) equals the batch update. The order of the data is irrelevant - a property frequentists’ estimators also share, but which Bayes makes visible.
Noninformative and improper priors. Laplace’s (“flat”) or Jeffreys’ (invariant under reparameterization) are attempts to “let the data speak.” They are typically improper - they do not integrate to 1 - and are tolerated only because the resulting posterior is proper (). Flat priors over unbounded parameters are the standard example; the “improper prior” §04 page warns when this breaks.
Marginal likelihood / evidence and Bayes factors. For two models ,
and is exactly the denominator Bayes’ rule dropped for estimation. It is the automatic Occam’s razor: a model that spreads prior mass over implausible regions pays a smaller . BIC, (ESL eq. 7.35), is a large-sample approximation - the bridge to frequentist model selection.
3. Computational Implementation - the four conjugate updates, verified
Run the four canonical conjugate updates, confirm that sequential updating equals batch updating (Normal–Normal), and check the “precision adds” law. Stdlib only.
Three facts are visible in the output. (i) Precisions add: , so the data precision dwarfs the prior’s and the posterior mean sits close to . (ii) Sequential = batch, for both Beta–Bernoulli and Normal–Normal - the order of the data does not matter. (iii) The Gamma–Poisson posterior mean sits between the prior mean and the sample mean , exactly as shrinkage requires.
4. Failure Modes & First-Principles Breakdowns
- Improper prior, improper posterior (the silent killer). over an unbounded parameter does not integrate to 1. The posterior is only legitimate if . With, e.g., a flat prior on a variance that can concentrate mass at 0, or with improper hierarchical hyper-priors, the integral diverges and every “estimate” is meaningless. Always check that the posterior is proper (or use a proper, weakly-informative prior - BDA3’s default recommendation).
- Prior–data conflict hidden by conjugacy. Conjugacy gives a closed form whether or not the prior is sane. If the prior says and the data scream with high precision, the posterior will be a battle of precisions - and with a strong prior, wrong. Plot prior and likelihood before trusting the posterior.
- Choosing a conjugate prior for convenience, then forgetting it is a model. A Normal prior is not “natural” for a strictly positive quantity; a is. Conjugate-ness is a tool, not a justification (C&B: “whether a conjugate family is reasonable… is a question to be left to the experimenter”).
- Dropping , then asking for a Bayes factor. You may ignore the evidence to estimate ; you may not ignore it to compare models. Reusing an unnormalized posterior across models and comparing heights is a common and fatal error.
- Flat priors are not “objective.” A flat prior on is non-flat on , , etc. Jeffreys’ prior fixes the most obvious reparameterization invariance, but “noninformative” is a claim to defend, not assume.
5. References
- Casella & Berger, Statistical Inference (2nd ed.)
- Gelman et al., Bayesian Data Analysis (3rd ed.)
- Tsay, Analysis of Financial Time Series
- Hoff, A First Course in Bayesian Statistical Methods
- MacKay, Information Theory, Inference, and Learning Algorithms
6. Connected Graph Bridges
- Back: 01 · From Zero · Index Hub
- Continue: 03 · Posterior Inference (what to do with the posterior) · 04 · Bayesian & Regularization (the Gaussian prior is ridge)
- Base: Probability & Measure Theory (conditional distributions, densities) · Linear Algebra (precision matrices, Gaussian conditionals)
- Forward: Black–Litterman Allocation (a normal–normal update on expected returns)