RATS 11.1
RATS 11.1

Examples /

GARCHDCCFORECAST.RPF

Home Page

← Previous Next →

GARCHDCCFORECAST.RPF is an example of forecasting variance from a DCC GARCH model. There is no closed form extrapolation for the variance of any multivariate GARCH model which can't be put into a VECH form. That class excludes DCC. However, it's possible to approximate the out-of-sample variances forecasts. This uses the R approximation from Engle and Sheppard(2001), "Theoretical and Empirical Properties of Dynamic Conditional Correlation Multivariate GARCH", NBER Working Paper 8554.

 

Their "R" approximation extrapolates the correlations using the DCC recursion using the empirical (in-sample) estimate of the correlation of the standardized residuals. That is combined with the straightforward out-of-sample forecasts of the variances from the univariate models to get the overall forecast of the covariance.

 

This is the same set of data used in the GARCHMV.RPF example.

 

Full Program

open data g10xrate.xls

data(format=xls,org=columns) 1 6237 usxjpn usxfra usxsui

*

set xjpn = 100.0*log(usxjpn/usxjpn{1})

set xfra = 100.0*log(usxfra/usxfra{1})

set xsui = 100.0*log(usxsui/usxsui{1})

*

garch(p=1,q=1,mv=dcc,hmatrices=hh,rvector=u)  / xjpn xfra xsui

*

* Get residuals standardized by own variances

*

dec vect[series] eps(%nvar)

do i=1,%nvar

   set eps(i) %regstart() %regend() = u(t)(i)/sqrt(hh(t)(i,i))

end do i

*

* Compute the empirical estimate of correlation of the standardized residuals

* (rbar).

*

vcv(nocenter)

# eps

compute rbar=%cvtocorr(%sigma)

*

* Fish out the DCC parameters (last two in the beta vector)

*

compute alpha=%beta(%nreg-1),beta=%beta(%nreg)

*

compute nfore=36

*

* Copy the sample correlations into RR, then extend out of sample

*

dec series[symm] rr

gset rr %regstart() %regend() = %cvtocorr(hh)

gset rr %regend()+1 %regend()+nfore = (1-alpha-beta)*rbar+(alpha+beta)*rr{1}

*

* Forecast just the diagonals (variances only)

*

@mvgarchfore(MV=DIAGONAL,steps=nfore) hh u

*

* Combine the variances and correlations to make out-of-sample

* covariance matrix forecasts. Both forecasts of the variance and of the

* correlations (done below) can be pulled out of that.

*

gset hh %regend()+1 %regend()+nfore = %corrtocv(rr(t),%xdiag(hh(t)))

*

* Extract the dynamic correlations and graph them.

*

set rjpnfra %regstart() %regend()+nfore = %cvtocorr(hh)(1,2)

set rjpnsui %regstart() %regend()+nfore = %cvtocorr(hh)(1,3)

set rfrasui %regstart() %regend()+nfore = %cvtocorr(hh)(2,3)

*

* Graph the last in-sample correlations along with the out-of-sample

* extrapolations.

*

spgraph(vfields=3,footer="DCC Forecasts of Correlations")

 graph(grid=(t==%regend()),hlabel="JPN with FRA")

 # rjpnfra %regend()-nfore *

 graph(grid=(t==%regend()),hlabel="JPN with SUI")

 # rjpnsui %regend()-nfore *

 graph(grid=(t==%regend()),hlabel="FRA with SUI")

 # rfrasui %regend()-nfore *

spgraph(done)

 

Graph

 

 

 


Copyright © 2026 Thomas A. Doan