RobustSTL: A Robust Seasonal-Trend Decomposition Algorithm for Long Time Series.

Qingsong Wen, Jingkun Gao, Xiaomin Song, Liang Sun, Huan Xu, Shenghuo Zhu

Abstract

Decomposing complex time series into trend, seasonality, and remainder components is an important task to facilitate time series anomaly detection and forecasting. Although numerous methods have been proposed, there are still many time series characteristics exhibiting in real-world data which are not addressed properly, including 1) ability to handle seasonality fluctuation and shift, and abrupt change in trend and reminder; 2) robustness on data with anomalies; 3) applicability on time series with long seasonality period. In the paper, we propose a novel and generic time series decomposition algorithm to address these challenges. Specifically, we extract the trend component robustly by solving a regression problem using the least absolute deviations loss with sparse regularization. Based on the extracted trend, we apply the non-local seasonal filtering to extract the seasonality component. This process is repeated until accurate decomposition is obtained. Experiments on different synthetic and real-world time series datasets demonstrate that our method outperforms existing solutions.

Introduction

Time series decomposition—breaking a signal into Trend, Seasonality, and Remainder (noise/anomalies)—is a cornerstone of forecasting and anomaly detection. However, real-world data often presents challenges that traditional tools like STL or TBATS struggle to handle. The authors identify three major gaps in existing tools: inflexibility regarding seasonal shifts, a lack of robustness against outliers which causes "ghosting" effects, and scalability issues when dealing with long seasonality periods (e.g., minute-level data with a daily cycle of 1,440 points).

RobustSTL is designed to address these "messy" realities by combining robust regression techniques with non-local filtering, ensuring accurate decomposition even in the presence of abrupt shifts and significant noise.

Methodology

RobustSTL decomposes the signal $y_t = \tau_t + s_t + r_t$ using a four-step iterative process:

  • Bilateral Filtering: Borrowing from image processing, an edge-preserving filter denoises the signal while preserving abrupt changes in trend and sharp anomaly spikes.
  • LAD-based Trend Extraction: To extract the trend ($\tau_t$), the model solves a regression problem using Least Absolute Deviations (LAD) loss instead of standard squared error. Applying $\ell_1$ norm regularization on the trend's differences allows it to capture both gradual changes and abrupt "staircase" level shifts.
  • Non-local Seasonal Filtering: This is the core innovation for handling seasonal shifts. Instead of comparing a point only to the exact same time in previous cycles, the algorithm looks at a neighborhood of points around previous cycles. It assigns weights based on similarity, allowing it to "find" the seasonal pattern even if it has shifted in time.
Conceptual diagrams of outlier robustness and season shift adaptation in RobustSTL.

Key Results

The authors evaluated RobustSTL against major baselines including STL, TBATS, and STR. On synthetic data featuring abrupt trend changes and buried anomalies, RobustSTL achieved a Mean Squared Error (MSE) for trend extraction of 0.0530, significantly outperforming Standard STL (0.9496) and TBATS (0.3150).

Qualitatively, RobustSTL maintains a clean, piecewise-linear trend that ignores spikes, whereas traditional methods often produce "wavy" trends that attempt to follow outliers. Furthermore, RobustSTL proved significantly more efficient than TBATS and STR, particularly on long-period datasets where STR failed to scale.

Decomposition results of RobustSTL on synthetic data, showing a clean trend and accurate seasonal extraction despite noise.

Conclusion

RobustSTL offers a powerful and generic solution for decomposing long-period time series with significant noise and shifts. By utilizing LAD loss and non-local filtering, it achieves superior robustness compared to traditional least-squares approaches. Future work will focus on integrating this decomposition directly with anomaly detection logic and automating hyperparameter selection for varying noise types.

Summary updated

BibTeX
@inproceedings{wen2019robuststl,
  author = {Qingsong Wen and Jingkun Gao and Xiaomin Song and Liang Sun and Huan Xu and Shenghuo Zhu},
  title = {{RobustSTL: A Robust Seasonal-Trend Decomposition Algorithm for Long Time Series.}},
  booktitle = {AAAI},
  year = {2019},
  url = {https://openreview.net/forum?id=rX0vTTWeO6S},
}
Figure