# 3 state irreversible model
tmat <- rbind(c(NA, 1, 2),
c(NA, NA, 3),
c(NA, NA, NA))
q12 <- c(.8, .7)
q13 <- c(.2, .3)
q23 <- c(1.1, 1.2)
q <- data.frame(q12, q13, q23)
qmat <- qmatrix(q, trans_mat = tmat)
print(qmat)
# Matrix exponential of each matrix in array
expmat(qmat)
Run the code above in your browser using DataLab