StructuralDecompose: A Modular Framework for Robust Time Series Decomposition in R
Allen Daniel Sunny
TL;DR
The paper addresses the need for interpretable time series decomposition that remains robust to anomalies and regime shifts. It introduces StructuralDecompose, a modular four-stage pipeline that separates changepoint detection, anomaly handling, trend smoothing, and final decomposition, enabling explicit inspection at each step. The framework integrates with existing R tooling (e.g., strucchange for changepoints and LOESS for smoothing) and represents the data as $y_t = T_t + S_t + R_t$ after cleansing, providing plotting and benchmarking utilities. Empirical results on simulated and real data show competitive performance against state-of-the-art tools such as Rbeast and autostsm while enhancing interpretability and reproducibility for applications in economics, public health, and policy.
Abstract
We present StructuralDecompose, an R package for modular and interpretable time series decomposition. Unlike existing approaches that treat decomposition as a monolithic process, StructuralDecompose separates the analysis into distinct components: changepoint detection, anomaly detection, smoothing, and decomposition. This design provides flexibility and robust- ness, allowing users to tailor methods to specific time series characteristics. We demonstrate the package on simulated and real-world datasets, benchmark its performance against state-of-the- art tools such as Rbeast and autostsm, and discuss its role in interpretable machine learning workflows.
