forecasting ARMA with GARCH errors

Discussions of ARCH, GARCH, and related models
vittorio23
Posts: 8
Joined: Fri Apr 17, 2009 10:12 pm

forecasting ARMA with GARCH errors

Unread post by vittorio23 »

Hi there,

I am interested in forecasting the mean of an intraday financial variable. There are 12 regularly spaced (timed) observations per day over a one year period (4380obs), which show strong intra-day seasonality, an autoregressive component and heteroskedacticity.

My approach was to model this as an ARMA process with GARCH errors.

I adopted the code of the Enders programming manual page 45/46 as below, but hit a wall in forecasting as the FORECAST command uses EQUATIONS and not FRMLs.

Code: Select all

CALENDAR(PERDAY=12)
ALL 365//12
DATA(FORMAT=XLS,ORG=COLUMNS) 1//1 365//12 High Low Volume Range LDRange Daytrend Mon Tue Wed Thu Fri one $
 two three four five six seven eight nine ten eleven twelve Intratrend Timetrend
******* one two three etc….are intraday dummies for 12 half-hour time periods *****

set temp1 =0.  ; set temp2 = 0.
nonlin a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 beta  b0 b1 c1 b0.ge.0. $
b1.ge.0. c1.ge.0. b1+c1==1.
frml e = range - a1*one - a2*two - a3*three - a4*four - a5*five - a6*six $
- a7*seven - a8*eight - a9*nine - a10*ten - a11*eleven - a12*twelve $
- a13*range{1} - beta*temp1{1}
frml h = b0 + b1*e{1}**2 + c1*temp2{1}
frml L = (temp1 = e), (temp2 = h), -log(temp2) - (temp1)**2/h

box(regressors,noconstant,ar=1,ma=1) range
# one two three four five six seven eight nine ten eleven twelve
com a1=%beta(3), a2=%beta(4), a3=%beta(5), a4=%beta(6), a5=%beta(7), a6=%beta(8), a7=%beta(9), $
 a8=%beta(10), a9=%beta(11), a10=%beta(12), a11=%beta(13), a12=%beta(14), a13=%beta(1), $
 beta=%beta(2), b0=%seesq, b1=0.2, c1=0.5

max(method=simplex,iters=5) L 15 *
max(iters=200) L 15 * values
Also tried adapting the use of GROUP and assigning a dependent variable name to the FRML as is done in the out-of-sample variance forecast example on page 416 in the user guide. However, got the message , “## SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points”. Since posting this, I have read Brooks's book, page 489 that states AFTER the MAXIMIZE command you should add the additional FRML named equations, followed by GROUP and FORECAST COMMAND, I would still be grateful if the difference in the second approach results below could be explained

Have also tried a second approach as outlined on page 411 of the User Guide – the EQUATION option as below:

Code: Select all

boxjenk(noconstant,ar=1,ma=1,regressors,define=armaagain) range
# one two three four five six seven eight nine ten eleven twelve 
garch(p=1,q=1,equation=armaagain)

However, the output is also given me lagged coefficient estimates of the intra-day seasonal dummies, which to my mind should be static.
Variable Coeff Std Error T-Stat Signif
*******************************************************************************
1. RANGE{1} 0.990059426 0.004321752 229.08750 0.00000000
2. ONE 0.334367013 0.132619229 2.52126 0.01169368
3. ONE{1} -0.542543241 0.279467085 -1.94135 0.05221592
4. TWO -0.542543883 0.279467076 -1.94135 0.05221563
5. TWO{1} -0.002221093 0.248567117 -0.00894 0.99287053
6. THREE -0.002220630 0.248567121 -0.00893 0.99287201
7. THREE{1} -0.030846180 0.246439705 -0.12517 0.90039114
etc etc
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: forecasting ARMA with GARCH errors

Unread post by TomDoan »

BOXJENK estimates the model in the specific form

(1) y(t)=mean function(t) + MA(L)/AR(L) u(t)

The reduced form generated from this is

(2) AR(L)y(t) = AR(L) {mean function(t)} + MA(L) u(t)

which is what you're seeing. (1) has the advantage that the coefficients in the mean function are easier to interpret, as they are shifts in the mean of the process. In the case like yours where the regressors in the mean function are an exhaustive set of time period dummies, you get an identical fit from estimating the model in the form:

(3) AR(L)y(t) = regression function(t) + MA(L) u(t)

since the lag of any of the regressors is just another of the regressors. To get an equation in the form (3), you can just use the EQUATION instruction:

Code: Select all

EQUATION(AR=1,MA=1,NOCONST,REG) ARMAAGAIN RANGE
# one two three four five six seven eight nine ten eleven twelve
After you do the GARCH instruction, you can do the forecasts of the mean using that equation and UFORECAST or FORECAST.
sanjeev
Posts: 191
Joined: Mon Jun 18, 2012 6:51 am

Re: forecasting ARMA with GARCH errors

Unread post by sanjeev »

Dear Sir,

I am using ARMA model and ARMA model with GARCH errors to generate recursive forecast for a series "fpi ".
For the ARMA model I use the following
boxjenk(constant,define=arima,ar=3) fpi 1995:10 2013:6
theil(setup,steps=12,from=2013:7, to=2014:12)
#arima
do time=2013:7,2014:12
theil(print)
boxjenk(noprint,constant,define=arima,ar=3) fpi 1995:10 time
end do time
theil(dump)


For ARMA model with GARCH errors I use
boxjenk(ar=3,constant,define=arma) dfpismrev 1995:10 2013:6
garch(p=1,q=1,equation=arma)

But how do I generate recursive forecasts using theil from the ARMA-GARCH model.


Thank You.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: forecasting ARMA with GARCH errors

Unread post by TomDoan »

The same way. You just need BOXJENK followed by GARCH whenever you need an estimated model.
sanjeev
Posts: 191
Joined: Mon Jun 18, 2012 6:51 am

Re: forecasting ARMA with GARCH errors

Unread post by sanjeev »

Sir, I tried the following code for ARMA-GARCH but it is not working

boxjenk(ar=3,constant,define=arima) fpi 1995:10 2013:6
garch(p=1,q=1,equation=arima)
theil(setup,steps=12,from=2013:7, to=2014:12)
# boxjenk(ar=3,constant,define=arima)
garch(p=1,q=1,equation=arima)

do time=2013:7,2014:12
theil(print)
boxjenk(noprint,constant,define=arima,ar=3) fpi 1995:10 time
garch(p=1,q=1,equation=arima)
end do time
theil(dump)

Many Thanks.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: forecasting ARMA with GARCH errors

Unread post by TomDoan »

sanjeev wrote:Sir, I tried the following code for ARMA-GARCH but it is not working

boxjenk(ar=3,constant,define=arima) fpi 1995:10 2013:6
garch(p=1,q=1,equation=arima)
theil(setup,steps=12,from=2013:7, to=2014:12)
# boxjenk(ar=3,constant,define=arima)
garch(p=1,q=1,equation=arima)

do time=2013:7,2014:12
theil(print)
boxjenk(noprint,constant,define=arima,ar=3) fpi 1995:10 time
garch(p=1,q=1,equation=arima)
end do time
theil(dump)

Many Thanks.
As in the code that you were following, the setup is

theil(setup,steps=12,from=2013:7, to=2014:12)
# arima

The # arima identifies the equation that is being used for generating the forecasts.
sanjeev
Posts: 191
Joined: Mon Jun 18, 2012 6:51 am

Re: forecasting ARMA with GARCH errors

Unread post by sanjeev »

Sir, for picking up arima with garch errors I should be able to define the garch equation, somethilng like
boxjenk(ar=3,constant,define=arima) fpismrev 1995:10 2013:6
garch(p=1,q=1,equation=arima, define=arimagarch)
theil(setup,steps=12,from=2013:7, to=2014:12)
# arimagarch
do time=2013:7,2014:12
theil(print)
boxjenk(noprint,constant,define=arima,ar=3) fpismrev 1995:10 time
garch(p=1,q=1,equation=arima)
end do time
theil(dump)

but this doesnt work.

Thanks
Attachments
arima garch 1.RPF
(611 Bytes) Downloaded 1139 times
2015.xlsx
(86.76 KiB) Downloaded 863 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: forecasting ARMA with GARCH errors

Unread post by TomDoan »

There is no DEFINE on the GARCH instruction. The EQUATION option specifies the form of the mean model and picks up the estimates at the end. That's what you use. There is no difference in form between the equation used for forecasting the mean with GARCH estimates and the equation used for forecasting the mean without them---the only thing that changes are the point estimates. If you made the one original change that I suggested, it would work.
sanjeev
Posts: 191
Joined: Mon Jun 18, 2012 6:51 am

Re: forecasting ARMA with GARCH errors

Unread post by sanjeev »

sir if I use

boxjenk(ar=3,constant,define=arima) fpismrev 1995:10 2013:6
garch(p=1,q=1,equation=arima)
theil(setup,steps=12,from=2013:7, to=2014:12)
# arima
do time=2013:7,2014:12
theil(print)
boxjenk(noprint,constant,define=arima,ar=3) fpismrev 1995:10 time
garch(p=1,q=1,equation=arima)
end do time
theil(dump)


then the forecasting output I am getting is

Step Mean Error Mean Abs Err RMS Error Theil U N Obs
Forecast Statistics for Series FPISMREV
1 0 0 0 0.0000 0
2 0 0 0 0.0000 0
3 0 0 0 0.0000 0
4 0 0 0 0.0000 0
5 0 0 0 0.0000 0
6 0 0 0 0.0000 0
7 0 0 0 0.0000 0
8 0 0 0 0.0000 0
9 0 0 0 0.0000 0
10 0 0 0 0.0000 0
11 0 0 0 0.0000 0
12 0 0 0 0.0000 0


Further I am also not getting the forecasted values in the output.

Thanks
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: forecasting ARMA with GARCH errors

Unread post by TomDoan »

1. In the program you attached earlier, you didn't have the CALENDAR instruction:

cal(m) 1995:4

which leaves you with almost no data.

2. Your THEIL instruction should read:

theil(print) time
Esteban
Posts: 10
Joined: Tue May 14, 2019 12:13 pm

Re: forecasting ARMA with GARCH errors

Unread post by Esteban »

Hello,

Talking about the multivariate case, I know that @MVGARCHFORE allows you to do a forecast of the variance. But at the moment you use the Garch command with a var model (VAR-GARCH), Which command allows you to do a forecast of the times series in levels? I suppose that forecast(model= varmodel,...) use the estimated model VAR without correlated errors.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: forecasting ARMA with GARCH errors

Unread post by TomDoan »

Correct. The estimate of the mean just uses the MODEL input to the GARCH instruction---the GARCH errors don't affect the mean forecasts.
Post Reply