Helper Function for Hamiltonian Monte Carlo based samplers.The leapfrog function is a symplectic integrator which deals with error accumulation in the generation of Hamiltonian trajectories. It requires that the distribution of the momentum is independent of position.
1 | leapfrog_step(theta, momentum, epsilon, log_posterior, L = 1)
|
theta |
A vector of length d with the current position |
momentum |
A vector of length d with the current momentum |
epsilon |
A numeric value with the size of the leapfrog step |
log_posterior |
Function of the log probability density of a value theta in the target distribution. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.