* This file contains SHAZAM commands for estimation of an * ARCH(3) model by the Engle (Econometrica, 1982) iterative * estimation method. This can be compared with maximum * likelihood estimation of ARCH models that is implemented * with the SHAZAM HET command. * SAMPLE 1 256 GENR E=1 GENR U=NOR(1) SAMPLE 4 256 * Generate ARCH(3) errors - by recursive calculations GENR E=U*SQRT(1+0.4*(LAG(E)**2)+0.2*(LAG(E,2)**2)+0.1*(LAG(E,3)**2)) * Generate observations SAMPLE 1 256 GENR X1=UNI(3) GENR X2=X1*X1 GENR Y=1.0+1.5*X1-0.3*X2+E * Estimate an ARCH(3) model - by maximum likelihood HET Y X1 X2 / ARCH=3 **************************************************************** * Estimate an ARCH(3) model - by iterative Engle method **************************************************************** * Use OLS to get starting values OLS Y X1 X2 / RESID=E COEF=PB GENR E2=E*E OLS E2 E2(1.3) / COEF=PA PREDICT=H SET NODOECHO DO %=1,20 ********************************************** * Scoring step for beta ********************************************** SAMPLE 4 253 GENR S=1/H GENR R=1/H DO #=1,3 GENR S=S-PA(#)*( LAG(E2,-#) - LAG(H,-#) ) / (LAG(H,-#)**2) GENR R=R+2*E2*PA(#)*PA(#)/(LAG(H,-#)**2) ENDO GENR R=SQRT(R) GENR BY=E*S/R GENR BX1=X1*R GENR BX2=X2*R ?OLS BY BX1 BX2 R / NOCONSTANT COEF=BSTEP STDERR=BERR GEN1 BSIG2=\$SIG2 GEN1 BR2=\$R2 * Update beta SAMPLE 1 3 GENR PB=PB+BSTEP * Calculate new residuals and conditional variance function SAMPLE 1 256 ?OLS Y X1 X2 / INCOEF=PB RESID=E GENR E2=E*E ?OLS E2 E2(1.3) / INCOEF=PA PREDICT=H ********************************************** * Scoring step for alpha ********************************************** SAMPLE 4 256 GENR AC=1/H GENR AY=(E2-H)/H DO #=1,3 GENR EX#=LAG(E2,#)/H ENDO ?OLS AY EX1 EX2 EX3 AC / NOCONSTANT COEF=ASTEP STDERR=AERR GEN1 ASIG2=\$SIG2 GEN1 AR2=\$R2 * Update alpha SAMPLE 1 4 GENR PA=PA+ASTEP SAMPLE 1 256 ?OLS E2 E2(1.3) / INCOEF=PA PREDICT=H * Check for convergence ENDIF ((BR2+AR2).LT.0.0001) ENDO ********************************************** * Calculate standard errors and print results ********************************************** SAMPLE 1 3 GENR BERR=BERR/SQRT(BSIG2) GENR TB=PB/BERR PRINT PB BERR TB SAMPLE 1 4 GENR AERR=SQRT(2)*AERR/SQRT(ASIG2) GENR TA=PA/AERR PRINT PA AERR TA STOP