Arima Garch R
Arima Garch R
Arima Garch R
Copyright (c) 2012 International Journal of Computer Science Issues. All Rights Reserved.
IJCSI International Journal of Computer Science Issues, Vol. 9, Issue 6, No 1, November 2012
ISSN (Online): 1694-0814
www.IJCSI.org 342
year on year change in average daily load, minimum where a0 is set to zero if no intercept is included, p is the
daily load in each year, and maximum daily load in each autoregressive process order and q is the moving
year. average process order.
Table 1: Data Analysis for 5 years (Power Load in Giga Watts)
The Best-Fit p and q order values of ARMA model
can be determined by using the smallest AIC (Akaike
Information Criterion) through the following R-Code:
The trend in the Table 1 shows that the average day load,
minimum, and maximum day load increased across the
years.
Copyright (c) 2012 International Journal of Computer Science Issues. All Rights Reserved.
IJCSI International Journal of Computer Science Issues, Vol. 9, Issue 6, No 1, November 2012
ISSN (Online): 1694-0814
www.IJCSI.org 343
Copyright (c) 2012 International Journal of Computer Science Issues. All Rights Reserved.
IJCSI International Journal of Computer Science Issues, Vol. 9, Issue 6, No 1, November 2012
ISSN (Online): 1694-0814
www.IJCSI.org 344
lag 6. The ARMA(1,1) is adequate to fit this data. The linearity in the errors. The fitted model assumes
number of predictions ahead for short duration is more constant variances i.e. homoskedasticity and the
accurate than that of long duration ahead in this model predictions become inaccurate with increase in the time
which is good enough for forecasting the Day-ahead lags , in reality the variances may not be constant. For
electricity load for weekly planning. example, electricity usage at nighttime may have more
steady pattern compare to that of daytime usage i.e. the
3.3 Forecasting of Day-ahead Electricity variances in nighttime may be lower than that during at
Demand daytime. Thus, the daytime usage plays a significant
factor in the daily load variances. This behavior is called
The ARMA(1,1) model equation with the estimated ARCH effect i.e. Autoregressive model with conditional
coefficients is heteroskedasticity (conditional on time). McLeod test
can be used to analyze if there is any conditional
xt = 9.91 + 0.9285xt-1 +0.3161 et-1 + et (2) heteroskedasticity in the residuals i.e. ARCH
The R-Code to forecast 10 Day-ahead demand is as (Autoregressive Conditional Heteroskedasticity) effect.
follows:
3.4 Test for Heteroskedasticity in the residuals
Copyright (c) 2012 International Journal of Computer Science Issues. All Rights Reserved.
IJCSI International Journal of Computer Science Issues, Vol. 9, Issue 6, No 1, November 2012
ISSN (Online): 1694-0814
www.IJCSI.org 345
This test has given a statistics value = 137.4599, degrees conditional mean model. The residuals can still be
of freedom = 2, and a p-value < 2.2e-16 at 5% level of serially dependent.
significance. Thus, the null hypothesis stated the For Engle's ARCH test of autocorrelation in the squared
residuals are normal and homoskedastic is rejected. residuals , the alternative hypothesis is given by the
Both the tests implied that there is a volatility in the regression
daily load and the variances may have stochastic pattern.
Thus, the heteroskedasticity of errors needs further H : e2t = 0 + 1e2t-1 + . + m e2t-m + ut .(6)
analysis using a non-linear model such as GARCH
where ut is a noise error process. The null hypothesis is
where the variances themselves are modeled as AR(p)
H0 : 0 = 1 = . = m = 0 . (7)
(Autoregressive process of order p) model. Since both
positive and negative changes are observed in the daily Ljung-Box Q-Test can be conducted on the first m lags
electricity load this is another factor for considering a of the squared residual series to check for serial
nonlinear model to analyze the errors. dependence, this is an alternative to Engles ARCH
effect.
4. GARCH Model for the variances
4.1 GARCH Model 4.2 Estimation of Coefficients
GARCH, a non-linear model treats heteroskedasticity as
a variance to be modeled[11], for each error term a The GARCH( p, q) model is applied on the daily
prediction is estimated for the variance apart from difference data to determine the p and q terms where p
correcting the deficiencies of least squares. The GARCH is the order of GARCH term 2 , standard deviation and
model measures the volatility like a standard deviation q is the order of ARCH term 2, mean error. The R-Code
which is used in the decision making where the to identify GARCH model & fit the model to the
differential values are critical such as Electricity residuals data and predict the variances is given below:
demand Day-ahead forecast, risk analysis, Electricity
prices in the deregulated market, portfolio returns in the
stock market, etc.
If a time series is defined as
The p and q values are changed iteratively in the above
yt = t + t .. (3)
code. AIC, and LM ( Lagrange Multiplier) ARCH Test
where t is the conditional mean, and t is a residual p-values are captured for each iteration in the Table 5.
process with mean zero.
Table 5: GARCH model with p, q values
The residuals are generated as t = t z t
Copyright (c) 2012 International Journal of Computer Science Issues. All Rights Reserved.
IJCSI International Journal of Computer Science Issues, Vol. 9, Issue 6, No 1, November 2012
ISSN (Online): 1694-0814
www.IJCSI.org 346
Copyright (c) 2012 International Journal of Computer Science Issues. All Rights Reserved.
IJCSI International Journal of Computer Science Issues, Vol. 9, Issue 6, No 1, November 2012
ISSN (Online): 1694-0814
www.IJCSI.org 347
4.3 Forecasting of Variances It is observed that the standard deviation and mean error
values are equal in the predictions. Let us combine
The GARCH(1,1) with the estimated coefficients is ARMA and GARCH for conditional mean and
represented as : conditional variances and predicted the values as
2t = 0.00265 + 0.3786 x2t-1 +0.3966 2t-1 .(8) follows:
The following R-Code uses the above coefficients for
GARCH predictions.
Copyright (c) 2012 International Journal of Computer Science Issues. All Rights Reserved.
IJCSI International Journal of Computer Science Issues, Vol. 9, Issue 6, No 1, November 2012
ISSN (Online): 1694-0814
www.IJCSI.org 348
6. References
Copyright (c) 2012 International Journal of Computer Science Issues. All Rights Reserved.
IJCSI International Journal of Computer Science Issues, Vol. 9, Issue 6, No 1, November 2012
ISSN (Online): 1694-0814
www.IJCSI.org 349
Copyright (c) 2012 International Journal of Computer Science Issues. All Rights Reserved.