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

Description Usage Arguments Details Value References See Also Examples

View source: R/SIRDemogStoch.R

Description

Solves a SIR model with demographic stochasticity

Usage

1
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.

Details

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

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.

References

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

See Also

ode.

Examples

1
2
3
4
5
6
7
8
# 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)

oswaldosantos/EpiDynamics documentation built on May 24, 2019, 4:59 p.m.