Simulate an SIR model with specified time-varying reproduction number
Source:R/simulate.R
simulate_sir.Rd
Simulates the spread of an infectious disease using the Susceptible-Infectious-Recovered (SIR) compartment model. The simulator takes a vector of specified \(R_t\) values and uses them to calculate the transmissibility of the disease at each time point. The model is then used to simulate the number of susceptible, infectious, and recovered individuals over time with disease transmission at each time point matching the pre-specified \(R_t\). The function also simulates the number of true and observed incident cases, convolving simulated incidence through a specified delay distribution and simulating from a negative binomial distribution.
Arguments
- Rt
A vector of time-varying reproduction number values. Default is a modified sine curve, oscillating between 0.50 and 1.50 with a period of 20 days.
- S0
Initial number of susceptible individuals
- I0
Initial number of infected individuals
- R0
Initial number of recovered individuals
- gamma
Recovery rate, the inverse of the average infectious period
- delay_pmf
Probability mass function for delay distribution. Default is a vector with mean 3.
- k
Dispersion parameter for negative binomial distribution
- seed
Random seed for reproducibility
- date0
Start date for the simulation. Only used to add dates to outputs for use with
RtGam()
and friends.- day_of_week
Values to use for the day of week effect. Defaults to NULL for no effect.