** Use in Chapter 9 **** all 0 888:1 open data m-ibmspln.dat data(org=obs) / r1 r2 set h1 = 45.0 set h2 = 20.0 set q = 0.8 nonlin a0 a1 b1 a00 a11 b11 d11 f11 c1 c2 p1 p3 t0 t1 t2 frml a1t = r1(t)-c1-p1*r1(t-1)-p3*r2(t-2) frml a2t = r2(t)-c2 frml v1 = a0+a1*a1t(t-1)**2+b1*h1(t-1) frml qt = t0 + t1*q(t-1) + t2*a2t(t-1) frml bt = a2t(t) - (q(t)=qt(t))*a1t(t) frml v2 = a00+a11*bt(t-1)**2+b11*h2(t-1)+f11*h1(t-1)+d11*a1t(t-1)**2 frml gdet = -0.5*(log(h1(t) = v1(t))+ log(h2(t)=v2(t))) frml garchln = gdet-0.5*(a1t(t)**2/h1(t)+bt(t)**2/h2(t)) smpl 5 888 compute c1 = 1.4, c2 = 0.7, p1 = 0.1, f1 = -.03, d11=.04, f11=-.06 compute p2 = 0.1, p3 = -0.1, p0 = 0.1, t0 =0.2, t1 = 0.1, t2 = 0.1 compute a0 = 1.0, a1 = 0.08, a2 = 0.02, b1 = 0.87 compute a00 = 2.0, a11 = 0.05, b11 = 0.8 *maximize(method=simplex,iterations=10) garchln nlpar(criterion=value,cvcrit=0.00001) maximize(method=bhhh,recursive,iterations=250) garchln set fv1 = v1(t) set resi1 = a1t(t)/sqrt(fv1(t)) set residsq = resi1(t)*resi1(t) *** Checking standardized residuals *** cor(qstats,number=12,span=4) resi1 *** Checking squared standardized residuals *** cor(qstats,number=12,span=4) residsq set fv2 = v2(t)+qt(t)**2*v1(t) set resi2 = a2t(t)/sqrt(fv2(t)) set residsq = resi2(t)*resi2(t) *** Checking standardized residuals *** cor(qstats,number=12,span=4) resi2 *** Checking squared standardized residuals *** cor(qstats,number=12,span=4) residsq *** Last few observations needed for forecasts *** set rhohat = qt(t)*sqrt(v1(t)/fv2(t)) set shock1 = a1t(t) set shock2 = a2t(t) set g1 = v1(t) set g2 = v2(t) set g3 = qt(t) print 885 888 shock1 shock2 fv1 fv2 rhohat g1 g2 g3