Change point detection

Also known as: changepoint detection

On this page 7

Change point detection, also written changepoint detection, is the task of identifying the times at which the statistical behavior of a sequence changes, for example when its mean, variance, trend, frequency content or correlation structure shifts to a new regime. Anomaly detection treats it as a distinct problem from spotting isolated outliers: a change point marks a persistent transition, after which the data follows a different distribution rather than returning to normal.

Methods fall into two broad families. Offline (retrospective) detection analyzes a complete series to segment it as accurately as possible, while online (sequential) detection processes observations as they arrive and must raise an alarm quickly while keeping false alarms rare. Both appear across monitoring, finance, climate science, genomics and industrial quality control.

How change point detection works

Most methods compare the data before and after a candidate time and ask whether two segments are better explained by different models than by one. Formally, a series y₁ to yₙ is split into segments by change points τ₁ to τₖ, and each segment is assumed to follow its own distribution or parameter set.

Offline approaches usually minimize a penalized cost: the sum of a segment cost, such as the negative log-likelihood or the squared error around the segment mean, plus a penalty for each additional change point. The penalty prevents overfitting, because without it every observation could become its own segment. Common choices are the BIC penalty of about p·log n per change and data-driven calibration.

Online approaches maintain a running test statistic that grows when recent data looks inconsistent with the current regime, and they signal a change when the statistic crosses a decision threshold.

The table below lists the types of change that detectors are designed to find.

Type of changeWhat shiftsTypical example
Mean shiftAverage levelServer latency rises after a deployment
Variance changeSpread or volatilityMarket volatility jumps during a crisis
Trend changeSlope of a linear trendUser growth slows after a price change
Frequency changePeriodicity or spectrumMachine vibration gains a new harmonic
Correlation changeDependence between variablesTwo sensors stop moving together
Distribution changeOverall shape of the dataTransaction amounts become heavy-tailed
Types of change and typical examples

Main algorithms and their trade-offs

Algorithms differ in search strategy, statistical assumptions and computational cost. Classical sequential tests such as CUSUM and the Page-Hinkley test accumulate evidence of a shift and are cheap enough for streaming data. For segmentation, PELT (pruned exact linear time) finds the exact optimum of a penalized cost and runs in near-linear time under mild conditions, while binary segmentation is faster but only approximate.

Bayesian online change point detection (BOCPD) tracks a probability distribution over the current run length, the time since the last change, and outputs calibrated uncertainty. Kernel methods and neural approaches relax distributional assumptions at a higher computational price.

AlgorithmModeMain assumptionCost
CUSUMOnlineKnown pre-change and post-change modelsO(1) per point
Page-HinkleyOnlineShift in the meanO(1) per point
BOCPDOnlineConjugate model per segmentO(n) per point without pruning
Binary segmentationOfflineChanges found one at a timeO(n log n)
PELTOfflineAdditive segment cost and penaltyNear O(n) in practice
Kernel change pointOfflineChanges in a kernel feature spaceO(n²) or more
Comparison of common change point algorithms

Relation to anomaly detection and drift

Change point detection overlaps with several neighboring tasks, and confusing them leads to wrong method choices. A point anomaly is a single unusual observation; a collective anomaly is a short unusual subsequence that ends; a change point begins a lasting new regime. In machine learning operations, a closely related idea is concept drift, where the relationship between inputs and labels changes and a deployed model degrades.

PhenomenonDurationTypical response
Point anomalyOne observationInvestigate or discard the value
Collective anomalyShort, then returns to normalInspect the episode
Change pointPersistent after onsetUpdate baselines or retrain models
Gradual driftSlow continuous shiftMonitor windows and recalibrate
How change points differ from related phenomena

In practice, a forecasting-based anomaly detector often benefits from a change point detector running beside it: when a genuine level shift occurs, the forecast baseline should be reset rather than flagged indefinitely, otherwise every later point appears anomalous.

Evaluating and tuning a detector

Online detectors face a fundamental trade-off between detection delay and the false alarm rate, usually expressed as the average run length before a false alarm. Raising the threshold makes alarms rarer but slower. Offline methods are evaluated by how closely estimated change points match annotated ones within a tolerance margin, using precision, recall, the F1 score or the Hausdorff distance.

SettingIf increasedIf decreased
Penalty or thresholdFewer, more reliable change pointsMore changes, more false positives
Minimum segment lengthShort regimes are missedSpurious short segments appear
Window sizeStable estimates, slower reactionFaster reaction, noisier estimates
Tolerance marginEvaluation becomes lenientEvaluation demands exact timing
Tuning decisions and their effects

Common pitfalls in practice

Real data rarely satisfies textbook assumptions, and violated assumptions are the main source of errors.

  • Seasonality creates apparent changes every day or week unless it is removed or modeled first.
  • Autocorrelation inflates test statistics, so methods that assume independent noise report too many changes.
  • Outliers can masquerade as short segments when the cost function is not robust.
  • Default penalties tuned on one dataset seldom transfer to another with different noise levels.
  • Multivariate series need methods that model joint changes, not separate univariate tests on each variable.

Understanding it simply

Think of a heart rate monitor during a run. While you jog, the number hovers around one level. When you start sprinting, it climbs and stays higher. Change point detection finds that moment of switching. It does not care about one odd reading. It looks for the point where the whole pattern settles into something new.

Some tools study the full recording afterward and mark every switch. Others watch live and sound an alert as soon as they are fairly sure. The live version must balance speed against false alarms.

Applied in practice

An operations team monitors the 95th percentile response time of a web service, sampled every minute. Normal values sit near 180 milliseconds with a daily pattern. The team removes the daily seasonality and feeds the residuals into a CUSUM detector with a threshold calibrated for roughly one false alarm per month.

After a routine release, latency rises to about 230 milliseconds and stays there. The detector signals a change point eleven minutes after the deployment, while the existing outlier alerts stay silent because no single value looks extreme. Engineers trace the shift to a missing database index and roll back. An offline PELT analysis of the previous quarter later reveals three similar silent regressions, which leads the team to add the detector to every release pipeline.