infhmc_step_batch: Preconditioned HMC transitions for independent blocks

View source: R/bayes_hmc_utils.R

infhmc_step_batchR Documentation

Preconditioned HMC transitions for independent blocks

Description

Runs infhmc_step() on N conditionally independent blocks at once (one column of c per block), sharing a target of the form \prod_i \exp(-\mathrm{nll}_i(c_i)) N(c_i; 0, \mathrm{diag}(C)). All blocks integrate the same (random) number of leapfrog steps, with their own step sizes, and each is accepted or rejected on its own energy change.

Usage

infhmc_step_batch(c, nll, g, aux, geom, C, epsilon, L)

Arguments

c

a D by N matrix of current states

nll, g

negative log-likelihoods and gradients of geom at c

aux

extra output of geom at c (a matrix with N columns, or NULL)

geom

a function of c returning a list with nll, grad and optionally aux, evaluated for all columns at once

C

prior variances

epsilon

step sizes, scalar or of length N

L

maximum number of leapfrog steps

Value

A list with the new states and their geometry, the per-block acceptance indicators and the per-block acceptance probabilities alpha (0 where the trajectory left the support), for step-size adaptation.


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