open greene18_2.gdt # log of quarterly U.S. nominal GNP, 1950:1 to 1983:4 genr y = log(Y) # and its first difference genr dy = diff(y) # log of real money supply (for ARMAX) genr realm = log(M1/P) # reserve 2 years for out-of-sample forecast smpl ; 1981:4 # Estimate using ARIMA arima 2 1 0 ; y 0 realm # grab fitted values genr fit1 = $yhat # and forecast over full period smpl --full fcast fc1 # Return to sub-sample and do ARMA on first difference of y smpl ; 1981:4 arma 2 0 ; dy 0 realm genr fit2 = $yhat smpl --full fcast fc2 # generate series from fc1 which should agree with fc2: note the # static and dynamic components genr fcdiff = (t<=1982:1)? (fc1 - y(-1)) : (fc1 - fc1(-1)) # compare the forecasts print y fc1 fc2 fcdiff --byobs # generate series from fit1 which should agree with fit2 genr fitdiff = fit1 - y(-1) # compare fitted values print y fit1 fit2 fitdiff --byobs