getHittingTime: getHittingTime

Description Usage Arguments Value Examples

View source: R/getHittingTime.R

Description

Calculate the hitting time matrix of a markov chain if it exists

Usage

1
getHittingTime(i=NULL, j=NULL, mc.obj)

Arguments

i

row or rows to be returned in the hitting time matrix. Default to NULL and to return entire matrix.

j

column or columns to be returned in the hitting time matrix. Default to NULL and to return entire matrix.

mc.obj

Markov chain object created by the 'mc.create' function

Value

returns the submatrix of the hitting time matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
singleServer = function(i,j){
  if(i==1 && j==2)
    return(1)
  p = 0.3
  q = 0.7
  r = 0
  if(j == i+1)
    return(p)
  if(j == i-1)
    return(q)
  if(j==i)
    return(r)
  return(0)
}
ex = mc.create(pijdef=singleServer, discrete=TRUE, infinite=TRUE)
ans = getHittingTime(mc.obj = ex)

qiwei-li/fidcMC documentation built on May 26, 2019, 11:35 a.m.