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
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.