8.5 Summary
Chapter 8 in review
Chapter 8 demystified Markov Chain Monte Carlo (MCMC). The key insight is that a Markov chain can sample from any distribution, including a posterior, without knowing the normalizing constant.
We covered:
-
Good King Markov (Section 8.1): The Metropolis algorithm — propose, accept/reject based on probability ratios. It only needs ratios, not the normalizing constant.
-
MCMC (Section 8.2): Metropolis-Hastings generalizes the algorithm with arbitrary proposals. Gibbs sampling updates parameters conditionally. MCMC works for any posterior shape.
-
HMC (Section 8.3): Hamiltonian Monte Carlo uses gradient information to explore efficiently. It simulates a physics analogy — position and momentum on the log-posterior surface. Implemented via Stan/
ulam. -
Diagnostics (Section 8.4): R-hat ≈ 1 for convergence, ESS > 1000 for efficiency, trace plots for visual inspection, divergences for curvature problems. Non-centered parameterization fixes common issues.
Key lessons
- MCMC samples from the posterior rather than approximating it.
- It only needs ratios of probabilities — no normalizing constant.
- HMC is far more efficient than random-walk methods because it uses gradient information.
- Always check R-hat, ESS, trace plots, and divergences before reporting results.
- Reparameterization (centering, non-centered) is the most common fix for convergence problems.
MCMC is the engine of modern Bayesian statistics. Before MCMC, Bayesian inference was limited to conjugate priors and simple models. With MCMC, we can fit any model we can write down. This freedom is powerful, but it comes with responsibility: the chain must converge, the diagnostics must be clean, and the results must be interpreted with the same humility as any other statistical method. MCMC is not magic — it is an engine. And like any engine, it needs care and feeding.