SIRTauLeap {EpiDynamics} | R Documentation |
SIR model with tau leap method (P 6.5).
Description
SIR model with demographic stochasticity approximated using the tau-leap method and assuming Poisson distributions.
Usage
SIRTauLeap(pars, init, end.time)
Arguments
pars |
|
init |
|
end.time |
end time to be simulated. |
Details
This is the R version of program 6.5 from page 204 of "Modeling Infectious Disease in humans and animals" by Keeling & Rohani.
Value
list
. The first three elements are the vectors *$pars
, *$init
and *$time
, containing the pars
, init
and end.time
arguments of the function. The fourth element *$results
is a data.frame
with up to as many rows as time steps determined by the parameters tau
and end.time
. The first column contains the time steps. The second, third and fourth columns contain the number of susceptibles, infectious and recovered.
References
Keeling, Matt J., and Pejman Rohani. Modeling infectious diseases in humans and animals. Princeton University Press, 2008.
Examples
# Parameters and initial conditions.
parameters <- c(beta = 1, gamma = 1 / 10, mu = 5e-4, N = 50, tau = 1)
initials <- c(X = 5, Y = 1, Z = 44)
end.time <- 2 * 365
# Solve and plot.
sir.demog.stoch <- SIRTauLeap(pars = parameters, init = initials,
end.time = end.time)
PlotMods(sir.demog.stoch)