Learn R Programming

hawkesbow (version 1.0.3)

inhpois: Simulation of an inhomogeneous Poisson process by thinning

Description

Simulates an inhomogeneous Poisson process via Ogata's modified thinning algorithm on \([0,\mathrm{end}]\). An homogeneous Poisson process with intensity M is first generated on \([0,\mathrm{end}]\), then thinned using the specified intensity function fun.

Usage

inhpois(end, fun, M = NULL)

Value

A S3 object of class inhpois containing a vector ($p) of simulated values, and all other objects used for the simulation.

Arguments

end

A non-negative numeric value - right bound of the interval \([0,\mathrm{end}]\).

fun

A non-negative function or numeric value - intensity (function) of the Poisson process.

M

(default = NULL) A non-negative numeric value - upper bound on fun (ignored if fun is a numeric value).

Examples

Run this code
# Simulate an inhomogeneous Poisson process with function intensity 1 + sin(x) (bounded by 2)
x <- inhpois(end=10, fun=function(y) {1 + sin(y)}, M=2)
# Simulate a homogeneous Poisson process with intensity 3
x <- inhpois(end=10, fun=3)

Run the code above in your browser using DataLab