Learn R Programming

EpiDynamics (version 0.3.1)

SIRDemogStoch: SIR model with demographic stochasticity (P 6.4).

Description

Solves a SIR model with demographic stochasticity

Usage

SIRDemogStoch(pars = NULL, init = NULL, time = NULL, ...)

Arguments

pars

vector with 3 parameters: transmission rate, recovery rate and per capita death rate. The names of these values must be "beta", "gamma" and "mu", respectively. All parameters must be positive and all rates are specified in days. The birth rate is assumed to be constant and equal to mu * N, therefore preventing extinction of the host population.

init

vector with 3 values: the initial population size that are susceptible, infectious and the total population size. The names of these values must be "X", "Y" and "N", respectively. All initial conditions must be positive.

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, second and third elements are the vectors (*$pars, *$init, *$time, containing the pars, init and time arguments of the function. The fourth 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.

Details

This is the R version of program 6.4 from page 203 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(beta = 1, gamma = 1 / 10, mu = 5e-4)
initials <- c(X = 500, Y = 25, N = 5e3)

# Solve and plot.
sir.demog.stoch <- SIRDemogStoch(pars = parameters, 
                                 init = initials, time = 2 * 365)
PlotMods(sir.demog.stoch)

# }

Run the code above in your browser using DataLab