* * Example 8/2/6 from pp 415-418 * open data housing.dat calendar(m) 1983 data(format=free,org=columns) 1983:1 1989:10 housing construct rates * * AR1 is a more efficient instruction for doing maximum likelihood estimation of * a regression with AR1 errors. * ar1(method=maxl,define=firsteq) housing * 1988:10 # constant construct{0 to 6} rates{0 to 9} * * Check residuals * @regcorrs * boxjenk(ar=1,constant,inputs=2,define=transfer,maxl) housing * 1988:10 # construct 5 0 0 # rates 3 0 5 * uforecast(equation=firsteq,static) firstfore 1988:11 1989:10 uforecast(equation=transfer,static) transfore 1988:11 1989:10 @uforeerrors(title="Step 1 Model") housing firstfore @uforeerrors(title="Transfer Function Model") housing transfore * * Simpler models cited in text * boxjenk(ar=2,sar=1,constant,maxl,define=arimaeq) housing * 1988:10 uforecast(equation=arimaeq,static) arimafore 1988:11 1989:10 @uforeerrors(title="SARIMA model") housing arimafore * * In order to get comparable results for exponential smoothing, we have to use * two ESMOOTH instructions; one to estimate the parameters over the estimation * range used for the other models, and another to get the one-step forecasts. * Note that the forecasts that ESMOOTH produces directly are multiple step * forecasts, not the series of one-step forecasts needed for this. Instead, we * need the in-sample fitted values. * esmooth(seasonal=additive,estimate,constrain) housing * 1988:10 esmooth(seasonal=additive,alpha=%esalpha,gamma=%esgamma,fitted=esfore) housing * 1989:10 @uforeerrors(title="ES model") housing esfore 1988:11 1989:10