Page 1 of 1

n step rolling forecast using garch

Posted: Thu Dec 15, 2011 9:06 am
by Nau2306
Hi

I am using eviews 6. Is it possible to produce n-step rolling forecasts of the garch model in eviews? Is there a specific fucntion in eviews to carry it out?

Thanks

Re: n step rolling forecast using garch

Posted: Thu Dec 15, 2011 9:10 am
by EViews Gareth
There is nothing built in, no.

Re: n step rolling forecast using garch

Posted: Thu Dec 15, 2011 9:16 am
by Nau2306
Hmm is there any program available to do it in eviews? I have been trying to work on the codes i found on the forum itself but to no avail!!

Re: n step rolling forecast using garch

Posted: Thu Dec 15, 2011 10:16 am
by Nau2306
Please find attached the workfile and program i have been trying. It is giving me 2 error messages:

1. error in sample : attempt to set sample outside of workfile range
structure/resize (from \workfile\proc menu) can expand the workfile range in 'SMPL 9/05/2016 9/06/2016'
My comments or queries: I have been estimating the data from 01/01/2000 to 05/03/2008 which represents the window= 3046. How come it is giving result for 2016??

2. WINSE is an illegal or reseerved name in 'DO_EQ1.FIT WIN8F [WINSE WINVAR]'
My comments or queries: I have tried to change the standard errors and variance series name but i am still getting the same error message.

Hope someone can help me.

Thanks

Re: n step rolling forecast using garch

Posted: Thu Dec 15, 2011 10:40 am
by EViews Gareth
1. The sample error is from the line:

Code: Select all

smpl {%1pers} {%1pere}
It isn't particularly easy to follow your code, but I believe you have set %1pere to be the date associated with the value 1 + !i + !window. Since !i runs from 1 to !length-!window+1-!step, the final run of the iteration loop, will be:

Code: Select all

%1pere = date associated with 1+!length-!window+1-!step + !window = 1+!length
Since !length is the size of the workfile, you've just set %!pere to be the date associated with the first value outside of the workfile. That won't work.

2. You don't need the square brackets:

Code: Select all

EQ1.FIT WIN8F WINSE WINVAR

Re: n step rolling forecast using garch

Posted: Thu Dec 15, 2011 12:36 pm
by Nau2306
Well I have tried to produce 1 step ahead rolling forecast with the garch using as guide the code posted by eviews esther on may 25, 2011 where 4 period ahead forecast was generated for rolling regression. This is what was done to generate the 4 period ahead forecast.

' 4-period-ahead forecast
%4pers = @otod(@dtoo(%start)+!i+!window-1) 'start point
%4pere = @otod(@dtoo(%start)+!i+!window+2) 'end point: %4pere - %4pers +1 = 4
if {%end} < {%4pere} then 'check whether the forecast end point is greater than the workfile end point
return
endif

So i tried to adjust it to generate 1 period ahead forecast but dont know if its correct.

I am confused about one thing. With the eq1.fit function, am I forecasting the error or the variance??

Thanks

Re: n step rolling forecast using garch

Posted: Thu Dec 15, 2011 12:39 pm
by EViews Gareth
The fit function, as it states in the documentation, lets you forecast the mean equation's dependent variable, the standard error of that variable, and the GARCH conditional variance.

Re: n step rolling forecast using garch

Posted: Thu Dec 15, 2011 1:00 pm
by Nau2306
Ok thanks

Think I will have to work out the n-step ahead forecast and try to understand better how to generate it.

Thanks for your help

Re: n step rolling forecast using garch

Posted: Sat Dec 17, 2011 6:51 am
by Nau2306
hi

I have tried a new code for the 1 step ahead garch (1,1) forecast but it is giving me the following error

error in sample: attempt to set sample outside of workfile range
Structure/Resize (from Workfile/Proc menu) can expand the workfile range in 'SMPL 12 12+3046-1

I know its got to do with the sample estimation but I cant see what's wrong. Could someone please look into the matter? i am attaching the program as well as the workfile.

Thanks

Re: n step rolling forecast using garch

Posted: Mon Dec 19, 2011 8:59 am
by EViews Gareth
I just ran that program on the workfile, and it didn't error.

Re: n step rolling forecast using garch

Posted: Mon Dec 19, 2011 9:23 am
by Nau2306
Oh did u run it on eviews6?

Re: n step rolling forecast using garch

Posted: Mon Dec 19, 2011 9:35 am
by EViews Gareth
Yep.