gridcp: Fast Online Changepoint Detection in Python

📅 2026-08-19
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
本文解决了数据流中实时检测分布变化的问题,通过gridcp包使用网格方法和多种统计测试实现高效在线检测。
📝 Abstract
Online changepoint detection is the problem of detecting distributional changes in a data stream in real-time. A large body of methodology exists for the offline (fixed-size) setting, but applying these methods online quickly becomes infeasible since the per-observation computational cost and memory consumption typically grow at least linearly with the sample size. A recently proposed grid-based methodology (Moen, 2026) overcomes this by evaluating an offline test statistic over a sparse geometric grid of split points, with grid points spaced increasingly far apart further in the past. For a wide class of test statistics, this approach keeps update time and memory consumption growing logarithmic in the length of the data stream, while admitting finite-sample guarantees on the detection delay. Building on this methodology, we present gridcp, an open-source Python package that turns offline changepoint tests into efficient online detectors through a single, uniform interface. Users can choose from nine Numba-accelerated built-in tests, spanning changes in the mean, variance, covariance, and regression coefficients, as well as nonparametric tests and generalized likelihood-ratio tests for exponential-family models. Users can also supply their own test, which the package handles identically. For any test, gridcp provides Monte Carlo routines that calibrate the detection threshold to a target false alarm probability or average run length, including data-driven variants when no parametric null model is available. Through simulations and three real-data case studies, we show that calibration is accurate, that runtime scales favorably with both stream length and dimension, and that the complete pipeline, from calibration to deployment, runs efficiently on long real-world streams with only a short detection delay.
Problem

Research questions and friction points this paper is trying to address.

online changepoint detection
real-time
computational cost
memory consumption
Innovation

Methods, ideas, or system contributions that make the work stand out.

online changepoint detection
grid-based methodology
logarithmic complexity
Numba-accelerated tests
Monte Carlo calibration
P
Per August Jarval Moen
University of Oslo
S
Sebastian Grau Nielsen
University of Oslo
E
Espen Bjørge Urheim
University of Oslo
M
Martin Tveten
Norwegian Computing Center
I
Ingrid Kristine Glad
University of Oslo