gillespied: Simulate a sample path from a stochastic kinetic model...

gillespiedR Documentation

Simulate a sample path from a stochastic kinetic model described by a stochastic Petri net

Description

This function simulates a single realisation from a discrete stochastic kinetic model described by a stochastic Petri net and discretises the output onto a regular time grid.

Usage

gillespied(N, T=100, dt=1, ...)

Arguments

N

An R list with named components representing a stochastic Petri net (SPN). Should contain N$M, a vector representing the initial marking of the net, N$Pre, a matrix representing the LHS stoichiometries, N$Post, a matrix representing the RHS stoichiometries, and N$h, a function representing the rates of the reaction processes. N$h should have first argument x, a vector representing the current state of the system, and second argument t, a scalar representing the current simulation time (in the typical time-homogeneous case, N$h will ignore this argument). N$h may posses additional arguments, representing reaction rates, for example.

T

The required length of simulation time. Defaults to 100 time units.

dt

The grid size for the output. Note that this parameter simply determines the volume of output. It has no bearing on the correctness of the simulation algorithm. Defaults to one time unit.

...

Additional arguments will be passed into the function N$h.

Value

An R ts object containing the simulated realisation of the process.

See Also

simpleEuler, rdiff, discretise, gillespie, StepGillespie

Examples

# load LV model
data(spnModels)
# simulate and plot a realisation
plot(gillespied(LV,T=100,dt=0.01))

smfsb documentation built on Jan. 13, 2024, 3:02 a.m.