[R] Markovchain and Sensitivity analysis
Kristin Bornstein
kcarr2001 at gmail.com
Mon Feb 8 23:45:38 CET 2016
I'm trying to develop a markov chain transition matrix to simulate an
infectious disease model. I've got a much larger matrix that I'm working
with but here's the code for a toy version of the model:
library("markovchain")
byRow <- TRUE
#Parameters
pop <- 1000
b1 <- 0.0000095
b2 <- 0.0000048
b3 <- 0.0000097
u1 <- 0.046
u2 <- 0.05
c <- 0.91
cf <- 0.25
e <- 0.1014
vb <- b3*e
s1s2 <- 1-b1-u1
s2s3 <- 1-b2-c-u2
s3e <- 1-b3
ir <- 1-cf
ve <- 1-vb
toyModel <- new("markovchain", states = c("birth", "Susceptible1",
"Susceptible2", "Susceptible3", "Infected", "Vaccinated", "Recovered",
"Exit"),
transitionMatrix = matrix(data = c(1, (pop*0.024), 0, 0, 0, 0, 0,
-(pop*0.024),
0, 0, s1s2, 0, b1, 0, 0, u1,
0, 0, 0, s2s3, b2, c, 0, u2,
0, 0, 0, 0, b3, 0, 0, s3e,
0, 0, 0, 0, 0, 0, ir, cf,
0, 0, 0, 0, vb, 0, 0, ve,
0, 0, 0, 0, 0, 0, 0.5, 0.5,
0, 0, 0, 0, 0, 0, 0, 1), byrow = byRow, nrow = 8),
name = "Toy")
initial <- c(1, 0, 0, 0, 0, 0, 0, 0)
after100 <- initial * (toyModel^ 100)
The issue is that the current variable values are based on point estimates,
and I'd like to run some sensitivity and distribution analyses on
confidence interval values I have for each parameter. Does anyone know a
good approach to use to do this or have any experience using Latin
Hypercube Sampling (LHS package) or partial correlation coefficients
(sensitivity package) to do this?
Thanks in advance!
[[alternative HTML version deleted]]
More information about the R-help
mailing list