hawkes: Simulation of a Hawkes process

Description Usage Arguments Value Examples

View source: R/hawkes.R

Description

Simulates a Hawkes process using its cluster representation:

Usage

1
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

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

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