In a Hawkes process every event raises the event rate: the intensity is λ(t) = γ + Σ β e−(t − tk)/τ over past events tk. Each event has on average n = βτ direct offspring. If n < 1 the bursts die out and the long-run rate is γ/(1 − n); if n ≥ 1 the process explodes. The top panel shows the intensity and the events; the bottom panel the running count against its exact expectation.
Simulation by Ogata's thinning: between events the intensity only decays, so its current value bounds it until the next event; draw an exponential waiting time at that rate and accept the candidate with probability (intensity there)/(bound). The log-likelihood is Σ log λ(ti) − ∫0T λ, evaluated at the true parameters by an O(N) recursion. Simulation stops at 50,000 events.
code/ch31_nonparametric_bayes.py (hawkes_mulberry, hawkes_loglik, hawkes_expected_count, Figure S31.12).