The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.
The Kermack-McKendrick SIR model (Brown, Rothery, et al. 1993) is defined as
dS/dt = -beta*N*S
dI/dt = beta*N*S - gamma*I
dR/dt = gamma*I
Note that simulations of this model can generate in all zero propensity, if the first reaction is a recovery of the single ‘Infected’ individual.
Define parameters
library(GillespieSSA2)
<- "Kermack-McKendrick SIR model"
sim_name <- c(beta = .001, gamma = .1)
params <- 100
final_time <- c(S = 500, I = 1, R = 0) initial_state
Define reactions
<- list(
reactions reaction("beta * S * I", c(S = -1, I = +1), name = "transmission"),
reaction("gamma * I", c(I = -1, R = +1), name = "recovery")
)
Run simulations with the Exact method
set.seed(1)
<- ssa(
out initial_state = initial_state,
reactions = reactions,
params = params,
final_time = final_time,
method = ssa_exact(),
sim_name = sim_name
) plot_ssa(out)
Run simulations with the Explict tau-leap method
set.seed(1)
<- ssa(
out initial_state = initial_state,
reactions = reactions,
params = params,
final_time = final_time,
method = ssa_etl(),
sim_name = sim_name
) plot_ssa(out)
Run simulations with the Binomial tau-leap method
set.seed(2)
<- ssa(
out initial_state = initial_state,
reactions = reactions,
params = params,
final_time = final_time,
method = ssa_btl(),
sim_name = sim_name
) plot_ssa(out)
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.