SIRSinusoidalBirth: SIR model with sinusoidal births (P 5.3).

Description Usage Arguments Details Value References See Also Examples

View source: R/SIRSinusoidalBirth.R

Description

Solves a SIR model with sinusoidal forcing of the birth rate.

Usage

1
SIRSinusoidalBirth(pars = NULL, init = NULL, time = NULL, ...)

Arguments

pars

list with: the transmission rate, the mean birth rate, a scalar (or a vector to create bifurcations) with the amplitude of sinuoidal forcing for the birth rate, the frequency of the oscillations, the per capita death rate and the recovery rate. The names of these values must be "beta", "alpha0", "alpha1", "w", "mu" and "gamma", respectively. All rates must be specified in days and alpha1 <= 1.

init

vector with 3 values: the initial proportion of susceptibles and infectious. The names of these values must be "S" and "I", respectively. All parameters must be positive and S + I <= 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.

Details

This is the R version of program 5.3 from page 184 of "Modeling Infectious Disease in humans and animals" by Keeling & Rohani. To create bifurcations, alpha1 must be a vector. For bifurcations, if max(time) < 3650), time is defined as c(0:3650). Here, different to the original Python code, we wrote equations for the R population as R = 1 - S - I.

Value

list. The first element, *$model, is the model function. The second element is a list with the the *$pars argument. The third and fourth elements are the vectors (*$init, *$time, containing the 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
                                  
# Parameters and initial conditions (bifurcation plot of infectious)
parameters <- list(beta = 17 / 13, alpha0 = 1 / (50 * 365),
                   alpha1 = 0.25, w = 2 * pi / 365 ,
                   mu = 1 / (50 * 365), gamma =  1 / 13)

parameters2 <- list(beta = 17 / 13, alpha0 = 1 / (50 * 365),
                   alpha1 = seq(0, 0.99, 0.01), w = 2 * pi / 365 ,
                   mu = 1 / (50 * 365), gamma =  1 / 13)

initials <- c(S = 1 / 17, I = 1e-4, R =  1 - (1 / 17 + 1e-4))

# Solve and plot.
sir.sinusoidal.birth <- SIRSinusoidalBirth(pars = parameters,
                                           init = initials, 
                                           time = 0:(20 * 365))
PlotMods(sir.sinusoidal.birth)

# Bifurcations
# Uncomment the following lines (running it takes more than a few seconds):
# bifurcation <- SIRSinusoidalBirth(pars = parameters2,
#                                   init = initials, 
#                                   time = 0:(20 * 365))
# PlotMods(bifur, bifur = TRUE)

Example output



EpiDynamics documentation built on March 26, 2020, 6:33 p.m.