Run CUSUM over closes
use openquant::filters::{cusum_filter_indices, Threshold};
let close = vec![100.0, 100.1, 99.9, 100.2];
let idx = cusum_filter_indices(&close, Threshold::Scalar(0.02)); Event-Driven Data and Labeling
CUSUM and z-score event filters for event-driven sampling.
Extracts informative events from noisy high-frequency sequences.
cusum_filter_indicescusum_filter_timestampsz_score_filter_indicesThreshold\[S_t=\max(0, S_{t-1}+r_t),\; trigger\;if\;|S_t|>h\]
\[z_t=\frac{x_t-\mu_t}{\sigma_t}\]
use openquant::filters::{cusum_filter_indices, Threshold};
let close = vec![100.0, 100.1, 99.9, 100.2];
let idx = cusum_filter_indices(&close, Threshold::Scalar(0.02));