| mjpModel-class | R Documentation |
An S4 class to represent a Markov jump
process (MJP).
This class is based on the simecol Package and provides a possibility
to simulate Markov jump processes.
mjpModel(
obj = NULL,
descr = character(0),
jumpfunc = function(t, x, parms, jtype) x,
ratefunc = function(t, x, parms) c(0),
times = c(from = 0, to = 10, by = 1),
init = c(0, 0),
parms = c(0),
out = NULL,
solver = "Gdirect",
initfunc = NULL
)
obj |
pdmpModel object that is being built. |
descr |
a string containing a short description of the model. This parameter is optional and only used in plot methods. |
jumpfunc |
a |
ratefunc |
a |
times |
vector of time steps or vector with three named values "from", "to", "by" specifying the simulation time steps. The from-to-by can be edited with fixParms. |
init |
initial state of the simulation. This is a named vector giving the names of all variables and their start value. |
parms |
a list with constant model parameters. |
out |
NULL or an object of class deSolve. If a simulation is done with
method |
solver |
a function or a character string specifying the numerical algorithm used.At the moment it is ignored since only the "direct" algorithm of Gillespie ("Gdirect") is implemented. |
initfunc |
this parameter can hold an optional function which has a
pdmpModel as only parameter and returnes a (modified) pdmp.
This function is called automatically when a new object is created by
|
descra string containing a short description of the model. This slot is optional and only used in plot methods.
parmsa list with constant model parameters.
timesvector of time steps or vector with three named values "from", "to", "by" specifying the simulation time steps. The from-to-by can be edited with fixParms.
initinitial state of the simulation. This is a named vector giving the names of all variables and their start value.
ratefunca function(t, x, parms) that returns a vector with
transition rates from the actual state to another state. Only non zero rates
are given. The length of the returned vector determines the number of
different jumptypes.
jumpfunca function(t, x, parms, jtype) that returns the next
state the process will jump to. This state depends on parameter
jtype. The number of possible jtypes is determined by function
ratefunc. The value for jtype will be chosen randomly during
simulation, depending ot the rates given in ratefunc.
solvera function or a character string specifying the numerical algorithm used. At the moment it is ignored since only the direct algorithm of Gillespie ("Gdirect") [Gil77] is implemented.
initfuncthis slot can hold an optional function which has a mjpModel
as only parameter and returnes an object of class mjpModel.
This function is called automatically when a new object is created by
new or when it is reinitialized by initialize(obj)
or before starting a simulation with sim(obj, initialize = TRUE).
outNULL or an object of class deSolve. If a simulation is done with
method sim, the result will be stored in this slot.
\,[Gil77] | Gillespie, Daniel T. (1977). "Exact Stochastic Simulation of Coupled Chemical Reactions". |
| The Journal of Physical Chemistry 81 (25): 2340–2361. doi:10.1021/j100540a008. | |
See SIRstoch and KendallBD for two examples
that have a detailed documentation explaining every slot.
Class mjpModel provides a method sim for simulation,
mjpModel-accessors{accessor functions} (with names identical to the
slot names) to get or set model parameters, time steps, initial values, the
vectorfields, the transition rates and the solver.
See multSim and multSimCsv to perform multiple
simulations for a mjpModel.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.