SIR2Stages {EpiDynamics} | R Documentation |
SIR model with 2 age classes (P 3.3).
Description
Solves a SIR model two different age-groups.
Usage
SIR2Stages(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.3 from page 79 of "Modeling Infectious Disease in humans and animals" by Keeling & Rohani.
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, infectious and recovered.
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.
parameters <- c(betaCC = 100, betaCA = 10, betaAC = 10, betaAA = 20,
gamma = 10, lC = 0.0666667, muC = 0.0, muA = 0.016667)
initials <- c(SC = 0.1, IC = 0.0001, SA = 0.1, IA = 0.0001)
# Solve the system.
sir2stages <- SIR2Stages(pars = parameters,
init = initials, time = seq(0, 100, 0.01))