* * Example TABLE6-5.DAT from pp 215-217 * open data table6-5.dat data(format=free,org=columns) 1 12 data * * The MA(3) filter shown is done with FILTER with the options TYPE=LAGGING and * WIDTH=3. (TYPE=LAGGING means that it uses current and lagged values only, as * opposed to the centered filter, which uses future values as well, and is used * for smoothing). * filter(type=lagging,width=3) data / ma3 set fore3 = ma3{1} set err3 = data-fore3 print / data ma3 fore3 err3 * filter(type=lagging,width=3) ma3 / ma3x3 * set trend = 2.0/(3-1)*(ma3-ma3x3) * * The one-step-ahead forecasts are obtained by lagging one period all the * components of (6-12) and (6-13). * set forecast = 2*ma3{1}-ma3x3{1}+trend{1} set foreerr = data-forecast * print / data ma3 ma3x3 forecast foreerr