Summary
PageHinkley is RTTA's streaming implementation of: Causal Page-Hinkley mean-shift event detector with directed up/down output.
Update API
result = rtta.PageHinkley(threshold=1.0, delta=0.0).update(close)
The update(...) call consumes one observation using close. advance(...)
uses the same inputs when the caller wants to update state without materializing
a Python return value.
Theory Of Operation
PageHinkley tracks cumulative positive and negative deviations from an online mean after subtracting a small drift allowance. A signal fires when one cumulative excursion rises far enough above its own running minimum; the detector then resets to the current close.
Recurrence
Let \(z_t = close_t\) denote the observation consumed by one
update(...) call and let \(\theta\) denote constructor parameters such as
window lengths, thresholds, and smoothing constants.
After a nonzero signal the C++ implementation resets the running mean and cumulative sums to the current close.
The return value is the current scalar indicator value.
Implementation Notes
The recurrence is implemented in src/rtta/indicator.cpp in class PageHinkley.
