Hawkes Process¶
Algorithm description¶
A Hawkes process is a self-exciting point process: past events increase the probability of future events. In its multivariate form, events in one stream can excite other streams, making it well-suited to modelling the mutual dependence between bid and offer order flows in a limit order book.
The conditional intensity (instantaneous event rate) for process \(k\) at time \(t\):
where: - \(\mu^k > 0\) is the background (baseline) rate for stream \(k\). - \(\phi^{kj}(\cdot) \geq 0\) is the excitation kernel: how a past event in stream \(j\) affects stream \(k\). - The sum runs over all past event times \(t_i^j\) in stream \(j\).
Kernel choices¶
| Kernel | Form | Notes |
|---|---|---|
| Exponential | \(\alpha e^{-\beta t}\) | Simple; fast decay; closed-form likelihood |
| Sum of Exponentials | \(\sum_m \alpha_m e^{-\beta_m t}\) | Multi-scale memory; best in forecasting-high-frequency-ofi |
| Power law | \(\alpha (t + c)^{-p}\) | Slower decay; models long memory |
| Non-parametric | Estimated from data | Flexible but harder to fit |
Stability condition¶
The process is stationary (doesn't explode) if and only if the spectral radius of the branching matrix \(\|\int_0^\infty \Phi(t)\,dt\|_2 < 1\), where \(\Phi_{kj} = \int_0^\infty \phi^{kj}(t)\,dt\).
Fitting¶
Maximum likelihood estimation (MLE). The log-likelihood for a realisation on \([0, T]\):
Optimised by gradient descent or EM algorithms. For Sum of Exponentials kernels, the integral \(\int \lambda^k(t)\,dt\) has an efficient recursive form.
Computational complexity¶
- Fitting: \(O(n^2)\) naively; \(O(n)\) with recursive likelihood for exponential kernels.
- Simulation: \(O(n \log n)\) via thinning algorithm.
Applications in this wiki¶
| Paper | Use |
|---|---|
| forecasting-high-frequency-ofi | Model bid/offer order flow; forecast OFI distribution |
| order-flow-filtration | Measure Hawkes excitation between OBI and return regimes |
When to use / when not to use¶
Use when: - Modelling arrival processes where past events cluster future events (order flow, earthquakes, social media cascades). - You need a causal, interpretable model (not a black box). - Distributional forecasts of arrival counts matter (not just point estimates).
Avoid when: - Events are approximately independent (Poisson suffices). - Very non-stationary environments (e.g., intraday seasonality requires careful handling).
Implementations¶
- tick (Python):
tick.hawkes - PtProcess (R)
- hawkeslib (Python)
- Custom MLE in PyTorch/JAX for differentiable fitting.
Connections¶
- Applied to order-flow-imbalance modelling in forecasting-high-frequency-ofi.
- Used as diagnostic in order-flow-filtration.
- Related to market-microstructure — captures the self-exciting, mutually triggering nature of order flow.