[Paper Review] The gmwm R package: a comprehensive tool for time series analysis from state-space models to robustness
The gmwm R package introduces a computationally efficient and robust framework for time series analysis based on the Generalized Method of Wavelet Moments (GMWM), leveraging wavelet variance to estimate ARMA and linear state-space models. It enables fast, stable, and robust parameter estimation—even for large datasets—outperforming traditional MLE and indirect inference methods in speed and scalability.
The gmwm R package for inference on time series models is mainly based on the quantity called wavelet variance which is derived from a wavelet decomposition of a time series. This quantity provides a means to summarize and graphically represent the features of time series in order to identify possible models. Moreover, it is used as a moment condition for model estimation through the generalized method of wavelet moments. Based on the latter method, this package not only provides an alternative method to estimate classical ARMA models but also delivers a general framework for the robust estimation of many time series models as well as a quick and efficient estimation of many linear state-space models.
Motivation & Objective
- Address the lack of user-friendly, computationally efficient, and robust tools for estimating time series models in R.
- Provide a unified framework for estimating classical ARMA and linear state-space models with improved numerical stability.
- Enable robust inference for time series models, particularly in the presence of outliers or non-Gaussian errors.
- Enhance computational efficiency for large-scale time series analysis, supporting datasets up to 10 million observations.
- Introduce a model selection procedure based on the Wavelet Information Criterion (WIC) for optimal model identification.
Proposed method
- Utilizes wavelet variance (WV) as a summary statistic derived from the discrete wavelet transform of a time series to decompose variance across scales.
- Employs the Generalized Method of Wavelet Moments (GMWM) as a minimum distance estimator using WV as moment conditions for parameter estimation.
- Applies robust estimation via the Robust GMWM (RGMWM) to handle outliers and non-Gaussian innovations in time series models.
- Integrates efficient C++ implementations via Rcpp and Armadillo to accelerate computation of wavelet variance and model estimation.
- Supports both univariate and latent model structures, including sums of AR(1) processes and white noise.
- Incorporates the Wavelet Information Criterion (WIC) for model selection, balancing goodness-of-fit and model complexity.
Experimental results
Research questions
- RQ1How can wavelet variance be effectively used as a moment condition for robust and efficient estimation of time series models?
- RQ2To what extent does the GMWM framework improve computational efficiency compared to traditional maximum likelihood estimation for large time series?
- RQ3Can the RGMWM estimator maintain numerical stability and accuracy under contamination or non-Gaussian errors in time series data?
- RQ4How does the performance of the gmwm package compare to existing R packages in terms of speed and scalability on large datasets?
- RQ5What is the effectiveness of the Wavelet Information Criterion (WIC) in selecting the correct model structure among competing time series models?
Key findings
- The wvar() function in the gmwm package computes wavelet variance up to 4 times faster than the waveslim package, reducing computation time from 0.7432 seconds to 0.3575 seconds for a sample size of 1,000,000.
- The RGMWM estimator remains computationally feasible for large samples, estimating a latent model in under 2.5 minutes for 10 million observations, while alternative methods like KUNSCH exceed the 6-hour time limit at sample sizes above 100,000.
- The GMWM and RGMWM estimators achieve median computation times under 1 second for sample sizes up to 100,000, significantly outperforming MLE and indirect inference methods.
- The robust estimation in gmwm increases computation time by a factor of ~10 for large samples (e.g., 9.67 seconds for 1M observations), but remains practical and scalable.
- The package enables fast and stable estimation of complex latent models, such as the sum of two AR(1) processes and white noise, with minimal user effort.
- The integration of C++ via Rcpp and Armadillo boosts performance by 1.5 to 4 times, demonstrating the value of low-level optimization in statistical R packages.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.