Hamiltonian Monte Carlo samples the target with by simulating the Hamiltonian with a…

PHYSICS · Multi-part · Fermi University Physics · Computational Physics · Monte Carlo and lattice simulation of physical systems · Monte Carlo and lattice simulation of physical systems

Error, Chance and the Machine, Ch Markov-chain Monte Carlo

Problem

Hamiltonian Monte Carlo samples the target p(x)∝e−U(x)p(x)\propto e^{-U(x)} with U(x)=(x2−1)2U(x) = (x^2-1)^2 by simulating the Hamiltonian H(x,p)=12p2+U(x)H(x,p) = \tfrac12 p^2 + U(x) with a fictitious momentum pp of unit mass. Starting from x0=0x_0 = 0, p0=1p_0 = 1, one velocity-Verlet (leapfrog) step of size δt=0.2\delta t = 0.2 is taken: p1/2=p0−δt2U′(x0),x1=x0+δt p1/2,p1=p1/2−δt2U′(x1),\begin{aligned}p_{1/2} &= p_0 - \tfrac{\delta t}{2}U'(x_0),\\ x_1 &= x_0 + \delta t\,p_{1/2},\\ p_1 &= p_{1/2} - \tfrac{\delta t}{2}U'(x_1),\end{aligned} with U′(x)=4x(x2−1)U'(x) = 4x(x^2-1). ((a)) Compute x1x_1 and p1p_1. ((b)) Compute ΔH=H(x1,p1)−H(x0,p0)\Delta H = H(x_1,p_1) - H(x_0,p_0). ((c)) Give the Metropolis acceptance probability min⁡(1,e−ΔH)\min(1,e^{-\Delta H}) for this proposed move.

Browse the problem library