meanFirstPassageTime {markovchain}R Documentation

Mean First Passage Time for irreducible Markov chains

Description

Given an irreducible (ergodic) markovchain object, this function calculates the expected number of steps to reach other states

Usage

meanFirstPassageTime(object, destination)

Arguments

object

the markovchain object

destination

a character vector representing the states respect to which we want to compute the mean first passage time. Empty by default

Details

For an ergodic Markov chain it computes:

Value

a Matrix of the same size with the average first passage times if destination is empty, a vector if destination is not

Author(s)

Toni Giorgino, Ignacio Cordón

References

C. M. Grinstead and J. L. Snell. Introduction to Probability. American Mathematical Soc., 2012.

Examples

m <- matrix(1 / 10 * c(6,3,1,
                       2,3,5,
                       4,1,5), ncol = 3, byrow = TRUE)
mc <- new("markovchain", states = c("s","c","r"), transitionMatrix = m)
meanFirstPassageTime(mc, "r")


# Grinstead and Snell's "Oz weather" worked out example
mOz <- matrix(c(2,1,1,
                2,0,2,
                1,1,2)/4, ncol = 3, byrow = TRUE)

mcOz <- new("markovchain", states = c("s", "c", "r"), transitionMatrix = mOz)
meanFirstPassageTime(mcOz)


[Package markovchain version 0.9.5 Index]