Abstract
The Rlgt package implements a suite of Global Trend models for time series forecasting, representing Bayesian generalizations and extensions of traditional Exponential Smoothing (ETS) models. Key innovations include nonlinear global trends, Student-t error distributions for robustness, and heteroscedastic error modeling. These methods are particularly effective for short time series and have demonstrated superior performance against classical algorithms on the M3 competition dataset. Models are implemented using Markov Chain Monte Carlo (MCMC) via the rstan package.
Introduction
Time series forecasting has long been dominated by classical methods such as ARIMA and Exponential Smoothing (ETS). While these frameworks are robust, they often struggle with real-world data characteristics such as extreme outliers, changing variance over time (heteroscedasticity), and complex, non-linear long-term trends. Standard models typically assume Gaussian error distributions, which can lead to poor performance when "black swan" events occur.
The Rlgt package addresses these challenges by transitioning ETS models into a Bayesian framework. By utilizing MCMC sampling, Rlgt provides full posterior distributions for forecasts, offering a more nuanced understanding of uncertainty compared to traditional point estimates.
Methodology
The core of the Rlgt framework consists of the Local and Global Trend (LGT) model and its seasonal variants, SGT and S2GT. These models incorporate several critical enhancements:
- Nonlinear Global Trend: By adding a global trend component to the local trend, the model captures long-term trajectories that deviate from simple linear or damped patterns.
- Student-t Error Distribution: The use of a Student-t distribution provides "heavy tails," making the model naturally resilient to outliers that would otherwise skew a Gaussian-based model.
- Adaptive Error Size: Heteroscedasticity is handled by modeling error size as a function of the current level, allowing uncertainty to scale with the magnitude of the data.
As shown in the parameter definitions, the model fitting process allows for explicit control over MCMC sampling (e.g., n.samples, burnin) and supports parallel execution to mitigate the computational overhead inherent in Bayesian methods.
Datasets and Evaluation
The efficacy of the Rlgt package has been validated using several benchmark and real-world datasets:
- M3 Competition Dataset: A standard benchmark where
Rlgtmodels outperformed all original classical participants. - iclaims.example: This dataset combines economic indicators with search engine data to provide a complex forecasting challenge.
- umcsent.example: Monthly consumer sentiment scores paired with Google Trends data.
- Lynx: A classic dataset of Canadian lynx trappings used for demonstrating non-seasonal model performance.
Key Insights
A primary advantage of the Rlgt approach is its performance on short time series. Bayesian methods allow for the incorporation of prior knowledge, which stabilizes forecasts when data is sparse—a common failure point for deep learning or complex ARIMA models. Furthermore, by decomposing trends into local momentum and global trajectories, the model avoids overreacting to short-term noise while maintaining the integrity of the long-term path.
Results and Discussion
Empirical results from the M3 competition highlight the package's strength, with LGT and SGT models consistently outperforming classical algorithms. Beyond point accuracy, the Bayesian nature of the models ensures high-quality probabilistic coverage. Prediction intervals generated by the package have been shown to align closely with theoretical targets in test scenarios.
However, the computational intensity of MCMC remains a limitation. Fitting these models is significantly slower than traditional ETS, making them less suitable for high-frequency, large-scale automated forecasting systems without significant hardware resources. Additionally, the introduction of hyperparameters like power coefficients requires a degree of statistical expertise for optimal tuning in specialized use cases.
Conclusion
Rlgt represents a significant step forward in making robust Bayesian forecasting accessible to the R community. By integrating nonlinear trends and adaptive error structures, it provides a flexible toolset for tackling the complexities of modern time series data, particularly when robustness and uncertainty quantification are paramount.
Summary updated