# Hamiltonian monte carlo

Can someone explain the main idea behind Hamiltonian Monte Carlo methods and in which cases they will yield better results than Markov Chain Monte Carlo methods ?

• This is covered extensively in the Stan documentation.
– Sycorax
May 28, 2016 at 14:03
• @General Abrial: but aren't all questions here covered in one or other paper or book or documentation?
– user83346
May 28, 2016 at 14:25
• The question is not well posed, since Hamiltonian Monte Carlo is an example of a Markov Chain Monte Carlo method. Aug 15, 2016 at 12:46
• Sure, this is an good review mcmchandbook.net/HandbookChapter5.pdf Aug 18, 2016 at 20:57
• You did notice, that Zen linked you to exactly the same URL on May 28th already? Jan 2, 2018 at 11:47

I believe the most up-to-date source on Hamiltonian Monte Carlo, its practical applications and comparison to other MCMC methods is this 2017-dated review paper by Betancourt:

The ultimate challenge in estimating probabilistic expectations is quantifying the typical set of the target distribution, a set which concentrates near a complex surface in parameter space. Hamiltonian Monte Carlo generates coherent exploration of smooth target distributions by exploiting the geometry of the typical set. This effective exploration yields not only better computational efficiency than other Markov chain Monte Carlo algorithms, but also stronger guarantees on the validity of the resulting estimators. Moreover, careful analysis of this geometry facilitates principled strategies for automatically constructing optimal implementations of the method, allowing users to focus their expertise into building better models instead of wrestling with the frustrations of statistical computation. As a result, Hamiltonian Monte Carlo is uniquely suited to tackling the most challenging problems at the frontiers of applied statistics, as demonstrated by the huge success of tools like Stan (Stan Development Team, 2017).

• This is a wee bit overselling the approach! Nov 7, 2018 at 20:01

Hamiltonian Monte Carlo (HMC), originally called Hybrid Monte Carlo, is a form of Markov Chain Monte Carlo with a momentum term and corrections.

The "Hamiltonian" refers to Hamiltonian mechanics.

The use-case is stochastically (randomly) exploring high dimensions for numeric integration over a probability space.

## Contrast with MCMC

Plain/vanilla Markov Chain Monte Carlo (MCMC) uses only the last state to determine the next state. That means that you are as likely to go forward as you are to go back over space you have already explored.

MCMC also is likely to drift outside of the primary area of interest in high dimensional spaces as well.

This makes MCMC very inefficient for the purposes of numeric integration over a multidimensional probability space.

### How HMC handles these issues

By adding in a momentum term, HMC makes the exploration of the probability space more efficient, as you are now more likely to make forward progress with each step through your probability space.

HMC also uses Metropolis-Hastings corrections to ensure it stays in and explores the region of greater probability.

In writing up this answer, I found this presentation on HMC to be quite illuminating.