Make Mean-field Approximation (ODE) Numerical Integrator for a SPN Model for Decoupled Epi Dynamics
Source:R/sampling-ODE.R
step_ODE_decoupled.Rd
Make a function closure to implement a first order mean-field ODE approximation for a SPN.
Arguments
- S
a stoichiometry
Matrix-class
object- Sout
an optional matrix to track of event firings. In the deterministic case it will return the rate of that event at the end of the time step
- haz
a list of hazard functions
- method
a character giving the type of numerical integrator used, the default is "lsoda"
- human_ode
ODE function used for human states
Value
function closure for use in sim_trajectory_R
or sim_trajectory_CSV
Details
This method is equivalent to considering the ODEs describing the time evolution of the mean trajectory (first moment) and setting all higher order moments which appear on the right hand side to zero.
The solvers used within can be found in the deSolve
package, see
ode
. For inhomogeneous systems, consider using the "rk4"
method to avoid excessive integration times.
The stoichiometry matrix (S
) is generated in spn_S
.
The list of hazards (haz
) come from spn_hazards
.