sample_coupled_chains: Sample coupled Markov chains

View source: R/coupled_chains.R

sample_coupled_chainsR Documentation

Sample coupled Markov chains

Description

Sample two Markov chains, each following 'single_kernel' marginally, and 'coupled_kernel' jointly, until min(max(tau, m), max_iterations), where tau is the first time the two chains meet (the "meeting time").

Or more precisely, they meet with a delay of lag, i.e. X_t = Y_t-lag, and lag is one by default.

Once the coupled chains are obtained, unbiased estimators can be computed for arbitrary test functions via the function H_bar.

If you're only interested in sampling meeting times, see sample_meetingtime.

Usage

sample_coupled_chains(
  single_kernel,
  coupled_kernel,
  rinit,
  m = 1,
  lag = 1,
  max_iterations = Inf,
  preallocate = 10
)

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'

m

A time horizon: the chains are sampled until the maximum between m and the meeting time

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

preallocate

A number of anticipated iterations, used to pre-allocate memory; 10 by default

Value

A list with

  • samples1: the first chain, of length max(m, tau)

  • samples2: the second chain, of length max(m, tau) - lag

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

  • iteration: final iteration; could be equal to m, to meetingtime, or to max_iterations

  • elapsedtime: elapsed wall-clock time, in seconds

  • cost: computing cost in terms of calls to Markov kernels (counting coupled kernel as twice the cost)


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