simulate_gillespie | R Documentation |
Simulate a stochastic epidemic model path via Gillespie's direct method and returns a matrix containing a simulated path from a stochastic epidemic model.
simulate_gillespie( flow, parameters, constants, tcovar, t_max, init_states, rate_adjmat, tcovar_adjmat, tcovar_changemat, init_dims, forcing_inds, forcing_tcov_inds, forcings_out, forcing_transfers, rate_ptr )
flow |
Flow matrix |
parameters |
Vector of parameters |
constants |
vector of constants |
tcovar |
matrix of time-varying covariates |
init_states |
vector of initial compartment counts |
rate_adjmat |
adjacency matrix for updating rates after each event |
tcovar_adjmat |
adjacency matrix for updating rates after each time a covariate changes |
tcovar_changemat |
indicator matrix identifying which covariates change at each time |
init_dims |
initial estimate for dimensions of the bookkeeping matrix, calculated as sum_strata(stratum size x number states x 3), rounded to the next greatest power of 2. |
forcing_inds |
logical vector of indicating at which times in the time-varying covariance matrix a forcing is applied. |
rate_ptr |
external function pointer to the lumped rate functions. |
forcing_matrix |
matrix containing the forcings. |
matrix with a simulated path from a stochastic epidemic model.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.