Skip to contents

The maximum likelihood fit of a Hawkes process with an exponential kernel (hawkes()) to event times over one or more periods of horizon years, each sorted and on [0, horizon) from an empty history (for years, each year's times and horizon = 1). The log-likelihood is maximised over the log parameters by Nelder-Mead; standard errors are from the observed information.

Usage

hawkes_fit(periods, horizon = 1)

Arguments

periods

A list of sorted numeric vectors of event times.

horizon

Length of each period, in years.

Value

A list with baseline, alpha, beta, log_likelihood, std_errors (of those three), n_events, converged, branching_ratio, aic and process, the fitted hawkes() (NULL when the branching ratio is at or above 1).

Examples

h <- hawkes(1.5, 6, 10)
years <- lapply(0:399, function(i) hawkes_simulate(h, 1, seed = 11, stream = i))
fit <- hawkes_fit(years)
c(fit$baseline, fit$alpha, fit$beta)
#> [1]  1.432542  6.184115 10.702727
fit$std_errors
#> [1] 0.07351252 0.49055967 0.90977766