Abstract
Traditional trend filtering methods often struggle with non-stationary time series, frequently smoothing out critical abrupt changes as noise. We present DTF-net, a reinforcement learning-based framework that treats trend filtering as a dynamic point detection problem. By identifying "Dynamic Trend Points" (DTPs) and optimizing their selection via a forecasting-based reward, DTF-net adaptively preserves significant transitions while filtering out stochastic noise. Experimental results on synthetic and real-world datasets demonstrate that DTF-net significantly outperforms traditional filters and improves downstream forecasting accuracy.
Introduction
Trend filtering is fundamental to time series analysis, simplifying complex signals for forecasting or anomaly detection. However, standard techniques like the Hodrick-Prescott (HP) or $\ell_1$ filters rely on global smoothness assumptions. These methods typically assume data follows a light-tailed Gaussian distribution, which fails to account for the "heavy tails" and abrupt slope transitions common in real-world data. Consequently, traditional filters often "round off" these sharp transitions, treating them as outliers and losing vital information about the trend's future direction.
Methodology: The DTF-net Framework
DTF-net (Dynamic Trend Filtering network) reframes trend filtering as a Markov Decision Process (MDP). Instead of global curve fitting, the model identifies a subset of observations, termed Dynamic Trend Points (DTPs), that constitute the trend's "skeleton."
Trend Point Detection
An RL agent moves sequentially through the time series. At each time step, it takes one of two actions:
- Action 1: The point is marked as a DTP, ensuring it is reflected in the final trend.
- Action 0: The point is treated as noise and replaced by interpolation between adjacent DTPs.
This binary decision process allows for non-uniform filtering, where the model can apply heavy smoothing to stable periods and high sensitivity to volatile ones.
RL Environment and Forecasting Reward
The agent's objective is to maximize a reward based on Time Series Forecasting (TSF) performance. The environment extracts a trend $T$ from the selected DTPs and uses it as input for a forecasting model $\phi$.
The reward $R_t$ is defined as the negative Mean Squared Error (MSE) of the forecast: $R_t = -||y - \hat{y}||_2$. By tying the reward to predictive accuracy, the agent is incentivized to capture the underlying temporal dependencies that define the future trend. To prevent overfitting, the authors employ random sampling for state representation and reward calculation.
Experimental Results
DTF-net was evaluated against traditional $\ell_1$ filtering and specialized Change Point Detection (CPD) methods.
- Synthetic Benchmarks: On a signal with 11 abrupt changes and Gaussian noise, DTF-net achieved an MSE of 0.0289, outperforming $\ell_1$ filtering (0.0461) and the ADAGA CPD method (4.3434).
- Real-World Forecasting: When used as a pre-processing step for state-of-the-art models like NLinear and DLinear, DTF-net improved performance across several non-stationary datasets. For the Exchange Rate dataset, DTF-net achieved the best results for all look-ahead horizons (24 to 720 steps).
- Qualitative Analysis: Visualizations on Nasdaq intraday data show that DTF-net successfully identifies sharp turns that $\ell_1$ filters either over-smooth or over-fit, depending on their hyperparameter settings.
Conclusion
By leveraging reinforcement learning to detect key trend points, DTF-net provides a flexible and adaptive approach to trend filtering. It successfully bridges the gap between noise reduction and feature preservation, offering significant improvements for downstream forecasting tasks in non-stationary environments. Future work may explore higher-order interpolation methods to further enhance the smoothness of the extracted trends.
Summary updated