Hamiltonian Monte Carlo: Gradient-Based Sampling and Adaptive Tuning
Summary
The article presents Hamiltonian Monte Carlo (HMC) as a way to sample high-dimensional probability distributions more efficiently than random-walk MCMC. It explains the Hamiltonian formulation: parameters act as positions, auxiliary momentum is repeatedly refreshed, and gradients of the log target density guide long trajectories. A reversible, volume-preserving leapfrog integrator approximates the dynamics, while a Metropolis acceptance step corrects numerical energy error.
The implementation also uses an L-BFGS maximum a posteriori estimate to initialize sampling, and describes adapting the integration step size and mass matrix. It evaluates sample quality with diagnostics such as Rhat, effective sample size, Monte Carlo standard error, moments, quantiles, and trace plots. The example samples a 100-dimensional correlated normal distribution with unequal variances. This demonstrates an implementation and diagnostics on a controlled test case, not a trading strategy or evidence of performance on financial data. The article notes that trajectory length still requires setting, with NUTS suggested as a possible extension.
Key ideas
- HMC uses gradients and auxiliary momentum to explore target distributions along directed trajectories.
- Leapfrog integration preserves reversibility and volume, while a Metropolis step corrects integration error.
- L-BFGS MAP estimation can provide a high-density starting point for sampling.
- Step size and mass matrix adaptation help balance acceptance and exploration efficiency.
- Convergence and precision diagnostics assess samples from the 100-dimensional Gaussian example.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.