| Title: | Wavelet-Based Spatial Time Series Models |
|---|---|
| Description: | An integrated wavelet-based spatial time series modelling framework designed to enhance predictive accuracy under noisy and nonstationary conditions by jointly exploiting multi-resolution (wavelet) information and spatial dependence. The package implements WaveSARIMA() (Wavelet Based Spatial AutoRegressive Integrated Moving Average model using regression features with forecast::auto.arima()) and WaveSNN() (Wavelet Based Spatial Neural Network model using neuralnet with hyperparameter search). Both functions support spatial transformation via a user-supplied spatial matrix, lag feature construction, MODWT-based wavelet sub-series feature generation, time-ordered train/test splitting, and performance evaluation (Root Mean Square Error (RMSE), Mean Absolute Error (MAE), R-squared (R²), and Mean Absolute Percentage Error (MAPE)), returning fitted models and actual vs predicted values for train and test sets. The package has been developed using the algorithm of Paul et al. (2023) <doi:10.1007/s43538-025-00581-1>. |
| Authors: | Dr. Md Yeasin [aut], Dr. Ranjit Kumar Paul [aut, cre], Akarsh Kumar Singh [aut] |
| Maintainer: | Dr. Ranjit Kumar Paul <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.0 |
| Built: | 2026-05-20 10:34:38 UTC |
| Source: | https://github.com/cran/WaveST |
Builds wavelet sub-series features from lagged original data and spatially
transformed data, then fits forecast::auto.arima() directly (no grid tuning).
Uses wavelet features as regression variables (xreg) when they are available/valid.
WaveSARIMA( Data, Spatial_Matrix, Lag = 4, Wfilter = "d4", Wlevel = 4, Split = 0.8, y_cols = NULL, boundary = "periodic", fast = TRUE, seed = 123, verbose = TRUE )WaveSARIMA( Data, Spatial_Matrix, Lag = 4, Wfilter = "d4", Wlevel = 4, Split = 0.8, y_cols = NULL, boundary = "periodic", fast = TRUE, seed = 123, verbose = TRUE )
Data |
A numeric matrix or data.frame. |
Spatial_Matrix |
Square numeric matrix used for spatial transform (Bs). |
Lag |
Integer. Maximum lag used in |
Wfilter |
Character. Wavelet filter name passed to |
Wlevel |
Integer. Wavelet decomposition level. |
Split |
Numeric in (0,1). Train ratio for time-order split. |
y_cols |
Integer vector. Target column indices in |
boundary |
Character. Boundary for MODWT, default "periodic". |
fast |
Logical. Passed to MODWT; default TRUE. |
seed |
Integer. Random seed. |
verbose |
Logical. If TRUE, prints accuracy table. |
A list with:
model_table: selected ARIMA orders + AICc + number of regressors used
accuracy_table: train/test metrics per target
best_models: list of fitted auto.arima model objects per target
predictions: list of train/test data.frames (Actual vs Predicted) per target
error_log: errors if any target fails
Paul, R.K., Yeasin, M. and Manjunatha, B. (2025). WaveDeepCrop: wavelet enhanced deep learning framework for noise-resilient crop yield forecasting. Proceedings of the Indian National Science Academy, 91(4), 1310–1323.
Data <- matrix(rnorm(300), ncol = 3) Bs <- matrix(c(0,1,0, 0.5,0,0.5, 0,1,0), nrow = 3, byrow = TRUE) res <- WaveSARIMA( Data = Data, Spatial_Matrix = Bs, Lag = 4, Wfilter = "d4", Wlevel = 4, Split = 0.8, verbose = FALSE ) res$accuracy_tableData <- matrix(rnorm(300), ncol = 3) Bs <- matrix(c(0,1,0, 0.5,0,0.5, 0,1,0), nrow = 3, byrow = TRUE) res <- WaveSARIMA( Data = Data, Spatial_Matrix = Bs, Lag = 4, Wfilter = "d4", Wlevel = 4, Split = 0.8, verbose = FALSE ) res$accuracy_table
Builds wavelet sub-series features from lagged original data and spatially
transformed data, then fits and hyper-tunes a feedforward neural network
(via neuralnet) for one or multiple target columns.
WaveSNN( Data, Spatial_Matrix, Lag = 4, Wfilter = "d4", Wlevel = 4, Split = 0.8, hidden_grid = list(c(5), c(10), c(15), c(10, 5), c(15, 10)), threshold_grid = c(0.01, 0.001), stepmax_grid = c(1e+05, 2e+05), algorithm_grid = c("rprop+"), y_cols = NULL, boundary = "periodic", fast = TRUE, seed = 123, verbose = TRUE )WaveSNN( Data, Spatial_Matrix, Lag = 4, Wfilter = "d4", Wlevel = 4, Split = 0.8, hidden_grid = list(c(5), c(10), c(15), c(10, 5), c(15, 10)), threshold_grid = c(0.01, 0.001), stepmax_grid = c(1e+05, 2e+05), algorithm_grid = c("rprop+"), y_cols = NULL, boundary = "periodic", fast = TRUE, seed = 123, verbose = TRUE )
Data |
A numeric matrix or data.frame. Non-numeric columns should be removed beforehand. |
Spatial_Matrix |
Square numeric matrix used for spatial transform (Bs).
The function uses the first |
Lag |
Integer. Maximum lag used in |
Wfilter |
Character. Wavelet filter name passed to |
Wlevel |
Integer. Wavelet decomposition level. |
Split |
Numeric in (0,1). Train ratio for time-order split. |
|
List of integer vectors. Hidden layer sizes to try, e.g. |
|
threshold_grid |
Numeric vector. |
stepmax_grid |
Numeric vector. |
algorithm_grid |
Character vector. |
y_cols |
Integer vector. Target column indices in |
boundary |
Character. Boundary for MODWT, default "periodic". |
fast |
Logical. Passed to MODWT; default TRUE. |
seed |
Integer. Random seed. |
verbose |
Logical. If TRUE, prints accuracy table. |
A list with:
hypertune_all: all hyperparameter runs for all targets
best_hyper_table: best hyperparameters per target
accuracy_table: best train/test metrics per target
best_models: list of fitted neuralnet objects per target
predictions: list of train/test data.frames (Actual vs Predicted) per target
Paul, R.K., Yeasin, M. and Manjunatha, B. (2025). WaveDeepCrop: wavelet enhanced deep learning framework for noise-resilient crop yield forecasting. Proceedings of the Indian National Science Academy, 91(4), 1310–1323.
Data <- matrix(rnorm(300), ncol = 3) Bs <- matrix(c(0,1,0, 0.5,0,0.5, 0,1,0), nrow = 3, byrow = TRUE) res <- WaveSNN( Data = Data, Spatial_Matrix = Bs, Lag = 4, Wfilter = "d4", Wlevel = 4, Split = 0.8, hidden_grid = list(c(5)), # minimal to keep example fast threshold_grid = c(0.01), stepmax_grid = c(1e5), algorithm_grid = c("rprop+"), verbose = FALSE ) res$accuracy_tableData <- matrix(rnorm(300), ncol = 3) Bs <- matrix(c(0,1,0, 0.5,0,0.5, 0,1,0), nrow = 3, byrow = TRUE) res <- WaveSNN( Data = Data, Spatial_Matrix = Bs, Lag = 4, Wfilter = "d4", Wlevel = 4, Split = 0.8, hidden_grid = list(c(5)), # minimal to keep example fast threshold_grid = c(0.01), stepmax_grid = c(1e5), algorithm_grid = c("rprop+"), verbose = FALSE ) res$accuracy_table