| step_DM {MGDrivE2} | R Documentation | 
Make Gillespie's Direct Method (DM) Sampler for a SPN model
Description
Make a function closure to implement Gillespie's Direct Method sampler for a SPN.
Usage
step_DM(S, Sout, haz, maxhaz = 1e+06)
Arguments
| S | a stoichiometry  | 
| Sout | an optional matrix to track of event firings | 
| haz | a list of hazard functions | 
| maxhaz | maximum allowable hazard | 
Details
The direct method is an exact sampling algorithm; it simulates each event individually. Because of this it may be extremely slow for non-trivial population sizes, and thus should be used to debug and test rather than for serious Monte Carlo simulation.
The design of step_DM is from: Wilkinson, D. J. (2011). Stochastic
modeling for systems biology. CRC press
Elements of the N list come from two places: The stoichiometry matrix
(S) is generated in spn_S and the hazards (h) come
from spn_hazards.
For other samplers, see: step_CLE, step_PTS, step_ODE
Value
function closure for use in sim_trajectory_R or sim_trajectory_CSV