mfpt: Mean First Passage Times

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/mfpt.R

Description

Computes mean first passage times among states for a first order Markov process.

Usage

1
mfpt(M, tol = 1e-10)

Arguments

M

An object of class markov or class spMarkov.

tol

A tolerance argument, used in determining the steady state distribution. By default set to 1e-100.

Details

The mean first passage times matrix is estimated following the standard expression as found in Meyer (1978, p. 41). The mean first passage time refers to the time-steps it takes to reach state Si for the first time, given the initial state Sj.

Value

If an object of class markov is provided, it returns a vector. If an object of class spMarkov is provided, it returns a matrix.

Author(s)

Osmar Leandro Loaiza Quintero

References

Meyer, Carl (1978). 'An Alternative Expression for the Mean First Passage Matrix', Linear Algebra and its Applications, Vol.22,pp.41-47.

See Also

spMarkov,markov

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data(usinc)
stateVars<-names(usinc@data[,7:87])
stateNames<-c('Poor','Lower','Middle','Upper','Rich')

##Classic Markov Matrix
Mc<-markov(usinc@data, stateVars=stateVars,n.states=5,stateNames=stateNames)
mfpt(Mc)

##Spatial Markov Matrix
#Create a list of spatial weights
require(spdep)
lw<-nb2listw(poly2nb(usinc,queen=TRUE),style='W')

Msp<-spMarkov(usinc@data, lw, stateVars=stateVars,
n.states=5,stateNames=stateNames,
pool=TRUE,std=TRUE)

mfpt(Msp)

spdyn documentation built on Feb. 6, 2021, 3 a.m.