Efficient MCMC
Summary
Chapter 12 of BDA3 covers advanced MCMC methods, especially Hamiltonian Monte Carlo (HMC), which uses gradient information to make large, efficient moves through parameter space. Stan implements HMC for general models.
Improving Gibbs and Metropolis
- Reparameterization: transform to reduce posterior correlations (e.g., centering/non-centering in hierarchical models)
- Auxiliary variables / data augmentation: add latent variables to simplify conditionals (e.g., distribution as normal-inverse- mixture)
- Parameter expansion: adding redundant parameters can break dependence and improve mixing
- Adaptive Metropolis: tune the jumping distribution during warmup, then fix for inference
Hamiltonian Monte Carlo (HMC)
Treats sampling as simulating Hamiltonian dynamics with position and momentum :
Key properties:
- Uses gradient to guide proposals — far more efficient than random walks
- Proposals travel far in parameter space while maintaining high acceptance rates
- Scales much better to high dimensions than random-walk Metropolis
- NUTS (No-U-Turn Sampler): automatically tunes the trajectory length
Stan
Stan is the modern platform for Bayesian inference:
- Implements NUTS (adaptive HMC)
- Requires differentiable log-posteriors (automatic differentiation)
- Models specified in a declarative language
- Interfaces: RStan, PyStan, CmdStan
See Also
- MCMC Basics — the foundational algorithms
- Approximation Methods — alternatives when MCMC is too slow
- Computational Troubleshooting — diagnosing and fixing HMC issues
- Hierarchical Models — non-centered parameterization (BDA3 Ch. 13) is the key reparameterization trick for efficient HMC on hierarchical posteriors