Title: | Fitting and Forecasting of Grey Model |
---|---|
Description: | Testing, Implementation and Forecasting of Grey Model (GM(1, 1)). For method details see Hsu, L. and Wang, C. (2007). <doi:10.1016/j.techfore.2006.02.005>. |
Authors: | Mrinmoy Ray [aut, cre], Rajeev Ranjan kumar [aut, ctb], K.N. Singh [ctb], Ramasubramanian V. [ctb], Kanchan Sinha [ctb] |
Maintainer: | Mrinmoy Ray <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0 |
Built: | 2024-11-14 06:28:46 UTC |
Source: | CRAN |
The fcast_grey function computes the h step ahead forecast values.
fcast_grey(data, h=3)
fcast_grey(data, h=3)
data |
Input univariate time series (ts) data. |
h |
The forecast horizon. |
This function returns the fitted Grey model's h step ahead forecasted values.
Forecasted_value |
h step ahead forecasted values of the fitted Grey Model. |
Hsu, L. and Wang, C. (2007). Forecasting the output of integrated circuit industry using a grey model improved by the Bayesian analysis. Technological Forecasting and Social Change, 74, 843–853.
Ou, S. (2012). Forecasting agricultural output with an improved grey forecasting model based on the genetic algorithm. Computer and Electronics in Agriculture, 85, 33–39.
Wang, C. and Hsu, L. (2008). Using genetic algorithms grey theory to forecast high technology industrial output. Applied Mathematics and Computation, 195, 256–263.
GM, GM_test
xt <- c(640,724,813,1145,1509,2122,1883,2413,2834,4235,7144,5269) fcast_grey(data=xt)
xt <- c(640,724,813,1145,1509,2122,1883,2413,2834,4235,7144,5269) fcast_grey(data=xt)
The GM function fit GM (1, 1) model for time series data.
GM(data)
GM(data)
data |
Input univariate time series (ts) data. |
In situations where there are limited observations available for modelling, grey modelling may be employed (Hsu and Wang, 2007). Using the OLS approach, this function calculates the parameters (a and b) of the GM (1, 1) model. Additionally, this function returns the model's fitted values and different evaluation criteria.
a |
Grey model parameter |
b |
Grey model parameter |
MAE_Grey |
Mean Absolute Error (MAE) of fitted Grey model |
MAPE_Grey |
Mean Absolute Percentage Error (MAPE) of fitted Grey model |
MSE_Grey |
Mean Square Error (MSE) of fitted Grey model |
RMSE_Grey |
Root Mean Square Error (RMSE) of fitted Grey model |
fitted |
Fitted values of Grey model |
Hsu, L. and Wang, C. (2007). Forecasting the output of integrated circuit industry using a grey model improved by the Bayesian analysis. Technological Forecasting and Social Change, 74, 843–853.
Mao, M. and Chirwa, E. C. (2006). Application of grey model GM(1, 1) to vehicle fatality risk estimation. Technological Forecasting and Social Change, 73, 588–605.
GM_test, fcast_grey
xt <- c(640,724,813,1145,1509,2122,1883,2413,2834,4235,7144,5269) GM(xt)
xt <- c(640,724,813,1145,1509,2122,1883,2413,2834,4235,7144,5269) GM(xt)
The GM_test function test the suitability of data for Grey modelling.
GM_test(data)
GM_test(data)
data |
Input univariate time series (ts) data. |
On the considered time series data, this function computes the ratio sequence. The data is suitable for grey modelling if the sequence value falls between 0.1345 and 7.389 (Hsu and Wang, 2007).
Test_Result |
If the data is suitable for grey modelling, “data is suitable for Grey modelling” will be printed; otherwise, “data is not suitable for Grey modelling” will be printed. |
Hsu, L. and Wang, C. (2007). Forecasting the output of integrated circuit industry using a grey model improved by the Bayesian analysis. Technological Forecasting and Social Change, 74, 843–853.
GM, fcast_grey
xt <- c(640,724,813,1145,1509,2122,1883,2413,2834,4235,7144,5269) GM_test(data=xt)
xt <- c(640,724,813,1145,1509,2122,1883,2413,2834,4235,7144,5269) GM_test(data=xt)