SIRPartialImmunity {EpiDynamics} | R Documentation |
SIR model with partial immunity (P 4.1).
Description
Solves a model with partial immunitiy.
Usage
SIRPartialImmunity(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 4.1 from page 118 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. Second, third and fourth 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(mu = 1 / (70 * 365), beta1 = 260 / 365,
beta2 = 520 / 365, gamma1 = 1 / 7,
gamma2 = 1 / 7, alpha1 = 0.5,
alpha2 = 0.4, a1 = 0.4, a2 = 0.5)
initials <- c(NSS = 0.1, NIS = 1e-4, NRS = 0.02, NRI = 0,
NSI = 1e-4, NSR = 0.5, NIR = 0, NRR = 0.3798)
# Solve and plot.
sir.partial.immunity <- SIRPartialImmunity(pars = parameters,
init = initials,
time = 0:(100 * 365))
PlotMods(sir.partial.immunity, variables = c('NIS', 'NIR'), grid = FALSE)