Description Usage Arguments Details Value References Examples
View source: R/SISDemogStoch.R
SIS model with event-driven or demographic stochasticity.
1 | SISDemogStoch(pars, init, end.time)
|
pars |
|
init |
initial number of infectious. |
end.time |
end time to be simulated. |
This is the R version of program 6.3 from page 202 of "Modeling Infectious Disease in humans and animals" by Keeling & Rohani.
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.
Keeling, Matt J., and Pejman Rohani. Modeling infectious diseases in humans and animals. Princeton University Press, 2008.
1 2 3 4 5 6 7 8 | # 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.