C++ Based Uniformization Sampling

Share:

Description

Function for generating initial and endpoint-conditioned Markov process sampling paths for a given discrete-time transition matrix

Usage

1
rNijTRiT_Unif(tmabs, te, gm, tpm) 

Arguments

tmabs

matrix of absolute transition frequencies

te

time elapsed in transition process

gm

generator matrix

tpm

discrete-time transition probability matrix, matrix exponential of gm

Details

Function for the simulation of paths from an endpoint-conditioned Markov process. Returns number of transitions NijT and cumulative holding times RiT.

Author(s)

Jon Fintzi, Marius Pfeuffer

References

J. Fintzi: R Package ECctmc, 2016.

A. Hobolth and E. A. Stone: Simulation from Endpoint-Conditioned, Continuous-Time Markov Chains on a Finite State Space, with Applications to Molecular Evolution. Annals of Applied Statistics 3(3):1204-1231, 2009

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(tm_abs)

## Generator Matrix
gm=matrix(1,8,8)
diag(gm)=0
diag(gm)=-rowSums(gm)
gm[8,]=0

## Transition Probability Matrix
library(expm)
te=1
tpm=expm(gm*te)

rNijTRiT_Unif(tm_abs,te,gm,tpm)