← ClaudeAtlas

hawkes-processeslisted

Fit and test a self-exciting point process for clustered order arrivals - exponential-kernel Hawkes intensity, Ogata thinning, maximum likelihood, the branching ratio, and the random time change that tests the fit. TRIGGER - Hawkes process, self-exciting point process, order arrival clustering, trade clustering, order flow clustering, mutually exciting, branching ratio, alpha over beta, criticality, endogeneity of market activity; Ogata thinning, simulate a point process, tick, hawkeslib, conditional intensity; Hawkes MLE, log-likelihood recursion, random time change, residual analysis, "are my arrivals Poisson", overdispersed counts, Fano factor, "my Poisson confidence interval is too narrow". SKIP for the birth-death queue model of a single price level (limit-order-book-models), for measuring realised activity from a tape (intraday-microstructure), for GARCH and volatility clustering in returns rather than arrivals (volatility-models), and for regime switching (regime-detection).
howard-lynn-ye/fin-skills · ★ 1 · AI & Automation · score 77
Install: claude install-skill howard-lynn-ye/fin-skills
# Hawkes processes **Order arrivals cluster, a Poisson model reproduces their average rate perfectly, and its standard errors are wrong by a factor you can compute in closed form.** That is the whole skill: the mean is the one statistic that cannot detect the misspecification, and everything downstream of a count inherits the error. Every number marked ✅ Measured is printed by `scripts/hawkes.py` (numpy 2.2.6 + scipy 1.13.0, seed 20260909, **about 30 s**). ✅ source-verified means it was read in **Laub, Taimre & Pollett, *Hawkes Processes*** (arXiv:1507.02822), whose notation this follows — their background rate `lambda` is written `mu` here so it is not confused with the intensity. ## 1. The model, in four formulas ✅ source-verified — Laub et al.: ``` lambda*(t) = mu + sum_{t_i < t} alpha * exp(-beta*(t - t_i)) exponential kernel n = int_0^inf alpha*exp(-beta*s) ds = alpha/beta BRANCHING RATIO mean rate = mu / (1 - n) stationary intensity stability = alpha < beta, i.e. n < 1 ``` 🔑 `n` is *"the expected number of offspring per immigrant in the immigration-birth representation"* — the fraction of activity that is triggered by earlier activity rather than arriving from outside. **`n ≥ 1` is not a large number, it is a different process**: the cascade never dies out and the count explodes. Every stationary formula below divides by `1 − n`. ✅ source-verified — **Ogata's thinning** (Laub et al. Algorithm 2):