Make a function closure to implement a chemical Langevin (continuous-state) approximation for a SPN.

step_CLE(S, Sout, haz, dt = 0.01, maxhaz = 1e+06)

Arguments

S

a stoichiometry Matrix-class object

Sout

an optional matrix to track of event firings. In the continuous stochastic model this will be the approximate cumulative intensity of each event.

haz

a list of hazard functions

dt

time-step for Euler-Maruyama method used to solve the SDE system

maxhaz

maximum allowable hazard

Value

function closure for use in sim_trajectory_R or sim_trajectory_CSV

Details

The chemical Langevin approximation is a numerical simulation of a Fokker-Planck approximation to the Master equations (Kolmogorov Forwards Equations) governing the stochastic model; the CLE approximation is a second-order approximation that will get the correct mean and variance but higher order moments will be incorrect.

The design of step_CLE 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_PTS, step_DM, step_ODE