hfNames <- array(rep("Exponential", 9), dim = c(3,3))
hfNames[col(hfNames)<=row(hfNames)]<-"NULL"
colnames(hfNames) <- as.list(paste("state", 1:3))
rownames(hfNames) <- as.list(paste("state", 1:3))
M <- makeM(hfNames)
par <- generateParameterMatrix(M)
par[[1,2]] <- list(rate = 1)
par[[1,3]] <- list(rate = 2)
par[[2,3]] <- list(rate = 0.5 )
cohort <- simulateCohort(
transitionFunctions = M,
parameters = par,
cohortSize = 100,
to=10)
plotProgressionPath(cohort, hfNames, 2)
Run the code above in your browser using DataLab