SEIR4AgeClasses {EpiDynamics} | R Documentation |
SEIR model with 4 age classes and yearly aging (P 3.4).
Description
Solves a SEIR model with four different age-groups and yearly "movements" between the groups mimicking the school year
Usage
SEIR4AgeClasses(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.4 from page 87 of "Modeling Infectious Disease in humans and animals" by Keeling & Rohani.
All rates are specified in days. Moreover, a vector
n with the proportion of each age group. All parameters must be positive.
Value
list
of class SolveSIR4ACYA
. The first element, *$model
, is the model function. The second, third and fourth elements are vectors (*$pars
, *$init
, *$time
, respectively) 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, exposed, 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 <- list(beta = matrix(c(2.089, 2.089, 2.086, 2.037,
2.089, 9.336, 2.086, 2.037,
2.086, 2.086, 2.086, 2.037,
2.037, 2.037, 2.037, 2.037),
nrow = 4, ncol = 4),
sigma = 0.125, gamma = 0.2,
mu = c(0, 0, 0, 1) / (55 * 365),
nu = c(1 / (55 * 365), 0, 0, 0),
n = c(6, 4, 10, 55) / 75)
initials <- c(S = c(0.05, 0.01, 0.01, 0.008),
E = c(0.0001, 0.0001, 0.0001, 0.0001),
I = c(0.0001, 0.0001, 0.0001, 0.0001),
R = c(0.0298, 0.04313333, 0.12313333, 0.72513333))
# Solve and plot.
# Uncomment the following lines (running it takes more than a few seconds):
# seir4.age.classes <- SEIR4AgeClasses(pars = parameters,
# init = initials,
# time = 0:36500)
# PlotMods(seir4.age.classes,
# variables = c('I1', 'I2', 'I3', 'I4'), grid = F)