FPTime: First Passage Time

Description Usage Arguments Value Author(s) See Also Examples

View source: R/FPTime.R

Description

This function uses the companion function multDTMC to simulate several Markov chains to determine the first passage time into each state, i.e. the first time (after the initial iteration) that a specified state is reached in the Markov Process. First Passage Time can be useful for both determining class properties as well as the stationary/invariant distribution for large Markov Chains in which explicit matrix inversion is not computationally tractable.

Usage

1
FPTime(state, nchains, tmat, io, n)

Arguments

state

State in which you want to find the first passage time.

nchains

Number of chains you wish to simulate.

tmat

Transition Matrix, must be a square matrix, rows must sum to 1.

io

Initial Distribution

n

Number of iterations to run for each Markov Chain.

Value

fp1

Vector of length(nchains) which gives first passage time into the specified state for each Markov Chain.

Author(s)

Will Nicholson

See Also

DTMC

Examples

1
2
3
data(gr)
data(id)
FPTime(1,10,gr,id,10) # First passage time into first state on Gambler's ruin

Example output

 [1]  3  1 NA  6  9 NA  1  4  3 NA

DTMCPack documentation built on May 2, 2019, 2:06 a.m.