SIS-xde (Susceptible-Infected-Susceptible) Human Model
Source:vignettes/human_sis.Rmd
human_sis.Rmd
The SIS (Susceptible-Infected-Susceptible) human xde model model fulfills the generic interface of the human population component. It is the simplest model of endemic diseases in humans.
We subdivide a population into susceptible (
If there is no demographic change, the SIS-xde model can be rewritten as a single equation:
nStrata.
Equilibrium Solutions
A typical situation when using this model is that
Example
Here we run a simple example with 3 population strata at equilibrium.
We use ramp.xds::make_parameters_X_SIS_xde
to set up
parameters. Please note that this only runs the human population
component and that most users should read our
fully worked example to run a full simulation.
We use the null (constant) model of human demography (
The Long Way
To set up systems of differential equations, we must set the values of all our parameters.
nStrata <- 3
H <- c(100, 500, 250)
residence <- rep(1,3)
nPatches=1
nHabitats=1
membership=1
params <- make_xds_template("ode", "cohort", nPatches, membership, residence)
b <- rep(0.55, nStrata)
c <- rep(0.15, nStrata)
r <- rep(1/200, nStrata)
Xo = list(b=b, c=c, r=r)
class(Xo) <- "SIS"
foi = c(1:3)/365
eir <- foi/b
xde_steady_state_X(foi, H, Xo)-> ss
ss
#> $S
#> [1] 64.60177 238.56209 94.55959
#>
#> $I
#> [1] 35.39823 261.43791 155.44041
MYZo = list(MYZm = eir*H)
Xo$S=ss$S
Xo$I=ss$I
params <- setup_Xpar("SIS", params, 1, Xo)
params <- setup_Xinits(params, H, 1, Xo)
params <- setup_Hpar_static(params, 1)
params <- setup_MYZpar("trivial", params, 1)
params <- setup_Lpar("trivial", params, 1)
params <- setup_Linits(params, 1)
params <- make_indices(params)
F_season = function(t){0*t+1}
F_trend = function(t){0*t+1}
F_age = function(a){0*a+1}
params$EIRpar = list()
params$EIRpar$eir <- as.vector(eir)
params$EIRpar$scale <- 1
params$EIRpar$F_season <- F_season
params$EIRpar$F_trend <- F_trend
params$EIRpar$F_age <- F_age
params <- set_eir(eir, params)
params = make_indices(params)
Xo$S=H
Xo$I=H*0
params = setup_Xinits(params, H, 1, Xopts = Xo)
y0 <- get_inits(params)
y0$X
#> $H
#> [1] 100 500 250
#>
#> $I
#> [1] 0 0 0
params <-xds_solve_cohort(params)
out1 <- params$outputs$orbits
clrs = turbo(5)
XH <- out1$XH[[1]]
age <- out1$age
plot(age, XH$true_pr[,1], col = clrs[1], ylim = c(0,1), type = "l")
lines(age, XH$true_pr[,2], col = clrs[2])
lines(age, XH$true_pr[,3], col =clrs[5])
Using Setup
We have developed utilities for setting up models. We pass the parameter values and initial values as lists:
xds_setup_cohort(eir, Xname="SIS", HPop=H, Xopts = Xo) -> test_SIS_xde
xds_solve_cohort(test_SIS_xde)-> test_SIS_xde
test_SIS_xde$outputs$orbits$XH[[1]] -> XH2
sum((XH$true_pr-XH2$true_pr)^2)
#> [1] 0