sample_meetingtime | R Documentation |
Sample two Markov chains, each following 'single_kernel' marginally, until they meet, and report the meeting time, as well as the elapsed wall-clock time in seconds.
This function does not record the trajectories of the chains, with the goal of being memory-light.
To record these trajectories, see sample_coupled_chains
. To directly
compute unbiased estimators on the fly, see sample_unbiasedestimator
.
sample_meetingtime( single_kernel, coupled_kernel, rinit, lag = 1, max_iterations = Inf )
single_kernel |
A list taking a state and returning a state, performing one step of a Markov kernel |
coupled_kernel |
A list taking two states and returning two states, performing one step of a coupled Markov kernel; it also returns a boolean "identical" indicating whether the two states are identical. |
rinit |
A list representing the initial state of the chain, that can be given to 'single_kernel' |
lag |
A time lag, equal to one by default |
max_iterations |
A maximum number of iterations, at which to interrup the while loop; Inf by default |
A list with
meetingtime: the meeting time; equal to Inf if while loop was interrupted
elapsedtime: elapsed wall-clock time, in seconds
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.