inhpois: Simulation of an inhomogeneous Poisson process by thinning

Description Usage Arguments Value Examples

View source: R/hawkes.R

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

1
inhpois(end, fun, M = NULL)

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

Value

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

Examples

1
2
3
4
# 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)

hawkesbow documentation built on April 10, 2021, 1:07 a.m.