* * GARCHUVMAX.RPF * Examples of estimates of univariate GARCH models using MAXIMIZE. * * RATS User's Guide, example from Section 9.3.10. * open data garch.asc data(format=free,org=columns) 1 1867 bp cd dm jy sf * set dlogdm = 100*log(dm/dm{1}) * * Estimate a GARCH(1,1) with an AR(1) mean model * garch(p=1,q=1,reg) / dlogdm # constant dlogdm{1} * * Same model estimated using MAXIMIZE * linreg dlogdm # constant dlogdm{1} frml(lastreg,vector=beta) meanf nonlin(parmset=meanparms) beta * set uu = %seesq set h = %seesq set u = 0.0 * nonlin(parmset=garchparms) c a b compute a=.05,b=.75,c=%seesq*(1-a-b) frml varf = c+a*uu{1}+b*h{1} * * This computes the variance first, since the mean formula *can* depend upon * current H (in an "M" model), while the variance has to be computed from lagged * information. * frml logl = (h(t)=varf(t)),(u=dlogdm-meanf),\$ (uu(t)=u^2),%logdensity(h,u) maximize(parmset=meanparms+garchparms) logl 3 * * * Parameter sets used in some of the models * nonlin(parmset=powerparms) lambda nonlin(parmset=asymmparms) d **************************************************************************** * * AVGARCH (absolute value) * frml varf = (c+a*sqrt(uu{1})+b*sqrt(h{1}))^2 compute c=sqrt(%seesq) maximize(parmset=meanparms+garchparms,title="Absolute Value GARCH") logl 3 * **************************************************************************** * * NGARCH (non-linear (power) GARCH) * compute lambda=2.0 frml varf = (c+a*uu{1}^(.5*lambda)+b*h{1}^(.5*lambda))^(2.0/lambda) compute c=%seesq maximize(parmset=meanparms+garchparms+powerparms,title="Non-linear GARCH") logl 3 * **************************************************************************** * * APARCH (asymmetric power GARCH) * compute lambda=2.0 frml varf = uupower=uu{1}^(.5*lambda),\$ (c+a*uupower+d*%if(u{1}<0,uupower,0.0)+b*h{1}^(.5*lambda))^(2.0/lambda) compute c=%seesq,d=0.0 maximize(parmset=meanparms+garchparms+asymmparms+powerparms,title="Asymmetric power GARCH") logl 3 * **************************************************************************** * * ZARCH (threshold). This could be done as APARCH with lambda pegged to 1.0 * frml varf = uupower=sqrt(uu{1}),(c+a*uupower+d*%if(u{1}<0,uupower,0.0)+b*sqrt(h{1}))^2.0 compute c=%seesq maximize(parmset=meanparms+garchparms+asymmparms,title="ZARCH") logl 3 * ***************************************************************************** ***************************************************************************** * * Models with an recentering of the news impact curve can't use the * lagged u^2 terms. * * AGARCH (asymmetric with recentering) * frml varf = (c+a*(u{1}+d)^2+b*h{1}) compute d=0.0 compute c=%seesq maximize(parmset=meanparms+garchparms+asymmparms,title="AGARCH") logl 3 * ***************************************************************************** * * NAGARCH (non-linear asymmetric) * frml varf = (c+a*(u{1}+d*sqrt(h{1}))^2+b*h{1}) compute d=0.0 compute c=%seesq maximize(parmset=meanparms+garchparms+asymmparms,title="NAGARCH") logl 3 *