Learn R Programming

EpiDynamics (version 0.3.1)

SIRPartialImmunity: 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

vector with 9 values: the death, birth, transmission and recovery rates, the modified susceptiblity to strain i for those individuals recovered from the other strain and the modified transmission rate of strain i from those individuals that have recovered from the other strain. The name of these values must be "mu", "v", "beta1", "beta2", "gamma1", "gamma2", "alpha1", "aplha2", "a1", "a2". The numbers 1 and 2 at the end of parameters names stand for strain 1 and strain 2.

init

vector with 8 values: In this formulation NAB refers to the proportion of the population who are A with respect to strain 1 and B with respect to strain 2. Thus, initial values must be named: "NSS", "NIS", "NRS", "NRI", "NSI", "NSR", "NIR" and "NRR". The sum of initial values must be <= 1.

time

time sequence for which output is wanted; the first value of times must be the initial time.

...

further arguments passed to ode function.

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.

Details

This is the R version of program 4.1 from page 118 of "Modeling Infectious Disease in humans and animals" by Keeling & Rohani.

References

Keeling, Matt J., and Pejman Rohani. Modeling infectious diseases in humans and animals. Princeton University Press, 2008.

See Also

ode.

Examples

Run this code
# NOT RUN {
# 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)
                                      
# }

Run the code above in your browser using DataLab