SIRTauLeap: SIR model with tau leap method (P 6.5).

Description Usage Arguments Details Value References Examples

View source: R/SIRTauLeap.R

Description

SIR model with demographic stochasticity approximated using the tau-leap method and assuming Poisson distributions.

Usage

1
SIRTauLeap(pars, init, end.time)

Arguments

pars

vector with 5 values: the transmission, recovery and death rates, the population size assumed to be constant and the time step. The names of these values must be "beta", "gamma", "mu", "N" and "tau" respectively.

init

vector with 3 values: the initial number of susceptibles, infectious and recovered, respectively. The names of these values must be "X", "Y" and "Z" respectively.

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. Modeling Infectious Diseases in Humans and Animals

Examples

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

EpiDynamics documentation built on May 1, 2019, 8:08 p.m.