HAMILTONIAN MONTE CARLO
Leapfrog integrator · Volume preservation · Acceptance rate · vs Random Walk MH
Target distribution
Banana (Rosenbrock)
Neal's funnel
Correlated Gaussian
Bimodal mixture
Step size ε
0.20
Leapfrog steps L
20
Sampler
HMC
Random-Walk MH
Both (compare)
Samples: 0
Acceptance: —
ESS: —
H(q,p) = U(q) + K(p)
HMC uses Hamiltonian dynamics to propose distant, correlated moves. The leapfrog integrator is
symplectic
— it preserves phase-space volume (Liouville's theorem).
Key insight: momentum p is refreshed from N(0,I) at each step; then leapfrog evolves the system, and Metropolis corrects for numerical error.
HMC dramatically outperforms random-walk MH for high-dimensional, curved targets.
Run / Pause
Single HMC Step
Reset