Hamiltonian and Langevin Monte Carlo
Physics might be on to something
July 31, 2018 — November 14, 2022
Hamiltonians, energy conservation in sampling. Handy. Summary would be nice.
1 Note salad from a Betancourt seminar
Michael Betancourt’s heuristic explanation of Hamiltonian Monte Carlo: sets of high mass, no good — we need the “typical set,” a set whose product of differential volume and density is high. Motivates Markov Chain Monte Carlo on this basis, a way of exploring the typical set given points already in it, or getting closer to the typical set if starting without. How to get a central limit theorem? “Geometric” ergodicity results. Hamiltonian Monte Carlo is a procedure for generating measure-preserving flows over phase space
\[H(q,p)=-\log(\pi(p|q)\pi(q))\] So my probability density gradient influences the particle momentum. And we can use symplectic integrators to walk through trajectories (if I knew more numerical quadrature I might know more about the benefits of this) in between random momentum perturbations. Some more stuff about resampling trajectories to de-bias numerical error, which is the NUTS extension to HMC.
2 Discontinuous likelihood
The solution is MOAR PHYSICS; we can construct Hamiltonians which sample based on reflection/refraction dynamics in the augmented state space; see Afshar and Domke (2015);Nishimura, Dunson, and Lu (2020).
3 Incoming
Manifold Monte Carlo.
George Ho, Understanding NUTS and HMC
In terms of reading code, I’d recommend looking through Colin Carroll’s
minimc
for a minimal working example of NUTS in Python, written for pedagogy rather than actual sampling. For a “real world” implementation of NUTS/HMC, I’d recommend looking through mylittlemcmc
for a standalone version of PyMC3’s NUTS/HMC samplers.