Rolling Forecast for MGARCH(DCC and BEKK)

Discussions of ARCH, GARCH, and related models
Vik_pa
Posts: 30
Joined: Wed Aug 03, 2016 3:00 am

Rolling Forecast for MGARCH(DCC and BEKK)

Unread post by Vik_pa »

Dear Tom,

Is is possible to forecast the MVGARCH(specifically DCC and BEKK) using rolling forecast? The @MVGARCHFORE does the out of sample forecasting using full sample estimation.

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

Re: Rolling Forecast for MGARCH(DCC and BEKK)

Unread post by TomDoan »

Isn't that what you want? If you're doing rolling forecasts, I assume you're doing rolling estimations.
Vik_pa
Posts: 30
Joined: Wed Aug 03, 2016 3:00 am

Re: Rolling Forecast for MGARCH(DCC and BEKK)

Unread post by Vik_pa »

That's what I am looking for, a estimations of mvgarch models in rolling window and one day ahead forecast of the var-covar matrix. I found one example of univariate garch estimation in rolling window but unable to find for mvgarch.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Rolling Forecast for MGARCH(DCC and BEKK)

Unread post by TomDoan »

There's no difference in the procedure. You just use the @MVGARCHFORE for doing the forecasts.
Vik_pa
Posts: 30
Joined: Wed Aug 03, 2016 3:00 am

Re: Rolling Forecast for MGARCH(DCC and BEKK)

Unread post by Vik_pa »

But as per the UG it is not possible to forecast the dcc garch using mvgarchfore. In that case, how to proceed.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Rolling Forecast for MGARCH(DCC and BEKK)

Unread post by TomDoan »

See https://estima.com/forum/viewtopic.php?p=8856#p8856. That does an approximation since there is no closed form forecasting formula (for the full covariance matrix---if you just need the variances, that's a different matter).
Vik_pa
Posts: 30
Joined: Wed Aug 03, 2016 3:00 am

Re: Rolling Forecast for MGARCH(DCC and BEKK)

Unread post by Vik_pa »

I have estimated the bekk in rolling window of 500 as per the below code.

Code: Select all

OPEN DATA "C:\Users\Desktop\123.xlsx"
CALENDAR(D) 1999:1:4
DATA(FORMAT=XLSX,ORG=COLUMNS) 1999:01:04 2008:12:31 FL FO FH FLO CL CO CH CLO

set fret = 100*(log(fl)-log(fl{1}))
set cret = 100*(log(cl)-log(cl{1}))
source mvgarchfore.src
compute d = 500
do gend = 2000:12:05, 2008:12:31
   garch(p=1,q=1,mv=bekk,hmatrices=hh,rvector=rr) gend-d+1 gend fret cret
@MVGarchFore(MV=BEKK,steps=1) hh rr
end do
can you please advice how to save the forecasted variance and covariance.?
Also, is it possible to check if the bekk model has converged for all the estimation?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Rolling Forecast for MGARCH(DCC and BEKK)

Unread post by TomDoan »

It would be HH(GEND+1). Use %CONVERGED. See the GARCHBACKTEST.RPF example.
Vik_pa
Posts: 30
Joined: Wed Aug 03, 2016 3:00 am

Re: Rolling Forecast for MGARCH(DCC and BEKK)

Unread post by Vik_pa »

I updated my code as

Code: Select all

source mvgarchfore.src
compute d = 500
do gend = 2000:12:05, 2008:12:31
   garch(p=1,q=1,mv=bekk,hmatrices=hh,rvector=rr,noprint) gend-d+1 gend fret cret
@MVGarchFore(MV=BEKK,steps=1) hh rr
set cov 2000:12:05 2008:12:31 = hh(gend+1)(1,2)
end do
But it gives me a same value in the series cov.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Rolling Forecast for MGARCH(DCC and BEKK)

Unread post by TomDoan »

It's doing exactly what you're telling it to do. You're doing a SET instruction over the whole range on each trip through the loop. You only want to change a single value. You have to decide whether you want to associate the forecast with the end of the estimation period (gend) or with the forecast period (gend+1), but that's the only element you want to change on a particular pass.
Vik_pa
Posts: 30
Joined: Wed Aug 03, 2016 3:00 am

Re: Rolling Forecast for MGARCH(DCC and BEKK)

Unread post by Vik_pa »

So basically, for every estimation in the rolling window, the cov matrix is saved under hh and based on this covariance matrix @mvgarchforw will forecast one step ahead forecast of the cov and save it in hh matrix. For example, for the very first estimation window, it will estimate the cov based on the first 500 data points starting with 1999:01:05 and the hh(501)(1,2) will be one step ahead forecast covarinace. And for the next window from 1999:01:06 to 501 points it will estimate the model and the one step ahead forecast cov will be hh(502)(1,2) and so on.

If such is the case than if I create a set instruction like set cov 2000:12:05 2008:12:31 = hh(t+1)(1,2), will it create a series with the forecast covariances for each rolling estimation?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Rolling Forecast for MGARCH(DCC and BEKK)

Unread post by TomDoan »

No. Because each new window will overwrite the HH value that you just created (the next window will now include in the sample the value you just forecast). You need to save just one value at a time inside the window. Look at the GARCHBACKTEST example, or the Diebold-Yilmaz rolling samples example, or any of the other examples which do rolling estimations.
Vik_pa
Posts: 30
Joined: Wed Aug 03, 2016 3:00 am

Re: Rolling Forecast for MGARCH(DCC and BEKK)

Unread post by Vik_pa »

Thanks. I have gone through the garchbacktest.rpf example. As per this example, I need to calculate the one step forecast for the covariance matrices and save it in a matrix. I have few questions.

1)In the garchbacktest.rpf example, it gives me a single value of hhat when i use the command "display hhat". Shouldn't it contains all the one step forecast of variance between tstart and tend.

2)And in my case,inside the loop, after the garch estimation, I have computed the one step forecast for the covariance as
compute hmat=%beta(4)+%beta(7)*rr(gend)*tr(rr(gend))+%beta(11)*hh(gend).
Please correct me if i am missing something in here.

Thanks and a very happy new year to you.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Rolling Forecast for MGARCH(DCC and BEKK)

Unread post by TomDoan »

You seem to be having a hard time understanding the point of the rolling windows. A given window is supposed to produce information for only one data point (which you can label either <<end>> or <<end>>+1 depending upon how you're going to use it). GARCHBACKTEST doesn't do specifically what you want, but shows the idea---for it, the only piece of information that is saved from the window ending with entry <<end>> is trigger(end). At the end of the entire loop, you get a full series of values for trigger, but each GARCH instruction only creates a single value out of that.
Vik_pa
Posts: 30
Joined: Wed Aug 03, 2016 3:00 am

Re: Rolling Forecast for MGARCH(DCC and BEKK)

Unread post by Vik_pa »

I have tried a code on a small sample of 20 one step ahead forecast for the covariance and It is giving me a rolling forecast of the covariances. Just wanted to confirm with you if this is correct.

Code: Select all

OPEN DATA "C:\Users\Desktop\123.xlsx"
CALENDAR(D) 1999:1:4
DATA(FORMAT=XLSX,ORG=COLUMNS) 1999:01:04 2008:12:31 FL FO FH FLO CL CO CH CLO

set fret = 100*(log(fl)-log(fl{1}))
set cret = 100*(log(cl)-log(cl{1}))
source mvgarchfore.src
compute d = 500
dec series hhat
clear hhat
do gend = 2000:12:05, 2000:12:31
   garch(p=1,q=1,mv=bekk,hmatrices=hh,rvector=rr) gend-d+1 gend fret cret
@MVGarchFore(MV=BEKK,steps=1) hh rr
compute hhat(gend+1)= hh(gend+1)(1,2)
end do
Post Reply