sample_meetingtime: Sample coupled Markov chains until meeting

View source: R/meetingtime.R

sample_meetingtimeR Documentation

Sample coupled Markov chains until meeting

Description

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.

Usage

sample_meetingtime(
  single_kernel,
  coupled_kernel,
  rinit,
  lag = 1,
  max_iterations = Inf
)

Arguments

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

Value

A list with

  • meetingtime: the meeting time; equal to Inf if while loop was interrupted

  • elapsedtime: elapsed wall-clock time, in seconds


pierrejacob/debiasedmcmc documentation built on Aug. 22, 2022, 12:41 a.m.