Learn R Programming

gmwmx2 Overview

The gmwmx2 R package implements the Generalized Method of Wavelet Moments with Exogenous Inputs estimator (GMWMX) presented in Voirol, L., Xu, H., Zhang, Y., Insolia, L., Molinari, R. and Guerrier, S. (2024). The GMWMX estimator is a computationally efficient estimator to estimate large scale regression problems with dependent errors in presence of missing data. The gmwmx2 R package allows to estimate (i) functional/structural parameters, (ii) stochastic parameters describing the dependence structure and (iii) nuisance parameters of the missingness process of large regression models with dependent observations and missing data. To illustrate the capability of the GMWMX estimator, the gmwmx2 R package provides functions to download an plot Global Navigation Satellite System (GNSS) position time series from the Nevada Geodetic Laboratory and allow to estimate linear model with a specific dependence structure modeled by composite stochastic processes, allowing to estimate tectonic velocities and crustal uplift from GNSS position time series. The package also provides an implementation of the Generalized Method of Wavelet Moments (GMWM) estimator proposed in Guerrier, S., Skaloud, J., Stebler, Y., Victoria-Feser, M.-P., (2013). Find vignettes with detailed examples as well as the user's manual at the package website.

Below are instructions on how to install and make use of the gmwmx2 package.

Installation Instructions

The gmwmx2 package is available on both CRAN and GitHub. The CRAN version is considered stable while the GitHub version is subject to modifications/updates which may lead to installation problems or broken functions. You can install the stable version of the gmwmx2 package with:

install.packages("gmwmx2")

For users who are interested in having the latest developments, the GitHub version is ideal although more dependencies are required to run a stable version of the package. Most importantly, users must have a (C++) compiler installed on their machine that is compatible with R (e.g. Clang).

# Install dependencies
install.packages(c("devtools"))

# Install/Update the package from GitHub
devtools::install_github("SMAC-Group/gmwmx2")

# Install the package with Vignettes/User Guides 
devtools::install_github("SMAC-Group/gmwmx2", build_vignettes = TRUE)

External R libraries

The gmwmx2 package relies on a limited number of external libraries, but notably on Rcpp and RcppArmadillo which require a C++ compiler for installation, such as for example gcc.

Note on gmwmx2 vs gmwmx

The original gmwmx package was designed to compare estimated parameters obtained from the GMWMX with the ones obtained with the Maximum Likelihood Estimator (MLE) implemented in Hector. This allowed for the replication of examples and simulations discussed in Cucci, D. A., Voirol, L., Kermarrec, G., Montillet, J. P., and Guerrier, S. (2022). However, as we advanced in the methodological and computational development of the GMWMX method, we sought a standalone implementation that did not include Hector. Additionally, many of the new computational techniques and structural improvements would have been challenging to incorporate into the previous gmwmx package. Therefore, we will now exclusively support and develop the gmwmx2 package.

Upcoming features

The gmwmx2 package is currently in the early stages of development. While the supported features are stable, we have numerous additional methods and computational enhancements planned for gradual integration. These include:

  • Computational optimization to improve speed
  • Support for a wider range of stochastic models to describe the error term
  • Support for a wider range of stochastic models to describe the missingness process
  • A computationally efficient model selection criterion for stochastic models

License

This source code is released under is the GNU AFFERO GENERAL PUBLIC LICENSE (AGPL) v3.0.

References

Voirol, L., Xu, H., Zhang, Y., Insolia, L., Molinari, R., and Guerrier, S. (2024). Inference for Large Scale Regression Models with Dependent Errors. doi:10.48550/arXiv.2409.05160.

Guerrier, S., Skaloud, J., Stebler, Y. and Victoria-Feser, M.P., 2013. Wavelet-variance-based estimation for composite stochastic processes. Journal of the American Statistical Association, 108(503), pp.1021-1030. doi:10.1080/01621459.2013.799920

Copy Link

Version

Install

install.packages('gmwmx2')

Monthly Downloads

503

Version

0.0.5

License

AGPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Lionel Voirol

Last Published

June 10th, 2026

Functions in gmwmx2 (0.0.5)

prepare_optim_layout

Prepare optimization layout for a model
loss_fn_gmwmx_with_missing

Loss function for GMWMX with missing value
theta_to_domain

Convert optimization parameters to domain parameters
pl

Stationary Power-Law process (time_series_model)
+.sum_model

Add to a sum_model object
+.time_series_model

Add to a time_series_model object
gmwmx2_new_with_missing

GMWMX estimator with missing
gmwmx2_plot_colors

Plot colors for generated time series
trans_alpha_matern

Transform Matérn alpha from real line to domain
plot.gmwmx2_fit_gnss_ts_ngl

Plot a gmwmx2_fit_gnss_ts_ngl object
trans_from_real_to_minus_1_and_1

Transform power-law kappa from real line to domain
wn

White noise process (time_series_model)
markov_two_states

Markov two-state missingness model (missingness_model)
plot.gnss_ts_ngl

Plot a gnss_ts_ngl object
print.gmwmx2_fit_gnss_ts_ngl

Print method for a gmwmx2_fit_gnss_ts_ngl object
print.gmwm2_fit

Print method for a gmwm2_fit object
print.gmwmx2_fit

Print method for a gmwmx2_fit object
gmwm2

GMWM estimator
get_variance_covariance_matrix_model

Variance-covariance matrix implied by a model
plot.generated_composite_model_time_series

Plot a generated_composite_model_time_series object
loss_fn_gmwm

Loss function for GMWM optimization (internal)
loss_fn_gmwmx_no_missing

Loss function for GMWMX without missing value
plot.generated_missingness

Plot a generated_missingness object
inv_trans_from_real_to_minus_1_and_1

Inverse transform for power-law kappa
plot.generated_time_series

Plot a generated_time_series object
inv_trans_alpha_matern

Inverse transform for Matérn alpha
rw

Random walk process (time_series_model)
plot.gmwm2_fit

Plot method for a gmwm2_fit object
sum_model

Sum of stochastic models (internal)
as_model_list

Coerce to a list of models
.comp_prefix

Component name prefix for summed models
df_estimated_velocities_gmwmx

Estimated northward and eastward velocity and their standard deviation using the GMWMX estimator
ar1

AR(1) process (time_series_model)
download_station_ngl

Download GNSS position time series and steps reference from the Nevada Geodetic Laboratory with IGS14 or IGS20 reference frame.
flicker

Flicker noise process (time_series_model)
gmwmx2

GMWMX estimator
fill_missing_parameters

Fill missing model parameters using initial-parameter functions
Ma

Matern autocovariance
format_model_text

Format model text
gmwmx2_new_no_missing

GMWMX estimator
get_autocovariance

Compute autocovariance for a model (internal)
.gmwmx2_get_plot_colors

Get plot colors for generated time series
get_theoretical_wv

Theoretical wavelet variance from model parameters
download_all_stations_ngl

Download all stations name and location from the Nevada Geodetic Laboratory
download_estimated_velocities_ngl

Download estimated velocities using the MIDAS estimator provided by the Nevada Geodetic Laboratory for all stations.
generate

Generate a time series from a time_series_model or sum_model object
matern

Matern process (time_series_model)
format_params

Format parameter display