simHawkes1: Simulate a Hawkes process, or Self-exciting point process

View source: R/simHawkes1.R

simHawkes1R Documentation

Simulate a Hawkes process, or Self-exciting point process

Description

Simulate an (inhomogeneous) self-exciting process with given background intensity and excitation/fertility function.

Usage

simHawkes1(nu=NULL, g=NULL, cens = 1,
           nuM=max(optimize(nu,c(0,cens),maximum=TRUE)$obj, nu(0), nu(cens))*1.1,
           gM=max(optimize(g,c(0,cens),maximum = TRUE)$obj, g(0),
g(cens))*1.1,
           exp.g=FALSE,gp=c(1,2))

Arguments

nu

A (vectorized) function. The baseline intensity function.

g

A (vectorized) function. The excitation function.

cens

A scalar. The censoring time, or the time of termination of observations.

nuM

A scalar. The maximum time of the baseline intensity from 0 to cens.

gM

A scalar. The maximum time of the excitation function from 0 to cens.

exp.g

A logical. Whether the excitation function g should be treated as an exponential function.

gp

A vector of two elements, giving the two parameters a and b in the exponential excitation function g(x)=a*exp(-b*x), which is used when exp.g is set to TRUE, and is ignored otherwise.

Details

The function works by simulating the birth times generation by generation according to inhomegenous Poisson processes with appropriate intensity functions (ν or g).

Value

A list of vectors of arrival/birth times of individuals/events of generations 0, 1, ... The length of the list is the total number of generations.

Author(s)

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

See Also

simHawkes0

Examples

  asepp <- simHawkes1(nu=function(x)200*(2+cos(2*pi*x)),nuM=600,
                      g=function(x)8*exp(-16*x),gM=8)

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