KendallBD: Kendalls birth-and-death process

KendallBDR Documentation

Kendalls birth-and-death process

Description

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

Usage

KendallBD

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

## 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 Oct. 21, 2024, 4:54 p.m.