To perform one step of the Hamiltonian Monte Carlo (HMC) algorithm by hand for the energy function ( f(x) = x^2 ), we need to follow specific steps. However, since the question mentions "default parameters" without specifying values, we'll assume typical defaults used in simple HMC examples:
- Initial Position (( x )): We'll start at ( x = 0 ).
- Initial Momentum (( p )): Momentum is usually sampled from a standard normal distribution. For simplicity, we'll use ( p = 1 ).
- Step Size (( \epsilon )): We'll set ( \epsilon = 0.1 ).
- Number of Leapfrog Steps (( L )): We'll use ( L = 1 ).
Hamiltonian Dynamics Equations:
The Hamiltonian ( H(x, p) ) is given by:
[ H(x, p) = f(x) + \frac{p^2}{2} ]
The updates for the leapfrog method are:
- Half-Step Momentum Update:
[ p \leftarrow p - \frac{\epsilon}{2} \nabla f(x) ]
- Full-Step Position Update:
[ x \leftarrow x + \epsilon p ]
- Another Half-Step Momentum Update:
[ p \leftarrow p - \frac{\epsilon}{2} \nabla f(x) ]
Calculations:
-
Initial Position and Momentum:
[ x_0 = 0 ]
[ p_0 = 1 ]
-
Compute Gradient of ( f(x) ) at ( x_0 ):
[ \nabla f(x_0) = 2x_0 = 0 ]
-
First Half-Step Momentum Update:
[ p_{\text{half}} = p_0 - \frac{\epsilon}{2} \nabla f(x_0) = 1 - \frac{0.1}{2} \times 0 = 1 ]
-
Full-Step Position Update:
[ x_1 = x_0 + \epsilon p_{\text{half}} = 0 + 0.1 \times 1 = 0.1 ]
-
Compute Gradient of ( f(x) ) at ( x_1 ):
[ \nabla f(x_1) = 2x_1 = 2 \times 0.1 = 0.2 ]
-
Second Half-Step Momentum Update:
[ p_1 = p_{\text{half}} - \frac{\epsilon}{2} \nabla f(x_1) = 1 - \frac{0.1}{2} \times 0.2 = 1 - 0.01 = 0.99 ]
-
Compute Hamiltonian at Start (( H_0 )):
[ H_0 = f(x_0) + \frac{p_0^2}{2} = (0)^2 + \frac{(1)^2}{2} = 0 + 0.5 = 0.5 ]
-
Compute Hamiltonian at End (( H_1 )):
[ H_1 = f(x_1) + \frac{p_1^2}{2} = (0.1)^2 + \frac{(0.99)^2}{2} = 0.01 + \frac{0.9801}{2} = 0.01 + 0.49005 = 0.50005 ]
-
Metropolis Acceptance Probability:
[ \alpha = \min\left(1, \exp(H_0 - H_1)\right) = \min\left(1, \exp(0.5 - 0.50005)\right) \approx \min(1, e^{-0.00005}) \approx 0.99995 ]
-
Accept or Reject the Move:
Since the acceptance probability is very close to 1, we'll likely accept the new position.
Result:
- New Position: ( x = 0.1 )
- New Momentum: Discarded (in HMC, we discard the momentum after each iteration)
We have completed one step of the HMC algorithm using the default parameters and calculated the updates by hand.
Answer: A step-by-step hand calculation applying HMC with f(x) = x² and default parameters, yielding a new sample point.