
Generate a multinomial outbreak defined by per class growth rates and a poisson model
Source:R/simulation-utils.R
sim_multinomial.RdGenerate a multinomial outbreak defined by per class growth rates and a poisson model
Arguments
- changes
a list of time points in column
tand growth rates per week per class, in other columns.- initial
the size of the initial outbreak per class. There should be one entry per class
- time_unit
e.g. a daily or weekly time series: "1 day", "7 days"
- ...
Named arguments passed on to
sim_poisson_modelfn_importsa function that takes input vector
tand returns the number of imported cases at timest.seeda random seed
kappaa dispersion parameter. 1 is no dispersion (compared to poisson), smaller values mean more dispersion.
max_timethe desired length of the time series,
fn_growtha function that takes input vector
tand returns the growth rates at timest
Examples
if (interactive()) {
plot_counts(
sim_multinomial() %>% dplyr::glimpse()
)
}