infhmc_step: One preconditioned (infinite-dimensional) HMC transition

View source: R/bayes_hmc_utils.R

infhmc_stepR Documentation

One preconditioned (infinite-dimensional) HMC transition

Description

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.

Usage

infhmc_step(c, nll, g, geom, C, epsilon, L)

Arguments

c

current state

nll, g

negative log-likelihood and gradient of geom at c

geom

a function of c returning a list with nll and grad

C

prior variances

epsilon

step size (rotation angle)

L

maximum number of leapfrog steps (the number used is uniform on 1:L)

Value

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.

References

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.


fdasrvf documentation built on Nov. 21, 2026, 1:09 a.m.