Summary
HawkesIntensity is RTTA's streaming exponential Hawkes process intensity for
event times: a constant baseline plus a self-exciting residual that decays
exponentially between events and jumps when new events arrive.
Update API
result = rtta.HawkesIntensity(
mu=1.0, alpha=0.5, beta=1.0, fillna=True
).update(time, jump=1.0)
# result.intensity, result.excitation, result.baseline
time is a real-valued event clock (seconds, exchange timestamps, or any
monotonic scale consistent with beta). jump is the mark size of the event
(default 1.0). batch(time, jump) or batch(time) (unit jumps) return
multi-output arrays.
Theory Of Operation
A univariate exponential Hawkes process has conditional intensity
with baseline \(\mu\), excitation amplitude \(\alpha\), and decay \(\beta\). RTTA maintains the residual excitation \(A_t\) in a recursive form so each update is \(O(1)\): decay the previous excitation by \(e^{-\beta\Delta t}\), then add \(\alpha\cdot\operatorname{jump}\). Clustering of events raises intensity above baseline; quiet periods pull it back toward \(\mu\).
Recurrence
State is residual excitation \(A\) and last event time \(t_{\mathrm{last}}\). On the first event at time \(t\) with jump \(j\):
On a later event at time \(t\) with jump \(j\) and \(\Delta t = t - t_{\mathrm{last}}\):
(If time goes backward, RTTA still decays with \(\lvert\Delta t\rvert\) and applies the jump so the stream remains defined.)
Implementation Notes
The recurrence is implemented in src/rtta/indicator.cpp in
class HawkesIntensity. Parameters are floored so \(\mu,\alpha\ge 0\) and
\(\beta > 0\).
