n step rolling forecast using garch

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

n step rolling forecast using garch

Postby Nau2306 » Thu Dec 15, 2011 9:06 am

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: n step rolling forecast using garch

Postby EViews Gareth » Thu Dec 15, 2011 9:10 am

There is nothing built in, no.

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

Re: n step rolling forecast using garch

Postby Nau2306 » Thu Dec 15, 2011 9:16 am

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!!

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

Re: n step rolling forecast using garch

Postby Nau2306 » Thu Dec 15, 2011 10:16 am

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
Attachments
usd-nov11.wf1
(782.33 KiB) Downloaded 431 times
forecast.prg
(605 Bytes) Downloaded 575 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: n step rolling forecast using garch

Postby EViews Gareth » Thu Dec 15, 2011 10:40 am

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

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

Re: n step rolling forecast using garch

Postby Nau2306 » Thu Dec 15, 2011 12:36 pm

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: n step rolling forecast using garch

Postby EViews Gareth » Thu Dec 15, 2011 12:39 pm

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.

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

Re: n step rolling forecast using garch

Postby Nau2306 » Thu Dec 15, 2011 1:00 pm

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

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

Re: n step rolling forecast using garch

Postby Nau2306 » Sat Dec 17, 2011 6:51 am

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
Attachments
forecast.prg
(448 Bytes) Downloaded 755 times
usd-nov11.wf1
(738.45 KiB) Downloaded 473 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: n step rolling forecast using garch

Postby EViews Gareth » Mon Dec 19, 2011 8:59 am

I just ran that program on the workfile, and it didn't error.

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

Re: n step rolling forecast using garch

Postby Nau2306 » Mon Dec 19, 2011 9:23 am

Oh did u run it on eviews6?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: n step rolling forecast using garch

Postby EViews Gareth » Mon Dec 19, 2011 9:35 am

Yep.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests