trajectories {XDNUTS}R Documentation

Function that approximate the Hamiltonian Flow for given starting values of the position and momentum of a particle in the phase space defined by the kinetic and potential energy provided in input.

Description

Function that approximate the Hamiltonian Flow for given starting values of the position and momentum of a particle in the phase space defined by the kinetic and potential energy provided in input.

Usage

trajectories(theta0, m0, nlp, args, eps, k, M_cont, M_disc, max_it)

Arguments

theta0

a numeric vector of length d representing the starting position vector for the particle.

m0

a numeric vector of length d representing the starting momenta vector for the particle.

nlp

a function object that evaluate the negative of the logarithm of a probability density function, and its gradient, i.e. the potential energy function of the system.

args

a list object containing the arguments to be passed to the function nlp.

eps

a numeric scalar indicating the step size for the leapfrog integrator.

k

an integer scalar indicating the number of discontinuous components of theta0.

M_cont

either a vector or a squared matrix, of the same length/dimension of the position/momenta vector, representing the continuous components mass matrix.

M_disc

a vector of the same length of the position/momenta vector, representing the discontinuous components mass matrix.

max_it

an integer value indicating the length of the trajectory. This quantity times eps is equal to the approximated integration time of the Hamiltonian flow.

Value

a data frame that summarizes the approximated Hamiltonian flow.


[Package XDNUTS version 1.6 Index]