* This SHAZAM command file uses the ARIMA command to estimate the models * for the Wholesale Price Index reported in Table 2.4 (page 109) of * Walter Enders, APPLIED ECONOMETRIC TIME SERIES, Wiley, 1995. * * After each ARIMA estimation the results are saved in the variable TABLE * and the table of results is then printed at the finish of the model * estimation. * * The SHAZAM results have differences from Enders. The results in * Enders were produced with RATS. The following differences should * be noted when comparing results from SHAZAM and RATS. * * ALGORITHM DIFFERENCES * (1) RATS uses a least squares estimation procedure like SHAZAM. * The RATS manual indicates that a Gauss-Newton algorithm is used. * SHAZAM uses a version of Marquardt's algorithm with numerical * derivatives. * (2) SHAZAM computes pre-sample values of the residuals by a * back-forecasting method as described in Box-Jenkins. * However, RATS does not use backcasting. RATS assumes that residuals * are zero for all unobservable periods. This may explain * numerical differences between RATS and SHAZAM. * * REPORTING DIFFERENCES * (1) RATS and SHAZAM use different signs for the MA coefficients. * Therefore, the SHAZAM user needs to reverse the sign of the MA * coefficient to give a comparison with the results from RATS. * (2) RATS and SHAZAM use a different calculation method for the AIC and SC * statistics. SHAZAM computes: * AIC = LOG(SIG2) + 2 * K / N * SC = LOG(SIG2) + K * LOG(N) / N * RATS computes: * AIC = N * LOG(SSE) + 2 * K * SC = N * LOG(SSE) + K * LOG(N) * -------------------------------------------------------------------------- * Prepared by Diana Whistler, Revision date: Oct. 10, 1995 * e-mail: diana@shazam.econ.ubc.ca * -------------------------------------------------------------------------- SAMPLE 1 130 READ WPI / BYVAR 30.7 30.8 30.7 30.7 30.8 30.5 30.5 30.6 30.7 30.6 30.7 30.7 30.6 30.5 30.6 30.7 30.7 30.6 30.7 30.7 30.9 31.2 31.4 31.6 32.1 32.2 32.6 32.4 32.3 32.3 32.4 32.5 32.9 33.1 33.3 33.4 33.9 34.4 34.7 35.0 35.5 35.7 35.9 35.9 36.5 36.9 37.2 37.2 37.9 38.3 38.8 39.2 41.1 43.1 44.9 45.3 48.3 50.0 53.6 55.4 55.4 56.0 57.2 57.8 58.1 59.0 59.7 60.2 61.6 63.0 63.1 63.9 65.4 67.4 68.4 70.0 72.5 75.1 77.4 80.2 83.9 85.6 88.4 90.4 93.1 95.2 95.9 95.8 96.6 96.7 97.1 97.2 97.3 97.6 98.6 99.1 100.2 100.8 100.6 100.3 100.1 100.2 99.5 100.1 98.6 96.8 96.3 96.7 97.8 99.4 100.5 101.0 101.6 103.2 104.7 105.2 107.5 109.4 109.0 109.4 111.0 110.8 112.8 116.2 113.8 112.7 112.5 112.7 112.4 113.6 SAMPLE 1 124 DIM TABLE 18 5 * Estimate models with logarithmic first differences ARIMA WPI / LOG NDIFF=1 NAR=1 COEF=B1 TRATIO=T1 TESTSTAT=Q MATRIX TABLE(1,1)=B1(2) MATRIX TABLE(2,1)=T1(2) MATRIX TABLE(3,1)=B1(1) MATRIX TABLE(4,1)=T1(1) PROC STATS DO #=COL,COL MATRIX TABLE(13,#)=$SSE MATRIX TABLE(14,#)=$N*LOG($SSE) + 2*$K MATRIX TABLE(15,#)=$N*LOG($SSE) + $K*LOG($N) MATRIX TABLE(16,#)=Q(12) MATRIX TABLE(17,#)=Q(24) MATRIX TABLE(18,#)=Q(30) ENDO PROCEND GEN1 COL=1 EXEC STATS ARIMA WPI / LOG NDIFF=1 NAR=2 COEF=B2 TRATIO=T2 TESTSTAT=Q MATRIX TABLE(1,2)=B2(3) MATRIX TABLE(2,2)=T2(3) MATRIX TABLE(3,2)=B2(1) MATRIX TABLE(4,2)=T2(1) MATRIX TABLE(5,2)=B2(2) MATRIX TABLE(6,2)=T2(2) GEN1 COL=2 EXEC STATS ARIMA WPI / LOG NDIFF=1 NAR=1 NMA=1 COEF=B3 TRATIO=T3 TESTSTAT=Q MATRIX TABLE(1,3)=B3(3) MATRIX TABLE(2,3)=T3(3) MATRIX TABLE(3,3)=B3(1) MATRIX TABLE(4,3)=T3(1) * Reverse sign of the MA coefficient to be consistent with RATS MATRIX TABLE(7,3)=-B3(2) MATRIX TABLE(8,3)=-T3(2) GEN1 COL=3 EXEC STATS ARIMA WPI / LOG NDIFF=1 NAR=1 NMA=4 RESTRICT START COEF=B4 TRATIO=T4 TESTSTAT=Q .5 .5 0 0 .1 .01 MATRIX TABLE(1,4)=B4(6) MATRIX TABLE(2,4)=T4(6) MATRIX TABLE(3,4)=B4(1) MATRIX TABLE(4,4)=T4(1) MATRIX TABLE(7,4)=-B4(2) MATRIX TABLE(8,4)=-T4(2) MATRIX TABLE(11,4)=-B4(5) MATRIX TABLE(12,4)=-T4(5) GEN1 COL=4 EXEC STATS ARIMA WPI / LOG NDIFF=1 NAR=1 NMA=2 COEF=B5 TRATIO=T5 TESTSTAT=Q MATRIX TABLE(1,5)=B5(4) MATRIX TABLE(2,5)=T5(4) MATRIX TABLE(3,5)=B5(1) MATRIX TABLE(4,5)=T5(1) MATRIX TABLE(7,5)=-B5(2) MATRIX TABLE(8,5)=-T5(2) MATRIX TABLE(9,5)=-B5(3) MATRIX TABLE(10,5)=-T5(3) GEN1 COL=5 EXEC STATS FORMAT(8X,5F12.4) PRINT TABLE / FORMAT STOP