How to detect time series change points using Python
In this article, we:
- Define what time series structural changes are and what distinguishes them from outliers.
- Overview different types of structural changes.
- Explore change point detection methods, such as CUSUM, using the kats and ruptures packages.
Introduction
Stationarity is a central concept in time series analysis and forecasting. Under stationarity, the properties of time series, such as the mean value, remain the same over time, apart from spurious fluctuations.
Yet, stationary is rarely observed in real-world datasets. Time series are amenable to structural breaks or changes. These introduce non-stationary variations into a time series, altering its distribution. The timestep that marks the onset of a change is referred to as a change point.
Detecting structural changes is valuable in time series analysis and forecasting. The emerging distribution often renders past data obsolete, and consequently, the models fit therein. This requires you to update your models using recent data or other appropriate strategy. If change points occur in historical data, you can deal with them with feature…