CFTP: Coupling From The Past

Description Usage Arguments Details Value

Description

Sample from the stationary distribution of a discrete Markov chain using the Coupling From the Past algorithm.

Usage

1
2
CFTP(k, roll.fun, update.fun, monotonic = FALSE, min = NA, max = NA,
  verbose = FALSE, double_time = FALSE, ...)

Arguments

k

number of states of the Markov chain

roll.fun

user defined function that rolls the original die. Must have as first input the size of the returned sample. Additional inputs can be passed.

update.fun

update function of the Markov chain. See the method update.fun of class Ladder to check how it should be defined.

monotonic

if TRUE, monotonic CFTP is implemented

min

minimum state used in the monotonic CFTP. Ignored if monotonic = FALSE.

max

maximum state used in the monotonic CFTP. Ignored if monotonic = FALSE.

verbose

if TRUE, the time steps required by the algorithm is returned as well.

double_time

if TRUE at each iteration of the algorithm, the time is doubled instead of increased by one. Can lead to slower implementation if rolling the die is computationally costly.

Details

The function is designed to sample from a fine and connected ladder using rolls of a given die and uniform random variables. It requires an update function to be defined as well as a function to roll the original die. It is mostly used internally by the Ladder class.

Value

If verbose=FALSE, returns a state sampled from the stationary distribution. If verbose=TRUE, returns a list where the first element is a state from the stationary distribution and the second element are the time steps required by the algorithm to finish.


giuliomorina/DiceEnterprise documentation built on May 15, 2019, 12:59 p.m.