SISnRiskGroups {EpiDynamics} | R Documentation |
SIS model with multiple risk groups (P 3.2).
Description
Solves a SIS model with n different risk-groups.
Usage
SISnRiskGroups(pars = NULL, init = NULL, time = NULL, ...)
Arguments
pars |
|
init |
|
time |
time sequence for which output is wanted; the first value of times must be the initial time. |
... |
further arguments passed to ode function. |
Details
This is the R version of program 3.2 from page 64 of "Modeling Infectious Disease in humans and animals" by Keeling & Rohani.
All parameters must be positive, and ni <= 1, sum(ni) = 1, i = 1, ..., m.
Value
list
. The first element, *$model
, is the model function. The second, third and fourth elements are the vectors (*$pars
, *$init
, *$time
, containing the pars
, init
and time
arguments of the function. The fifth element *$results
is a data.frame
with up to as many rows as elements in time. First column contains the time. The following columns contain the proportion of susceptibles and infectious of each risk group.
References
Keeling, Matt J., and Pejman Rohani. Modeling infectious diseases in humans and animals. Princeton University Press, 2008.
See Also
ode.
Examples
# Parameters and initial conditions.
tmp <-matrix(c(0, 3, 10, 60, 100))
beta <- 0.0016 * tmp %*% t(tmp)
parameters <- list(m = 5, beta = beta,
gamma = c(0.2, 0.2, 0.2, 0.2, 0.2),
n = c(0.06, 0.31, 0.52, 0.08, 0.03))
initials <- c(I = c(0, 0, 0, 0, 1e-5))
# Solve and plot.
sis.n.riks.groups <- SISnRiskGroups(pars = parameters,
init = initials,
time = 0:30)
PlotMods(sis.n.riks.groups, grid = FALSE)