* * GARCHMV.RPF * RATS Version 8, User's Guide, Example 9.2 * Multivariate GARCH models * 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}) * * Examples with the different choices for the MV option * garch(p=1,q=1,pmethod=simplex,piters=10) / xjpn xfra xsui garch(p=1,q=1,mv=bek,pmethod=simplex,piters=10) / xjpn xfra xsui garch(p=1,q=1,mv=ewma) / xjpn xfra xsui garch(p=1,q=1,mv=diag) / xjpn xfra xsui garch(p=1,q=1,mv=cc) / xjpn xfra xsui garch(p=1,q=1,mv=dcc) / xjpn xfra xsui * * CC models with different choices for the variance model * garch(p=1,q=1,mv=cc,variances=exp) / xjpn xfra xsui garch(p=1,q=1,mv=cc,variances=spillover) / xjpn xfra xsui garch(p=1,q=1,mv=cc,variances=varma,pmethod=simplex,piters=10) / $ xjpn xfra xsui * * EWMA with t-errors with an estimated degrees of freedom parameter * garch(p=1,q=1,mv=ewma,distrib=t) / xjpn xfra xsui * * Univariate AR(1) mean models for each series, DCC model for the variance * equation(constant) jpneq xjpn 1 equation(constant) fraeq xfra 1 equation(constant) suieq xsui 1 group ar1 jpneq fraeq suieq garch(p=1,q=1,model=ar1,mv=dcc,pmethod=simplex,piter=10) * * VAR(1) model for the mean, BEKK for the variance * system(model=var1) variables xjpn xfra xsui lags 1 det constant end(system) * garch(p=1,q=1,model=var1,mv=bekk,pmethod=simplex,piters=10) * * GARCH-M model * dec symm[series] hhs(3,3) clear(zeros) hhs * equation jpneq xjpn # constant hhs(1,1) hhs(1,2) hhs(1,3) equation fraeq xfra # constant hhs(2,1) hhs(2,2) hhs(2,3) equation suieq xsui # constant hhs(3,1) hhs(3,2) hhs(3,3) * group garchm jpneq fraeq suieq garch(model=garchm,p=1,q=1,pmethod=simplex,piters=10,$ mvhseries=hhs) * * Standardized residuals * garch(p=1,q=1,pmethod=simplex,piters=10,$ hmatrices=hh,rvectors=rd) / xjpn xfra xsui set z1 = rd(t)(1)/sqrt(hh(t)(1,1)) set z2 = rd(t)(2)/sqrt(hh(t)(2,2)) set z3 = rd(t)(3)/sqrt(hh(t)(3,3)) @bdindtests(number=40) z1 @bdindtests(number=40) z2 @bdindtests(number=40) z3 * * Multivariate Q statistic. This requires transforming the residuals to * eliminate the time-varying correlations. * dec vect[series] zu(%nvar) do time=%regstart(),%regend() compute %pt(zu,time,%solve(%decomp(hh(time)),rd(time))) end do time @mvqstat(lags=40) # zu * * Forecast out 100 steps, and graph the correlations for the last part * of the data and forecast range. * @MVGarchFore(steps=100) hh rd set rho12 6100 6337 = hh(t)(1,2)/sqrt(hh(t)(1,1)*hh(t)(2,2)) set rho13 6100 6337 = hh(t)(1,3)/sqrt(hh(t)(1,1)*hh(t)(3,3)) set rho23 6100 6337 = hh(t)(2,3)/sqrt(hh(t)(2,2)*hh(t)(3,3)) graph(header="Correlation of JPN with FRA",grid=(t==6237)) # rho12 6100 6337 graph(header="Correlation of JPN with SUI",grid=(t==6237)) # rho13 6100 6337 graph(header="Correlation of FRA with SUI",grid=(t==6237)) # rho23 6100 6337