KendallBD: Kendalls birth-and-death process

Description Usage Format Slots See Also Examples

Description

This is a simple example for a markov jump process defined as mjpModel. It is included to the package for demonstration purposes.

Usage

1

Format

An object of class mjpModel.

Slots

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.

See Also

SIRstoch for a more sophisticated example of a mjpModel and mjpModel-class for the formal description of the S4 class.

Examples

 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))

CharlotteJana/pdmpsim documentation built on July 2, 2019, 5:37 a.m.