************************ * This program performs ARCH(3) Estimation. ************************ all 0 300:1 open data m-intc.dat * data(org=obs) / rt dat * * define the log-likelihood recursively * set h = 0.0 * nonlin mu a0 a1 * frml at = rt(t) - mu frml gvar = a0 + a1*at(t-1)**2 frml garchlog = -0.5*log(h(t)=gvar(t))-0.5*at(t)**2/h(t) * smpl 4 300 * * initial values * compute mu = 0.01, a0 = 0.01, a1 = 0.2 * maximize(method=bhhh,recursive,iterations=100) garchlog * * Select the estimation method: bhhh * Specify that the function is recursively defined and increase the number * of iterations from 20 (default) to 100. * set et = at(t) set fvar = gvar(t) set resi = at(t)/sqrt(fvar(t)) set resisq = resi(t)*resi(t) *** Checking standardized residuals *** cor(qstats,number=20,span=10) resi *** Checking squared standardized residuals *** cor(qstats,number=20,span=10) resisq *** Last few observations needed for forecasts *** print 295 300 rt et resi fvar