Description Usage Format Slots See Also Examples
This is a simple example for a markov jump process
defined as mjpModel
. It is included to the package for
demonstration purposes.
1 |
An object of class mjpModel
.
parms
birth and death rate.
init
There is one integer variable N
with initial value 1.
jumpfunc
There are two jumptypes. Births jump from N
to
N + 1
, deaths from N
to N - 1
.
ratefunc
A vector of length two determining the probability of a jump being a birth or a death.
times
The simulations will start at time t = 0
and end at
t = 10
with step length 0.01.
SIRstoch
for a more sophisticated example of a
mjpModel
and mjpModel-class
for the formal description of the S4 class.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## the code used to generate this model:
KendallBD <- mjpModel(
descr = "Kendall's birth-death process",
init = c(N=10),
times = c(from = 0, to = 10, by = 0.01),
ratefunc = function(t, x, parms) parms[1:2]*x,
jumpfunc = function(t, x, parms, jtype){
x+switch(jtype,1,-1)
},
parms=c(b=1,d=1))
## load it and plot a simulation:
data("KendallBD")
plot(sim(KendallBD))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.