# building a Q matrix for a 3-state cont.-time Markov chain
Q = diag(3)
Q[!Q] = rexp(6)
diag(Q) = 0
diag(Q) = - rowSums(Q)
# draw time differences
timediff = rexp(1000, 10)
Gamma = tpm_cont(Q, timediff)
Run the code above in your browser using DataLab