generatorToInputs: 'qidef' & 'pijdef' from a generator matrix

Description Usage Arguments Value Author(s) Examples

View source: R/generatorToInputs.R

Description

Get the inputs 'qidef' & 'pijdef' from a infiniteseimal generator matrix

Usage

1

Arguments

generator

infiniteseimal generator matrix

bycol

logical, indicate whether the generater matrix columns sum to zero, default value is TRUE

Value

pijdef

the transition matrix of Markov Chain, shown by row

qidef

the holding-time rates for the continuous Markov Chain

Author(s)

Jiexuan Cao, Yuki Liu, Qianhan Zhang

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
q = 0.5
alpha = 0.4
sigma = 0.3
mu = 0.2
omega = 0.1

Q =
  rbind(c(-alpha, sigma, 0, mu, 0, 0),
        c(alpha*(1 - q), -(alpha + sigma), (omega + sigma), 0, mu, 0),
        c(0, alpha, -(sigma + omega), 0, 0, 0),
        c(alpha*q, 0, 0, -(alpha + mu), sigma, (mu + omega)),
        c(0, 0, 0, alpha*(1-q), -(sigma + mu), 0),
        c(0, 0, 0, alpha*q, 0, -(mu + omega)))

generatorToInputs(Q)

yuki0425/mc documentation built on May 4, 2019, 7:44 p.m.