sim_hawkes: Simulate a self-exciting Hawkes process

View source: R/sim_hawkes.r

sim_hawkesR Documentation

Simulate a self-exciting Hawkes process

Description

Simulates a self-exciting Hawkes process.

Usage

sim_hawkes(mu, alpha, beta, n = 100, plot = FALSE, seed = 123, method = "1")

Arguments

mu

A numeric specifying base rate of the Hawkes process.

alpha

A numeric specifying intensity jump after an event occurrence.

beta

A numeric specifying exponential intensity decay

n

A numeric depending on method: if method = "1" specifies end of the time line within which to simulate the process, if method = "2" specifies the number of observations to simulate. Default, 100.

plot

Logical, if TRUE data plotted along with the intensity. Default, FALSE.

seed

The seed. Default, 123

method

A character "1" or "2" specifying the method (see details) to simulate Hawkes process. Default,"1".

Details

Option of two methods to simulate a Hawkes process: if method = "1" then a univariate Hawkes process as hawkes::simulateHawkes() is simulated, if method = "2" then an accept/reject framework is used.

Value

A numeric vector of simulated event times.

See Also

fit_hawkes

Examples

sim_hawkes(10.2, 3.1, 8.9)
sim_hawkes(10.2, 3.1, 8.9, method = "2")


cmjt/stelfi documentation built on Oct. 25, 2023, 2:53 p.m.