View source: R/bayes_hmc_utils.R
| infhmc_step | R Documentation |
Samples \pi(c) \propto \exp(-\mathrm{nll}(c)) N(c; 0, \mathrm{diag}(C))
with the splitting integrator of Beskos et al. (2011): the Gaussian prior
is integrated exactly by a rotation and the likelihood enters through half
kicks v \leftarrow v - \epsilon/2\, C \nabla \mathrm{nll}. The
integrator is reversible and volume preserving, so acceptance uses the
exact change in H = \mathrm{nll}(c) + c'C^{-1}c/2 + v'C^{-1}v/2.
infhmc_step(c, nll, g, geom, C, epsilon, L)
c |
current state |
nll, g |
negative log-likelihood and gradient of |
geom |
a function of |
C |
prior variances |
epsilon |
step size (rotation angle) |
L |
maximum number of leapfrog steps (the number used is uniform on
|
A list with the new state c, its nll and g, whether the
proposal was accepted, the number of leapfrog steps used and the
acceptance probability alpha (0 if the trajectory left the support),
for step-size adaptation.
Beskos, A., Pinski, F. J., Sanz-Serna, J. M., and Stuart, A. M. (2011). Hybrid Monte Carlo on Hilbert spaces. Stochastic Processes and their Applications, 121(10), 2201-2230.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.