ssa.run {GillespieSSA} | R Documentation |
Higher-level interface to the method functions.
ssa.run(x0,a,nu,parms,tf,method,tau,f,epsilon,nc,hor,dtf,nd, ignoreNegativeState,consoleInterval,censusInterval, verbose,maxWallTime)
x0 |
initial states vector. |
a |
vector of propensity functions. |
nu |
state-change matrix. |
parms |
vector of model parameters. |
tf |
final time. |
method |
ssa method to use. |
tau |
step size for the ETL method (>0). |
f |
coarse-graining factor for the BTL method (>1) where a higher value results in larger step-size. |
epsilon |
accuracy control parameter for the OTL method (>0). |
nc |
critical firing threshold for the OTL method (positive integer). |
hor |
numerical vector of the highest order reaction for each species where hor=(1,2,22). Only applicable in the OTL method. |
dtf |
D method threshold factor for the OTL method. The OTL method is suspended if tau it estimates is smaller than the dtf multiple of the tau that the D method would have used (i.e. tau_OTL<dtf*tau_D) (See step 3, page 3 in Cao et al. 2006). |
nd |
number of single-reaction steps performed using the Direct method during otl suspension (See step 3, page 3, Cao et al. 2006). |
ignoreNegativeState |
boolean object indicating if negative state values should be ignored (this can occur in the etl method). If ignoreNegativeState=TRUE the simulation finishes gracefully when encountering a negative population size (i.e. does not throw an error). If ignoreNegativeState=FALSE the simulation stops with an error message when encountering a negative population size. |
consoleInterval |
(approximate) interval at which ssa produces simulation status output on the console (assumes verbose=TRUE ). If consoleInterval=0 console output is generated each time step (or tau-leap). If consoleInterval=Inf no console output is generated. Note, verbose=FALSE disables all console output. Console output drastically slows down simulations. |
censusInterval |
(approximate) interval between recording the state of the system. If censusInterval=0 (t,x) is recorded at each time step (or tau-leap). If censusInterval=Inf only (t0,x0) and (tf,xf) is recorded. Note, the size of the time step (or tau-leaps) ultimatelly limits the interval between subsequent recordings of the system state since the state of the system cannot be recorded at a finer time interval the size of the time steps (or tau-leaps). |
verbose |
boolean object indicating if the status of the simulation simulation should be displayed on the console. If verbose=TRUE the elapsed wall time and (t,x) is displayed on the console every consoleInterval time step and a brief summary is displayed at the end of the simulation. If verbose=FALSE the simulation runs entirely silent (overriding consoleInterval ). Verbose runs drastically slows down simulations. |
maxWallTime |
maximum wall time duration (in seconds) that the simulation is allowed to run for before terminated. This option is usefull, in particular, for systems that can end up growing uncontrollably. |
Invokes a specific method function until the termination criteria are fullfilled. Updates the state vector, time, and re-evaluates the propensity functions inbetween time steps. Also collects simulation data and returns it as a list object. This function is called from within ssa
and is not intended to be invoked stand alone.
Returns a list object with the following elements,
timeSeries |
a numerical matrix object of the simulation time series where the first column is the time vector and subsequent columns are the state frequencies. |
eval_a |
vector of the evaluated propensity functions. |
elapsedWallTime |
elapsed wall time in seconds. |
startWallTime |
start wall clock time (YYYY-mm-dd HH:MM:SS) |
endWallTime |
end wall clock time (YYYY-mm-dd HH:MM:SS). |
stepSize |
vector of step sizes (i.e. time increments). |
nSuspendedTauLeaps |
number of steps performed using the Direct method due to OTL suspension (only applicable for the OTL method). |
## Not intended to be invoked stand alone