SIR2TypesImports {EpiDynamics} | R Documentation |
SIR model with two types of imports (P 6.6).
Description
Solves a model with two types of stochastic imports and demographic stochasticit
Usage
SIR2TypesImports(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.6 from page 210 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 number of susceptibles, infectious, recovered and boolean for epsilon and delta imports.
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 = 0.1, mu = 5e-4,
epsilon = 2e-5, delta = 0.01)
initials <- c(X = 5, Y = 2, N = 50)
# Solve and plot.
sir.2types.imports <- SIR2TypesImports(parameters, initials, 2 * 365)
PlotMods(sir.2types.imports)