The chain state object provides cached access to target distribution log density and its gradient.
Value
New chain state object. A list with entries
position
: A zero-argument function to evaluate position vector.momentum
: A zero-argument function to evaluate momentum vector.dimension
: A zero-argument function evaluate dimension of position and momentum vectors.update
: A function accepting argumentsposition
andmomentum
for updating the value of one or both of these state components.copy
: A function for creating a copy of the state object including any cached values.log_density
: A function accepting argumenttarget_distribution
for evaluating the log density of the target distribution at the current state, with caching of the value to avoid recomputation on subsequent calls.gradient_log_density
: A function accepting argumenttarget_distribution
for evaluating the gradient of the log density of the target distribution at the current state, with caching of the value to avoid recomputation on subsequent calls.