simulate_SIR: Simulate an epidemic with SIR dynamics and draw binomial...

Description Usage Arguments Value Examples

View source: R/simulate_SIR.R

Description

Simulate an epidemic with SIR dynamics and draw binomial samples.

Usage

1
2
simulate_SIR(obstimes, params, popsize, init_config = NULL,
  trim = TRUE)

Arguments

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

Value

list with a population bookkeeping matrix and an observation matrix

Examples

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)

fintzij/BDAepimodel documentation built on Sept. 20, 2020, 1:44 p.m.