rcfmc | R Documentation |
This function simulates a single realisation from a continuous time Markov chain having a finite state space based on a given transition rate matrix.
rcfmc(n,Q,pi0)
n |
The number of states to be sampled from the Markov chain, including the initial state, which will be sampled using |
Q |
The transition rate matrix of the Markov chain, where each off-diagonal element |
pi0 |
A vector representing the probability distribution of the
initial state of the Markov chain. If this vector is of length |
An R stepfun
object containing the sampled path of the process.
rfmc
, stepfun
plot(rcfmc(20,matrix(c(-0.5,0.5,1,-1),ncol=2,byrow=TRUE),c(1,0)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.