Introduction to Bayesian Computation
Summary
Chapter 10 of BDA3 introduces the fundamental computational methods for Bayesian inference: numerical integration, direct simulation, and importance sampling. These are building blocks for the MCMC methods in Chapters 11-12.
Key Methods
Direct Simulation and Rejection Sampling
- Draw from and accept with probability proportional to
- Simple but inefficient in high dimensions — most draws are rejected
Importance Sampling
Draw from an approximating distribution and reweight:
Effective sample size measures the quality of the approximation:
Warning
Importance sampling fails when has thinner tails than the target — a few extreme weights dominate. Pareto-smoothed IS (PSIS) addresses this.
How Many Draws Are Needed?
- independent draws typically suffice for posterior means (Monte Carlo error )
- Extreme quantiles and rare-event probabilities need +
- The factor shows that Monte Carlo error is negligible relative to posterior uncertainty even at moderate
Computing Environments
- BUGS: pioneered general-purpose Bayesian computing via Gibbs sampling
- Stan: modern platform using Hamiltonian Monte Carlo, more efficient for complex models
- PyMC: Python-based alternative
See Also
- MCMC Basics — iterative simulation for complex posteriors
- Efficient MCMC — HMC and Stan
- Approximation Methods — deterministic alternatives (Laplace, VI, EP) when MCMC is too slow
- Fitting and Validating Computation — workflow for validating computation