Type: | Package |
Title: | Hybridization of MS-GARCH and ELM Model |
Version: | 0.1.0 |
Description: | Implements the three parallel forecast combinations of Markov Switching GARCH and extreme learning machine model along with the selection of appropriate model for volatility forecasting. For method details see Hsiao C, Wan SK (2014). <doi:10.1016/j.jeconom.2013.11.003>, Hansen BE (2007). <doi:10.1111/j.1468-0262.2007.00785.x>, Elliott G, Gargano A, Timmermann A (2013). <doi:10.1016/j.jeconom.2013.04.017>. |
Depends: | R (≥ 3.6) |
Imports: | nnfor, MSGARCH, forecast |
License: | GPL-3 |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 6.1.1 |
NeedsCompilation: | no |
Packaged: | 2020-10-02 14:11:40 UTC; Neeraj |
Author: | Rajeev Ranjan Kumar [aut, cre], Girish Kumar Jha [aut, ths, ctb], Neeraj Budhlakoti [ctb] |
Maintainer: | Rajeev Ranjan Kumar <rrk.uasd@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2020-10-08 11:40:02 UTC |
Return Series Data
Description
Monthly return series of international soybean price start from January 1980.
Usage
data("ReturnSeries_data")
Format
A data frame with 107 observations on the following variable.
Details
Dataset contain 107 0bservations of monthly return series of International soyabean price. It is obtained from World Bank "Pink sheet"
Source
https://www.worldbank.org/en/research/commodity-markets
References
https://www.worldbank.org/en/research/commodity-markets
Examples
data(ReturnSeries_data)
## maybe str(ReturnSeries_data) ; plot(ReturnSeries_data) ...
Extreme Learning Machine Forecasting
Description
The fcastelm function computes the volatility forecasting performance of Extreme Learning Machine (ELM) model with root mean square error (RMSE), mean absolute error (MAE), MAPE etc.
Usage
fcastelm(data, stepahead=6, nlags=5, freq = frequency(data),
hn=10, est=c("lm"), rep=20, combt=c("mean"))
Arguments
data |
Univariate time series data. |
stepahead |
The forecast horizon. |
nlags |
Lags of the data to use as inputs. |
freq |
Frequency of the time series. |
hn |
Number of hidden nodes. |
est |
Estimation type for output layer weights. Can be "lasso" (lasso with CV), "ridge" (ridge regression with CV), "step" (stepwise regression with AIC) or "lm" (linear regression). Default: est=c("lm"). |
rep |
Number of networks to train, the result is the ensemble forecast. |
combt |
Combination operator for forecasts when rep > 1. Can be "median", "mode" (based on KDE estimation) and "mean". Default: combt=c("mean") |
Details
It helps to find the most appropriate Extreme Learning Machine model for the time series volatility forecasting.
Value
$forecast_elm: Forecasted value of Extreme Learning Machine.
$accuracy_elm: Performance matrices of ELM model
References
Engle, R. (1982). Autoregressive conditional heteroscedasticity with estimates of the variance of United Kingdom inflation, Econometrica, 50, 987-1008.
Huang, G.B., Zhu Q.Y., and Siew, C.K. (2006). Extreme learning machine: Theory and applications. Neurocomputing, 70, 489-501.
Examples
library(MSGARCHelm)
data(ReturnSeries_data)
fcastelm(ReturnSeries_data)
Bates and Granger MS-GARCH-ELM Combination
Description
This function computes combined time series volatility forecast of Markov Switching GARCH (MS-GARCH) and Extreme Learning Machine (ELM) model according to the approach of Bates and Granger (1969).
Usage
msgarchelm_BG(data, stepahead=10, nlags=3, modelcomb=c("sGARCH",
"gjrGARCH"), distcomb=c("norm", "std"), freq = frequency(data),
hn=10, est=c("lm"), rep=20, combt=c("mean"))
Arguments
data |
Univariate time series data. |
stepahead |
The forecast horizon |
nlags |
Lags of the data to use as inputs in the Extreme Learning Machine (ELM). |
modelcomb |
Combination of volatility models in two different regimes in the MS-GARCH model. Valid models are "sARCH", "sGARCH", "eGARCH", "gjrGARCH", and "tGARCH". Default: modelcomb=c("sGARCH", "gjrGARCH"). |
distcomb |
List with element distribution in the MS-GARCH model. distribution is a character vector (of size 2) of conditional distributions. Valid distributions are "norm", "snorm", "std", "sstd", "ged", and "sged". Default: distcomb=c("norm", "std"). |
freq |
Frequency of the time series. |
hn |
Number of hidden nodes in the ELM model. |
est |
Estimation type for output layer weights in the ELM. Can be "lasso" (lasso with CV), "ridge" (ridge regression with CV), "step" (stepwise regression with AIC) or "lm" (linear regression). Default: est=c("lm"). |
rep |
Number of networks to train, the result is the ensemble forecast in the ELM. |
combt |
Combination operator for forecasts in the ELM model when rep > 1. Can be "median", "mode" (based on KDE estimation) and "mean". Default: combt=c("mean"). |
Details
Bates and Granger (1969) introduce the idea of combining forecasts. Their approach builds on portfolio diversification theory and uses the diagonal elements of the estimated mean squared prediction error matrix in order to compute combination weights. This function gives the combined volatility forecast of Markov Switching GARCH model and Extreme Learning machine model based on Bates and Granger (1969) approach.
Value
$ fcast_comb: Forecasted value of combined model according to Bates and Granger (1969).
$accuracy_combined: Performance matrices of the combined model.
References
Bates, J. M., and Granger, C. W. (1969). The Combination of Forecasts. Journal of the Operational Research Society, 20(4), 451–468.
Hsiao, C., and Wan, S. K. (2014). Is There An Optimal Forecast Combination? Journal of Econometrics, 178(2), 294–309.
Timmermann, A. (2006). Forecast Combinations. In: Elliott, G., Granger, C. W. J., and Timmermann, A. (Eds.), Handbook of Economic Forecasting, 1, 135–196.
Examples
library(MSGARCHelm)
data(ReturnSeries_data)
msgarchelm_BG(ReturnSeries_data)
Newbold and Granger MS-GARCH-ELM Combination
Description
Computes time series volatility forecast combination of MS-GARCH and ELM model according to the approach by Newbold and Granger (1974) and evaluate its performance.
Usage
msgarchelm_NG(data, stepahead = 10, nlags = 5, modelcomb =
c("sGARCH", "gjrGARCH"), distcomb = c("norm", "std"), freq =
frequency(data), hn = 10, est = c("lm"), rep = 20,
combt = c("mean"))
Arguments
data |
Univariate time series data. |
stepahead |
The forecast horizon. |
nlags |
Lags of the data to use as inputs in the Extreme Learning Machine (ELM). |
modelcomb |
Combination of volatility models in two different regimes in the MS-GARCH model. Valid models are "sARCH", "sGARCH", "eGARCH", "gjrGARCH", and "tGARCH". Default: modelcomb=c("sGARCH", "gjrGARCH"). |
distcomb |
List with element distribution in the MS-GARCH model. distribution is a character vector (of size 2) of conditional distributions. Valid distributions are "norm", "snorm", "std", "sstd", "ged", and "sged". Default: distcomb=c("norm", "std"). |
freq |
Frequency of the time series. |
hn |
Number of hidden nodes in the ELM model. |
est |
Estimation type for output layer weights in the ELM. Can be "lasso" (lasso with CV), "ridge" (ridge regression with CV), "step" (stepwise regression with AIC) or "lm" (linear regression). Default: est=c("lm"). |
rep |
Number of networks to train, the result is the ensemble forecast in the ELM. |
combt |
Combination operator for forecasts in the ELM model when rep > 1. Can be "median", "mode" (based on KDE estimation) and "mean". Default: combt=c("mean"). |
Details
It gives the combined volatility forecast of Markov Switching GARCH model and Extreme Learning machine model based on Newbold and Granger (1974) approach. Here MS-GARCH model is restricted to two regime. The Newbold and Granger (1974) approach extracts the combination weights from the estimated mean squared prediction error matrix.
Value
$ fcast_comb: Forecasted value of combined model. $accuracy_combined: Performance matrices of the combined model.
References
Hsiao, C., and Wan, S. K. (2014). Is There An Optimal Forecast Combination? Journal of Econometrics, 178(2), 294–309.
Newbold, P., and Granger, C. W. J. (1974). Experience with Forecasting Univariate Time Series and the Combination of Forecasts. Journal of the Royal Statistical Society, Series A, 137(2), 131–165.
Examples
library(MSGARCHelm)
data(ReturnSeries_data)
msgarchelm_NG(ReturnSeries_data)
MS-GARCH-ELM combination based on OLS regession
Description
This function computes combined time series volatility forecast of Markov Switching GARCH (MS-GARCH) and Extreme Learning Machine (ELM) model according to weights of ordinary least squares (OLS) regression.
Usage
msgarchelm_OLS(data, stepahead = 10, nlags = 5, modelcomb =
c("sGARCH","gjrGARCH"), distcomb = c("norm", "std"), freq =
frequency(data), hn =10, est = c("lm"), rep = 20, combt =
c("mean"))
Arguments
data |
Univariate time series data. |
stepahead |
The forecast horizon |
nlags |
Lags of the data to use as inputs in the Extreme Learning Machine (ELM). |
modelcomb |
Combination of volatility models in two different regimes in the MS-GARCH model. Valid models are "sARCH", "sGARCH", "eGARCH", "gjrGARCH", and "tGARCH". Default: modelcomb=c("sGARCH", "gjrGARCH"). |
distcomb |
List with element distribution in the MS-GARCH model. distribution is a character vector (of size 2) of conditional distributions. Valid distributions are "norm", "snorm", "std", "sstd", "ged", and "sged". Default: distcomb=c("norm", "std"). |
freq |
Frequency of the time series. |
hn |
Number of hidden nodes in the ELM model. |
est |
Estimation type for output layer weights in the ELM. Can be "lasso" (lasso with CV), "ridge" (ridge regression with CV), "step" (stepwise regression with AIC) or "lm" (linear regression). Default: est=c("lm"). |
rep |
Number of networks to train, the result is the ensemble forecast in the ELM. |
combt |
Combination operator for forecasts in the ELM model when rep > 1. Can be "median", "mode" (based on KDE estimation) and "mean". Default: combt=c("mean"). |
Details
The OLS combination method (Granger and Ramanathan (1984)) uses ordinary least squares to estimate the weights for the combination. An appealing feature of the method is its bias correction through the intercept – even if one or more of the individual predictors are biased, the resulting combined forecast is unbiased. This function gives the combined volatility forecast of Markov Switching GARCH model and Extreme Learning machine model based on OLS approach.
Value
$fcast_comb: Forecasted value of combined model according to ordinary least squares.
$accuracy_combined: Performance matrices of the combined model.
References
Granger, C., and Ramanathan, R. (1984). Improved Methods Of Combining Forecasts. Journal of Forecasting, 3(2), 197–204.
Nowotarski, J., Raviv, E., Trueck, S., and Weron, R. (2014). An Empirical Comparison of Alternative Schemes for Combining Electricity Spot Price Forecasts. Energy Economics, 46, 395–412.
Timmermann, A. (2006). Forecast Combinations. In: Elliott, G., Granger, C. W. J., and Timmermann, A. (Eds.), Handbook of Economic Forecasting, 1, 135–196.
Examples
library(MSGARCHelm)
data(ReturnSeries_data)
msgarchelm_OLS(ReturnSeries_data)