stats/change_point_cusum_utils library

Two-sided CUSUM change-point detection (roadmap #568).

CUSUM (cumulative sum) accumulates deviations of each sample from a reference level and flags a change when the running sum crosses a threshold. It detects sustained shifts in the mean far earlier than comparing raw values, because small persistent deviations add up.

Functions

cusumChangePoints(List<num> series, {required double threshold, double drift = 0}) List<int>
Detect indices where the series mean shifts, via a two-sided CUSUM scan.