Page 1 of 1

Forecasting with a ARIMA/GARCH Model

Posted: Wed Apr 11, 2012 4:25 pm
by rmvoller
I am trying to forecast a series with an ARIMA/GARCH Model. I am able to estimate the ARIMA/GARCH model but I am lost at how to forecast the original series from the ARIMA/GARCH model. Thanks in advance for any help, the code I am using is the following:

Code: Select all

cal(m) 1998:1
all 2011:12 
open data C:\Users\rmvoller.COUGARNET\Desktop\Forcasting Project\ED.xlsx
data(format=xlsx,org=obs) / ED

graph 1
#ed

set y * 2010:12 = ed
set yf = ed
set ly = log(y)
set lyf = log(yf)

diff(sdiffs=1) ly / dly

graph 1
#dly

set trend = t
seasonal season12
set season1 = season12{-11}
set season2 = season12{-10}
set season3 = season12{-9}
set season4 = season12{-8}
set season5 = season12{-7}
set season6 = season12{-6}
set season7 = season12{-5}
set season8 = season12{-4}
set season9 = season12{-3}
set season10 = season12{-2}
set season11 = season12{-1}

linreg ly
#constant trend season12{-11 to -1}
exclude
#season12{-11 to -1}

linreg dly
#constant trend season12{-11 to -1}
exclude
#season12{-11 to -1}

*ADF test*

linreg dly
#constant ly{1} dly{1 to 8}

linreg dly
#constant ly{1} dly{1 to 7}

linreg dly
#constant ly{1} dly{1 to 6}

linreg dly
#constant ly{1} dly{1 to 5}

linreg dly
#constant ly{1} dly{1 to 4}

linreg dly
#constant ly{1} dly{1 to 3}

linreg dly
#constant ly{1} dly{1 to 2}

linreg dly
#constant ly{1} dly{1 to 1}

linreg dly
#constant ly{1}

@DFUNIT(DET=TREND,LAGS=3) ly

graph
# ly
@bjident(diffs=1,sdiffs=1) ly

* Searching for a minimum of SBC (also called, SIC)

com sbcmin = 100000000., sbcp = 0, sbcq = 0
com aicmin = 100000000., aicp = 0, aicq = 0

do i=0,4
do j=0,4

boxjenk(diff=1,sdiff=1,ar=i,ma=j,constant,noprint)  ly  / resids
compute sbc = log(%rss/%nobs) + %nreg*log(%nobs)/(%nobs)
compute aic = log(%rss/%nobs) + 2*(%nreg)/%nobs
*compute aic = %nobs*log(%rss) + 2*%nreg
*compute sbc = %nobs*log(%rss) + %nreg*log(%nobs)

 display 'p ='  i  ' q =' j  '  AIC = ' aic     '  SBC = ' sbc
 if sbc < sbcmin
 {
  compute sbcp = i
  compute sbcq = j
  compute sbcmin = sbc
  }
 if aic < aicmin
 {
  compute aicp = i
  compute aicq = j
  compute aicmin = aic
  }
endo j
endo i
disp
disp 'Selected values of p and q using SBC = ' sbcp  sbcq
disp 'Selected values of p and q using AIC = ' aicp  aicq

disp

boxjenk(constant,diff=1,sdiff=1,ar=sbcp,ma=sbcq,define=eq1) ly / U
cor(partial=pacf,qstats,number=36,span=12,dfc=4) U 1998:01  2010:12
set u2 = u*u

UFORECAST(STEPS=12,EQUATION=EQ1,STDERRS=LY_FORE,PRINT) lY_FOR

graph 2
#lyf
#ly_for

* Testing for arch effects

linreg u2 1998:01  2010:12
# constant u2{1 to 5}
compute trsq = %nobs*%rsquared
cdf chisq trsq 5

source(noecho) c:/garch1.src
@GARCH dly 1998:01  2010:12  nresids cvar

Re: Forecasting with a ARIMA/GARCH Model

Posted: Wed Apr 11, 2012 9:45 pm
by TomDoan
You should be using the GARCH instruction, not the @GARCH procedure. As you have that written, it's not estimating an ARIMA/GARCH model. Once you have that model straight, the mean is forecast using the ARIMA part, and the variances are forecast using the GARCH part. If it's not a GARCH-M, the two don't interact for forecasting purposes.

Re: Forecasting with a ARIMA/GARCH Model

Posted: Fri Apr 13, 2012 3:20 pm
by rmvoller
Thank you for response. Using the garch instruction I arrive at this code for my garch model:

GARCH(P=1,Q=1,RESIDS=GR,HSERIES=G,REGRESSORS) / DLY
# Constant DLY{2} %MVGAVGE{5}

and this code for my ARIMA model:

boxjenk(constant,diff=1,sdiff=1,ar=2,ma=5,define=eq1) ly / U
cor(partial=pacf,qstats,number=36,span=12,dfc=4) U 1998:01 2010:12
set u2 = u*u

How would I obtain the forecast of ly using the ARIMA equation for the mean and the GARCH equation for the variance? I am currently only aware of how to forecast from the individual models. Thanks again for your help.

Re: Forecasting with a ARIMA/GARCH Model

Posted: Fri Apr 13, 2012 3:51 pm
by moderator
Mr. Doan can confirm, but I don't think he was suggesting that you *estimate* them separately. Rather, you would use the parameter estimates produced by GARCH for both sets of forecasts.

We discuss forecasting GARCH variances in the User's Guide (see page 295 if using version 8).

For the mean model, I believe you would want to define a new equation for the mean model, using the coefficients saved in %BETA by the GARCH instruction to provide the coefficient values. You could then use FORECAST or UFORECAST to generate the forecasts.

Regards,
Tom Maycock

Re: Forecasting with a ARIMA/GARCH Model

Posted: Tue May 01, 2012 2:16 pm
by rmvoller
Thanks for they help I see how to do it now.