
Exact stochastic simulation of the SIRD jump process (Gillespie algorithm)
Source:R/sird_ga_simulate.R
sird_gillespie.RdSimulates one exact trajectory of the continuous-time, density-dependent Markov jump process underlying the SIRD-GA model, using the direct Gillespie method, and returns the compartment counts recorded at an equally-spaced observation grid.
Arguments
- N
Population size (integer head count).
- S0, I0, R0
Initial compartment counts (integers,
S0+I0+R0 <= N).- lambda, gamma, alpha
Transmission, recovery and disease-induced mortality rates.
- Tmax
Final observation time.
- Delta
Spacing of the recorded observation grid (default
1).- max_events
Safety cap on the number of simulated events.