Notes for Hamilton MC

General

  • works only on continuous distribution
\[\begin{align*} H(q, p) &= U(q) + K(p) \\ U(q) & = - log(L) \\ K(p) & = \sum \frac{p_i^2}{2m_i} \end{align*}\]

The Hamilton equation:

\[\begin{align*} \frac{d q_i}{dt} &= \frac{\partial H}{\partial p_i} \\ \frac{dp_i}{dt} &= - \frac{ \partial H}{\partial q_i} \end{align*}\]

Property

  1. reversible: make $K(p) = K(-p)$, then plug in $-p$ for MCMC
  2. conserved; invariant \(\frac{d H}{dt} = 0\)

Method

Euler

\[\begin{align*} p_i(t + \epsilon) & = p_i(t) = \epsilon \frac{dp_i(t)}{dt} = p_i(t) - \epsilon \frac{\partial U(q_i(t))}{\partial q_i} \\ q_i(t + \epsilon) & = q_i(t) + \epsilon \frac{dq_i(t)}{dt} = q_i(t) + \epsilon \frac{p_i(t)}{m_i} \end{align*}\]

Modified Euler

\[\begin{align*} p_i(t + \epsilon) & = p_i(t) - \epsilon \frac{\partial U(q_i(t))}{\partial q_i} \\ q_i(t + \epsilon) & = q_i(t) + \epsilon \frac{p_i(t + \epsilon)}{m_i} \end{align*}\]

Leapfrog

\[\begin{align*} p_i(t + \epsilon/2) & = p_i(t) - \epsilon/2 \frac{\partial U(q_i(t))}{\partial q_i} \\ q_i(t + \epsilon) & = q_i(t) + \epsilon \frac{p_i(t + \epsilon/2)}{m_i} \\ p_i(t + \epsilon) & = p_i(t + \epsilon/2) - \epsilon/2 \frac{\partial U(q_i(t + \epsilon))}{\partial q_i} \end{align*}\]

Tune

  • preliminary runs
  • trace plot

stepsize

  • too large: very low acceptance
  • too small: not efficient

Optimal Acceptance Rate: 0.23

Reference:

MCMC Using Hamiltonian Dynamics by Radford M. Neal

Approximation to compute the trajectory

  • Use a subset of data
  • few iterations for U


Published

24 December 2013

Modified

liuminzhao 01/13/2014 13:57:41