Hostname: page-component-74656f9884-rdgjk Total loading time: 0 Render date: 2026-11-07T06:13:27.097Z Has data issue: false hasContentIssue false

Geometric integrators and the Hamiltonian Monte Carlo method

Published online by Cambridge University Press:  04 May 2018

Nawaf Bou-Rabee
Affiliation:
Department of Mathematical Sciences, Rutgers University Camden, 311 N. Fifth Street, Camden NJ 08102, USA E-mail: nawaf.bourabee@rutgers.edu
J. M. Sanz-Serna
Affiliation:
Departamento de Matemáticas, Universidad Carlos III de Madrid, Avenida de la Universidad 30, E–28911 Leganés (Madrid), Spain E-mail: jmsanzserna@gmail.com
Rights & Permissions [Opens in a new window]

Abstract

This paper surveys in detail the relations between numerical integration and the Hamiltonian (or hybrid) Monte Carlo method (HMC). Since the computational cost of HMC mainly lies in the numerical integrations, these should be performed as efficiently as possible. However, HMC requires methods that have the geometric properties of being volume-preserving and reversible, and this limits the number of integrators that may be used. On the other hand, these geometric properties have important quantitative implications for the integration error, which in turn have an impact on the acceptance rate of the proposal. While at present the velocity Verlet algorithm is the method of choice for good reasons, we argue that Verlet can be improved upon. We also discuss in detail the behaviour of HMC as the dimensionality of the target distribution increases.

Information

Type
Research Article
Copyright
© Cambridge University Press, 2018 
Figure 0

Table 3.1. Velocity Verlet integration of the harmonic oscillator. Relative errors after one or ten oscillation periods.

Figure 1

Figure 4.1. Modified Hamiltonian for (a) velocity and (b) position Verlet. The dots are the first five points along a discrete orbit of the velocity/position Verlet integrator initiated at $(q,p)=(1,0)$ and the grey line provides the associated level set of the modified Hamiltonian. For comparison, the black contour line shows the corresponding level set of the true Hamiltonian.

Figure 2

Figure 6.1. A univariate target with probability modes at $q=\pm 1$, leading to a double-well potential ${\mathcal{U}}$. The continuous lines are contours of constant $H$. The symmetry of the contours with respect to the axis $p=0$ is a consequence of the reversibility of the Hamiltonian flow. The solutions of Hamilton’s equations move from left to right when $p>0$ and from right to left when $p<0$, so when contours are reflected over the horizontal axis the arrow of time is reversed. If a reversible $\unicode[STIX]{x1D6F9}$ maps $(q_{0},p_{0})$ into $(q^{\ast },p^{\ast })$, it has to map $(q^{\ast },-p^{\ast })$ into $(q_{0},p_{0})$, so as to preserve the symmetry of the figure. The transition $(q_{0},p_{0})\mapsto (q^{\ast },p^{\ast })$ has an increase in energy and $(q^{\ast },-p^{\ast })\mapsto (q_{0},p_{0})$ decreases energy in exactly the same amount; this is the content of formula (6.1).

Figure 3

Figure 6.2. Discrete trajectories of the Markov chain when HMC for the standard Gaussian target is operated with (a) velocity and (b) position Verlet. Each marker is a state of the Markov chain (intermediate values of $(q,p)$ along the numerical trajectories are not depicted). The size of the markers is related to the index $i$ in the chain: states corresponding to larger values of $i$ have smaller markers. The chains start at $q=10$. In (b), all chain transitions result in rejection, so that $q_{i}=10$ for all values of $i$; position Verlet gets stuck. In (a), the velocity chain quickly identifies the interval around $q=0$ where the target distribution is concentrated.

Figure 4

Figure 6.3. Regions where the energy error $\unicode[STIX]{x1D6E5}(q,p)$ is positive/negative for (a) velocity and (b) position Verlet. In the grey-shaded regions $\unicode[STIX]{x1D6E5}(q,p)$ is negative, ensuring acceptance of the Markov transition. The contour lines in the background show level sets of $H(q,p)$.

Figure 5

Figure 6.4. Bivariate Gaussian distribution, $(q^{1},q^{2})$-plane; the ellipse is a contour of constant probability density. HMC operated with (a) velocity Verlet and (b) MALA. The size of the markers is related to $i$: points along the Markov trajectory corresponding to larger values of $i$ have smaller markers. The computational budget for both algorithms is fixed at 100 force evaluations. Along these trajectories, the average acceptance probability for HMC and MALA is 93% and 82%, respectively. The stability requirement for Verlet is $h<0.2$, which is set by the component of the target distribution with the smallest variance. In relation to MALA, note that HMC relaxes more rapidly to a region of high probability.

Figure 6

Figure 6.5. Two-stage palindromic integrators (3.17) corresponding to $b=1/4$ or $b$ given by (6.8). (a) Stability polynomial $A_{h}$. For $b=1/4$ (which provides two steps of velocity Verlet of step length $\unicode[STIX]{x1D70F}/2$) stability is lost at $h=4$ and there is a double root of the equation $A_{h}=-1$. The method (6.8) has a significantly shorter stability interval because under perturbation the double root of $A_{h}=-1$ splits into two real roots. (b) The quantity $\unicode[STIX]{x1D70C}=\unicode[STIX]{x1D70C}(h)$ that governs the expected energy error for Gaussian problems (see (6.7)). When the methods are operated with $0, i.e. $0<\unicode[STIX]{x1D70F}<2/\unicode[STIX]{x1D714}_{\text{max}}$, the choice (6.8) yields values of $\unicode[STIX]{x1D70C}$ much smaller than those corresponding to $b=1/4$.

Figure 7

Figure 6.6. Three-stage palindromic integrators (3.18) for $a=1/3$, $b=1/6$ or $a$, $b$ given by (6.9). (a) Stability polynomial $A_{h}$. (b) The quantity $\unicode[STIX]{x1D70C}=\unicode[STIX]{x1D70C}(h)$, which governs the expected energy error for Gaussian problems (see (6.7)). When the methods are operated with $0, the choice (6.9) yields values of $\unicode[STIX]{x1D70C}$ much smaller than those corresponding to $a=1/3$, $b=1/6$.

Figure 8

Figure 8.1. Ornstein–Uhlenbeck bridge. Mean acceptance probability as a function of $h$ for the PRHMC algorithm for three choices of the splitting parameter $c$ and the three values of $\unicode[STIX]{x1D6E5}s$. The number of time-steps $n$ at each integration leg is random with a geometric distribution chosen in such a way that the average length $\unicode[STIX]{x1D706}=nh$ of the integration interval is 20. The number of samples is $10^{4}$. For $c=1$ the acceptance probability does not decrease as the grid is refined.

Figure 9

Figure 8.2. Ornstein–Uhlenbeck bridge. This figure assesses the sampling accuracy of the PRHMC algorithm. For the distribution $\unicode[STIX]{x1D6F1}_{d}$, the plot graphs the exact and empirical values of the variance of $\mathbf{u}_{i}$ when $\unicode[STIX]{x1D6E5}s=0.02$ corresponding to $d=49$ interior grid points (the horizontal axis labels the components). The time-step size is $h=2.0$. The number of time-steps $n$ at each integration leg is random with a geometric distribution chosen in such a way that the average length $\unicode[STIX]{x1D706}=nh$ of the integration interval is 20. The number of samples is $10^{6}$. The acceptance rate was $95\%$. When measured in the $L^{2}$-norm of $\mathbb{R}^{49}$, the relative error of the vector of empirical variances is $0.36\%$. The values $c=0$, $c=0.5$ were also tested but the acceptance rates were virtually zero.

Figure 10

Figure 9.1. Verlet scheme for time-step (a) $h=1$ and (b) $h=1/2$ applied to $H(q,p)=(1/2)p^{2}+(1/4)q^{4}$. The numerical solutions mimic the behaviour of the exact solution only for initial conditions close to the origin. Decreasing $h$ enlarges the region where the integrator performs satisfactorily, but does not eliminate the problem.

Figure 11

Figure 9.2. Time-step or duration randomization for the Ornstein–Uhlenbeck bridge. Mean acceptance probability as a function of $h$ for (a) PHMC operated with constant step sizes, (b) PHMC operated with randomized step sizes of average $h$, and (c) PRHMC, for $c=0$ and three values of $\unicode[STIX]{x1D6E5}s$. In all three cases the duration parameter is $\unicode[STIX]{x1D706}=20$. The number of samples is $10^{4}$. The PRHMC algorithm is the least susceptible to periodicities in the underlying Hamiltonian dynamics.