Learn R Programming

hawkesbow (version 1.0.3)

hawkes_ogata: Simulation of a Hawkes process

Description

Simulates a Hawkes process via Ogata's modified thinning algorithm on \([0,\mathrm{end}]\). This is less efficient than function hawkes, but can be useful for pedagogical reasons.

Usage

hawkes_ogata(end, lambda, alpha, beta, lambda0 = NULL)

Value

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

Arguments

end

Right bound on time.

lambda

Baseline intensity.

alpha

Parameter for the amplitude of the spike.

beta

Parameter for the speed of exponential decay.

lambda0

(Optional) Initial value of the conditional intensity.

Examples

Run this code
# Simulate an exponential Hawkes process with baseline intensity 1 and
# excitation function 1*exp(-2t)
x <- hawkes_ogata(10, 1, 1, 2)
plot(x)

Run the code above in your browser using DataLab