Description Usage Arguments Value Examples
Simulate an epidemic with SIR dynamics and draw binomial samples.
1 2 | simulate_SIR(obstimes, params, popsize, init_config = NULL,
trim = TRUE)
|
obstimes |
vector of observation times |
params |
vector of parameters, must be in the following order: beta, mu, rho, S0, I0, R0 |
popsize |
population size |
init_config |
compartment counts at t0. |
trim |
logical for whether to trim the observations after the epidemic has died off |
list with a population bookkeeping matrix and an observation matrix
1 2 3 4 5 | obstimes <- 0:10
params <- c(0.04, 1, 0.5, 0.9, 0.03, 0.07)
popsize <- 100
epidemic <- simulate_SIR(obstimes, params, popsize)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.