
Generate a multinomial outbreak defined by per class growth rates and a poisson model
Source:R/simulation-utils.R
sim_multinomial.Rd
Generate a multinomial outbreak defined by per class growth rates and a poisson model
Arguments
- changes
a list of time points in column
t
and 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_model
fn_imports
a function that takes input vector
t
and returns the number of imported cases at timest
.seed
a random seed
kappa
a dispersion parameter. 1 is no dispersion (compared to poisson), smaller values mean more dispersion.
max_time
the desired length of the time series,
fn_growth
a function that takes input vector
t
and returns the growth rates at timest
Examples
if (interactive()) {
plot_counts(
sim_multinomial() %>% dplyr::glimpse()
)
}