trajectories | 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.
trajectories(theta0, m0, nlp, args, eps, k, M_cont, M_disc, max_it)
theta0 |
a numeric vector of length |
m0 |
a numeric vector of length |
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 |
eps |
a numeric scalar indicating the step size for the leapfrog integrator. |
k |
an integer scalar indicating the number of discontinuous components of |
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 |
a data frame that summarizes the approximated Hamiltonian flow.
The first d
columns contain the particle position evolution.
The second d
columns contain the particle momenta evolution.
The 2d + 1
column contains the Hamiltonian evolution.
The 2d + 2
column contains the evolution of the No U-Turn Sampler termination criterion.
The 2d + 3
column contains the evolution of the virial exhaustion termination criterion.
Acceptance and or refraction probabilities. This depends on the value of k
.
Reflession dummy indicators.
Divergent transition dummy indicators.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.