| KendallBD | R Documentation |
This is a simple example for a markov jump process
defined as mjpModel. It is included to the package for
demonstration purposes.
KendallBD
An object of class mjpModel.
parmsbirth and death rate.
initThere is one integer variable N with initial value 1.
jumpfuncThere are two jumptypes. Births jump from N to
N + 1, deaths from N to N - 1.
ratefuncA vector of length two determining the probability of a jump being a birth or a death.
timesThe 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.
## 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.