Title: | Wavelet-RF Hybrid Model for Time Series Forecasting |
---|---|
Description: | The Wavelet Decomposition followed by Random Forest Regression (RF) models have been applied for time series forecasting. The maximum overlap discrete wavelet transform (MODWT) algorithm was chosen as it works for any length of the series. The series is first divided into training and testing sets. In each of the wavelet decomposed series, the supervised machine learning approach namely random forest was employed to train the model. This package also provides accuracy metrics in the form of Root Mean Square Error (RMSE) and Mean Absolute Prediction Error (MAPE). This package is based on the algorithm of Ding et al. (2021) <DOI: 10.1007/s11356-020-12298-3>. |
Authors: | Ranjit Kumar Paul [aut, cre], Md Yeasin [aut] |
Maintainer: | Ranjit Kumar Paul <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0 |
Built: | 2024-10-31 21:07:45 UTC |
Source: | https://github.com/cran/WaveletRF |
Transforms the time series data by using hybrid MODWT algorithm.
WaveletFitting( ts, Wvlevels, WFilter = "haar", bndry = "periodic", FFlag = TRUE )
WaveletFitting( ts, Wvlevels, WFilter = "haar", bndry = "periodic", FFlag = TRUE )
ts |
Univariate time series |
Wvlevels |
The level of wavelet decomposition |
WFilter |
Wavelet filter use in the decomposition |
bndry |
The boundary condition of wavelet decomposition:'periodic' or 'reflection' |
FFlag |
The FastFlag condition of wavelet decomposition: True or False |
WaveletSeries - The wavelet trasnform of the series
Aminghafari, M. and Poggi, J.M. 2007. Forecasting time series using wavelets. Internationa Journal of Wavelets, Multiresolution and Inforamtion Processing, 5, 709 to 724
Percival D. B. and Walden A. T. 2000. Wavelet Methods for Time-Series Analysis. Cambridge Univ. Press, U.K.
Paul R. K., Prajneshu and Ghosh H. 2013. Wavelet Frequency Domain Approach for Modelling and Forecasting of Indian Monsoon Rainfall Time-Series Data. Journal of the Indian society of agricultural statistics, 67, 319 to 327.
data<-rnorm(200,mean=20,sd=3) Wavelet<-WaveletFitting(ts=data,Wvlevels=3,WFilter='haar',bndry='periodic',FFlag=TRUE)
data<-rnorm(200,mean=20,sd=3) Wavelet<-WaveletFitting(ts=data,Wvlevels=3,WFilter='haar',bndry='periodic',FFlag=TRUE)
The Wavelet Decomposition followed by Random Forest Regression (RF) models have been applied for time series forecasting. The maximum overlap discrete wavelet transform (MODWT) algorithm was chosen as it works for any length of the series. The series is first divided into training and testing sets. In each of the wavelet decomposed series, the supervised machine learning approach namely random forest was employed to train the model. This package also provides accuracy metrics in the form of Root Mean Square Error (RMSE) and Mean Absolute Prediction Error (MAPE).
WaveletFittingRF( ts, tlag = ACF, Waveletlevels, WaveletFilter = "haar", boundary = "periodic", FastFlag = TRUE, SplitRatio = 0.8 )
WaveletFittingRF( ts, tlag = ACF, Waveletlevels, WaveletFilter = "haar", boundary = "periodic", FastFlag = TRUE, SplitRatio = 0.8 )
ts |
Univariate time series |
tlag |
Number of lags |
Waveletlevels |
The level of wavelet decomposition |
WaveletFilter |
Wavelet filter use in the decomposition |
boundary |
The boundary condition of wavelet decomposition |
FastFlag |
The FastFlag condition of wavelet decomposition: True or False |
SplitRatio |
Training and testing data split |
TrainFittedValue - Fitted value of train data
TestPredictedValue - Predicted value of test data
AccuracyTable - RMSE and MAPE of train and test data
Ding, Y., Zhang, W., Zhao, X., Zhang, L. and Yan, F., 2020. A hybrid random forest method fusing wavelet transform and variable importance for the quantitative analysis of K in potassic salt ore using laser-induced breakdown spectroscopy. Journal of Analytical Atomic Spectrometry, 35(6), 1131-1138.
Rezaali, M., Fouladi-Fard, R., Mojarad, H., Sorooshian, A., Mahdinia, M. and Mirzaei, N., 2021. A wavelet-based random forest approach for indoor BTEX spatiotemporal modeling and health risk assessment. Environmental Science and Pollution Research, 28(18), 22522-22535.
Paul, R. K., Prajneshu and Ghosh H. 2013. Wavelet Frequency Domain Approach for Modelling and Forecasting of Indian Monsoon Rainfall Time-Series Data. Journal of the Indian society of agricultural statistics, 67, 319-327.
Paul, R. K. and Birthal, P.S. 2015. Investigating rainfall trend over India using wavelet technique. Journal of Water and Climate Change, 7, 365 to 378.
Paul, R. K. 2015. ARIMAX-GARCH-WAVELET Model for forecasting volatile data. Model Assisted Statistics and Application, 10, 243 to 252.
data<-rnorm(200,mean=20,sd=3) WRF<-WaveletFittingRF(ts=data,tlag=2,Waveletlevels=3)
data<-rnorm(200,mean=20,sd=3) WRF<-WaveletFittingRF(ts=data,tlag=2,Waveletlevels=3)