main_function | R Documentation |
The function allows to generate a single Markov Chain for sampling from both continuous and discontinuous posterior distributions using a plethora of algorithms. Classic Hamiltonian Monte Carlo \insertCiteduane1987hybridXDNUTS , NUTS \insertCitehoffman2014noXDNUTS and XHMC \insertCitebetancourt2016identifyingXDNUTS are embedded into the framework described in \insertCitenishimura2020discontinuousXDNUTS, which allows to deal with such posteriors. Furthermore, for each method, it is possible to recycle samples from the trajectories using the method proposed by \insertCiteNishimura_2020XDNUTS. This is used to improve the estimation of the mass matrix during the warm-up phase without requiring significant additional computational costs. This function should not be used directly, but only through the user interface provided by xdnuts.
main_function(
theta0,
nlp,
args,
k,
N,
K,
tau,
L,
thin,
chain_id,
verbose,
control
)
theta0 |
a vector of length- |
nlp |
a function object that takes three arguments:
|
args |
the necessary arguments to evaluate the negative log posterior and its gradient. |
k |
the number of parameters that induce a discontinuity in the posterior distribution. |
N |
integer containing the number of post warm-up samples to evaluate. |
K |
integer containing the number of recycled samples from each trajectory during the warm-up phase or beyond. |
tau |
the threshold for the exhaustion termination criterion described in \insertCitebetancourt2016identifyingXDNUTS. |
L |
the desired length of the trajectory of classic Hamiltonian Monte Carlo algorithm. |
thin |
integer containing the number of samples to discard in order to produce a final iteration of the chain. |
chain_id |
the identification number of the chain. |
verbose |
a boolean value that controls whether to print all the information regarding the sampling process. |
control |
an object of class |
a named list containing:
a N \times d
matrix containing the sample from the
target distribution (if convergence has been reached).
a vector of length-N
containing the Markov Chain of the energy level sets.
a vector of length-N
containing the Markov Chain of the first difference energy level sets.
a vector of length-N
containing the sampled step size used for each iteration.
a vector of length-N
containing the length of each trajectory of the chain.
a vector of length-k + 1
containing the estimate of the Metropolis acceptance probabilities.
The first element of the vector is the estimated global acceptance probability. The remaining k elements are the
estimate rate of reflection for each parameters which travels coordinate-wise through some discontinuity.
a N_{adapt} \times d
matrix containing the sample of the chain
coming from the warm-up phase. If keep_warm_up = FALSE
inside the control
argument, nothing is returned.
a M \times d
matrix containing the locations where a divergence has been
encountered during the integration of Hamilton equation. Hopefully M \ll N
, and even better if M = 0
.
the Mass Matrix of the continuous components estimated during the warm-up phase.
Based on the M_type
value of the control
arguments, this could be an empty object, a vector or a matrix.
the Mass Matrix of the discontinuous components estimated during the warm-up phase.
Based on the M_type
value of the control
arguments, this could be an empty object or a vector.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.