EGACH: rolling window forecasts

For questions regarding programming in the EViews programming language.

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

euranton
Posts: 1
Joined: Mon Jun 06, 2011 8:04 am

EGACH: rolling window forecasts

Postby euranton » Mon Jun 06, 2011 9:11 am

Hi all,
I am trying to obtain conditional variances from an EGARCH(1,1) model (using EViews 7). So far, I have pieced together the programming below (I am still a bit of an amateur programmer). I want out-of-sample forecasts using 2000 daily observations (S&P500 returns) to provide conditional variance forecasts up to 250 days ahead. It’s supposed to be a rolling model, therefore I’ve created a matrix in which for each day the n-day ahead forecast (the conditional variance) is stored.
Although the program does run, I get ‘overflow’ errors. Not only for the S&P500 series, also for a Euro index returns series and US Treasury returns series. I still get overflow errors when I use more than 2000 daily observations to estimate conditional variances. What can I do to make this model run properly? How can ‘overflow’ be prevented? Is there a better way (better programming) to obtain out-of-sample conditional variances from a rolling window EGARCH(1,1) model? (I’ve looked at the (E)GARCH sample programs provided by EViews but don’t know how to modify them to get what I need)

‘total number of observations in the workfile
scalar maxobs=6843
‘rolling window length
scalar rolwin=2000
matrix(6843,250) garchfc_sp500
vector(250) forecast_sp500

for !i=rolwin to maxobs
smpl !i-rolwin+1 !i
equation sp500garch
sp500garch.arch(egarch) ret_sp500 c
sp500garch.makegarch sp500g_convar
for !j=1 to 250
if !j=1 then
forecast_sp500(1)=@EXP(sp500garch.@coefs(2)+sp500garch.@coefs(3)*@ABS(resid(!i)/@SQRT(sp500g_convar(!i)))+sp500garch.@coefs(4)*(resid(!i)/@SQRT(sp500g_convar(!i)))+sp500garch.@coefs(5)*@LOG(sp500g_convar(!i)))
endif
if !j>1 then
forecast_sp500(!j)=@EXP(sp500garch.@coefs(2)+sp500garch.@coefs(3)*@ABS(@SQRT(forecast_sp500(!j-1))/@SQRT(sp500g_convar(!i)))+sp500garch.@coefs(4)*(@SQRT(forecast_sp500(!j-1))/@SQRT(forecast_sp500(!j-1)))+sp500garch.@coefs(5)*@LOG(forecast_sp500 (!j-1)))
endif
next !j
rowplace(garchfc_sp500,@transpose(forecast_sp500),!i)
next !i

Thnx in advance

Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests