simPois0: Simulate a Poisson process

View source: R/simPois0.R

simPois0R Documentation

Simulate a Poisson process

Description

Simulate an (inhomogeneous) Poisson process with a given intensity/rate function over the interval [0,T]

Usage

simPois0(int, cens = 1, int.M = optimize(int, c(0, cens), maximum = TRUE)$obj * 1.1)

Arguments

int

A (vectorized) positive function. The intensity/rate function.

cens

A positive scalar. The censoring time, or time of termination of observations, T.

int.M

A positive scalar. Maximum value of the intensity function over [0,T], or a value larger than this.

Details

The function works by first generating a Poisson process with constant rate int.M oever [0,T], and then thinning the process with retention probability function

p(x)=\code{int}(x)/\code{int.M}

.

Value

A numerical vector giving the event/jump times of the Poisson process in [0,T], in ascending order.

Author(s)

Feng Chen <feng.chen@unsw.edu.au>

See Also

simPois0

Examples

  aPP <- simPois(int=function(x)200*(2+cos(2*pi*x)),cens=1,int.M=600)

IHSEP documentation built on Sept. 17, 2022, 1:05 a.m.