View source: R/debiasing_algorithm.R
Sample two MCMC chains, each following single_kernel
marginally,
and coupled_kernel
jointly, until min(max(tau, m), max_iterations), where tau
is the first time at which the two chains meet (i.e. take the same value exactly).
Or more precisely, they meet with a delay of one, i.e. X_t = Y_t-1. The chains
are initialized from the distribution provided in rinit
.
See get_hmc_kernel
for an example of function returning the appropriate kernels.
1 2 | coupled_chains(single_kernel, coupled_kernel, rinit, m = 1,
max_iterations = Inf, preallocate = 10)
|
single_kernel |
function taking a state (in a vector), its log density and an iteration, and returning
a list with a key named |
coupled_kernel |
function taking two states (in two vectors), their log densities and an iteration,
and returning a list with keys |
rinit |
function taking no arguments are returning an initial state for a Markov chain. |
m |
number of iterations desired (will be proportional to the computing cost if meeting occurs before |
max_iterations |
number of iterations at which the function stops if it is still running (default to Inf). |
preallocate |
expected number of iterations, used to pre-allocate memory (default to 10). |
logtarget |
function evaluating the log target density |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.