* * GARCHUV.RPF * Examples of estimates of standard univariate GARCH models * * RATS User's Guide, example from Section 9.3.9. * open data garch.asc data(format=free,org=columns) 1 1867 bp cd dm jy sf * set dlogdm = 100*log(dm/dm{1}) * * Estimates ARCH(6), GARCH(1,1) and EGARCH(1,1) with asymmetry. Variances * for each are saved. * garch(p=0,q=6,hseries=hh06) / dlogdm garch(p=1,q=1,hseries=hh11) / dlogdm garch(p=1,q=1,exp,asymmetric,hseries=hha) / dlogdm * * Graph the estimated standard errors for the three models * set h06 = sqrt(hh06) set h11 = sqrt(hh11) set hha = sqrt(hha) graph(key=below,header="Estimated Variances",klabels=||"ARCH6","EGARCH11","GARCH11"||) 3 # h06 1770 * # hha 1770 * # h11 1770 * * * Estimate a GARCH-M model * garch(p=1,q=1,regressors) / dlogdm # constant %garchv * * Estimate a GARCH(1,1) with an AR(1) mean model, saving the residuals * and variance estimates. * garch(p=1,q=1,reg,resids=u,hseries=h) / dlogdm # constant dlogdm{1} * * Do diagnostics on the standardized residuals. * set ustd = u/sqrt(h) set ustdsq = ustd^2 @regcorrs(qstat,number=40,dfc=1,\$ title="GARCH-LB Test") ustd @regcorrs(qstat,number=40,dfc=2,\$ title="GARCH-McLeod-Li Test") ustdsq stats ustd * * Re-estimate with t errors * garch(p=1,q=1,reg,resids=u,hseries=h,distrib=t) / dlogdm # constant dlogdm{1} * * Redo the diagnostics * set ustd = u/sqrt(h) set ustdsq = ustd^2 @regcorrs(qstat,number=40,dfc=1,\$ title="GARCH-LB Test") ustd @regcorrs(qstat,number=40,dfc=2,\$ title="GARCH-McLeod-Li Test") ustdsq * * Do a fluctuations test * garch(p=1,q=1,reg,distrib=t,derives=dd) / dlogdm # constant dlogdm{1} @flux(title="Stability Test for GARCH model") # dd