Learn R Programming

EpiDynamics (version 0.3.1)

SISDemogStoch: SIS model with demographic stochasticity (P 6.3).

Description

SIS model with event-driven or demographic stochasticity.

Usage

SISDemogStoch(pars, init, end.time)

Arguments

pars

vector with 3 values: the transmission and recovery rates and the population size assumed to be constant. The names of these values must be "beta", "gamma", and "N" respectively.

init

initial number of infectious.

end.time

end time to be simulated.

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 created during the stochastic simulations. The second column contains the number of infectious.

Details

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

References

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

Examples

Run this code
# NOT RUN {
# Parameters and initial conditions.
parameters <- c(beta = 0.03, gamma = 1 / 100, N = 100)
initials <- 70

# Solve and plot.
sis.demog.stoch <- SISDemogStoch(pars = parameters,
                                 init = initials, end.time = 10 * 365)
PlotMods(sis.demog.stoch)

# }

Run the code above in your browser using DataLab