hawkes: Simulation of a Hawkes process

View source: R/hawkes.R

hawkesR Documentation

Simulation of a Hawkes process

Description

Simulates a Hawkes process using its cluster representation:

  • First, the immigrants are drawn according to an (inhomogeneous) Poisson process with intensity measure fun.

  • Second, the number of offsprings of an immigrant follows a Poisson distribution with intensity repr.

  • Third, these offsprings are distributed according to the family distribution.

  • Then, generate further offsprings according to the last two steps.

Usage

hawkes(end, fun, repr, family, 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 immigrant process.

repr

A non-negative numeric value - mean number of offsprings.

family

A character string "name" naming a distribution with corresponding random generation function rname, or directly the random generation function.

M

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

...

Additional arguments passed on to the random generation function.

Value

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

Examples

# Simulate an exponential Hawkes process with baseline intensity 1,
# reproduction mean 0.5 and exponential fertility function with rate 2.
x <- hawkes(10, fun=1, repr=0.5, family="exp", rate=2)
# Simulate a Hawkes process with baseline intensity function 1 + sin(x),
# reproduction mean 0.5 and custom [0,1]-triangular fertility function.
x <- hawkes(10, fun=function(y) {1+sin(y)}, M=2, repr=0.5,
            family=function(n) {1 - sqrt(1 - runif(n))})

fcheysson/hawkesbow documentation built on Jan. 26, 2024, 9:30 p.m.