SIRDemogStoch {EpiDynamics} | R Documentation |
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 |
|
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 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.
See Also
ode.
Examples
# 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)