README (original) (raw)
gmwmx Overview
The gmwmx R package implement the Generalized Method of Wavelet Moments with Exogenous Inputs estimator (GMWMX) introduced in Cucci, D. A., Voirol, L., Kermarrec, G., Montillet, J. P., and Guerrier, S. (2022) and provides functions to estimate times series models that can be expressed as linear models with correlated residuals. Moreover, thegmwmx package provides tools to compare and analyze estimated models and methods to easily compare results with the Maximum Likelihood Estimator (MLE) implemented in Hector, allowing to replicate the examples and simulations considered in Cucci, D. A., Voirol, L., Kermarrec, G., Montillet, J. P., and Guerrier, S. (2022). In particular, this package implements a statistical inference framework for the functional and stochastic parameters of models such as those used to model Global Navigation Satellite System (GNSS) observations, enabling the comparison of the proposed method to the standard MLE estimates implemented in Hector.
Find the package vignettes and user’s manual at the package website.
Below are instructions on how to install and make use of thegmwmx package.
Installation Instructions
The gmwmx 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 thegmwmx package with:
install.packages("gmwmx")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, usersmust 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/gmwmx")
# Install the package with Vignettes/User Guides
devtools::install_github("SMAC-Group/gmwmx", build_vignettes = TRUE)External dependencies
Hector
In order to runs successfully functions that executeHector, we assume that Hector is installed and available in the PATH of the installation where these functions are called. More precisely, when running eitherestimate_hector(), remove_outliers_hector(),PBO_get_station() or PBO_get_offsets(), we assume that Hector’s binaries executableestimatetrend, removeoutliers anddate2mjd are located in a folder available in thePATH by R.
In order to make sure that these functions are available in thePATH, you can run Sys.getenv("PATH") and ensure that the directory that contains the executable binaries ofHector is listed in the PATH.
For Linux users that are on distributions supported byHector, this can be easily done by:
- Downloading
Hector’s binaries for the corresponding OShere. - Extracting the downloaded executable binaries and saving them in a folder, say
$HOME/app/hector/bin. - Adding this folder to the system-wide
PATHenvironment variable by modifying/etc/environment. - Ensuring that the corresponding folder is accessible by
RwithSys.getenv("PATH")after running the script and reassigning the newPATHto thePATHenvironment variable with. /etc/environmentor equivalently withsource /etc/environment.
> Sys.getenv("PATH")
[1] "$HOME/app/hector/bin:..."
Some users have reported that the procedure described above did not work on their installation and that even after completing these steps, the path containing the executable binaries of Hector was not accessible to the PATH recognized by R. In this case, a strategy that seems to work is to directly indicate the path where Hector is located by executing the following command before executing a function that runs Hector:
Sys.setenv(PATH = "$HOME/app/hector/bin") where "$HOME/app/hector/bin" is the path where are located Hector’s binaries.
External R libraries
The gmwmx package relies on a limited number of external libraries, but notably on Rcpp andRcppArmadillo which require a C++ compiler for installation, such as for example gcc.
Usage from aMATLAB environment
It is possible to execute functions from the gmwmx R package directly from a MATLAB environment and to save estimated models in the MATLAB environment thanks to Rcall. Rcall is an interface which runs in MATLAB and provides direct access to methods and software packages implemented in R. Refer to issue #1 for the detailed procedure and to the official Rcallproject for support.
License
This source code is released under is the GNU AFFERO GENERAL PUBLIC LICENSE (AGPL) v3.0.
Acknowledgements
We thank Dr. Machiel Bos for his helpful advises and constructive comments that helped us to improve the implementation of thegmwmx package and to ensure the correct integration ofHector into the gmwmx Rpackage.
References
Cucci, D. A., Voirol, L., Kermarrec, G., Montillet, J. P., & Guerrier, S. (2023). The Generalized Method of Wavelet Moments with eXogenous inputs: a fast approach for the analysis of GNSS position time series. Journal of Geodesy, 97(2), 14.
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.