* * Example of moving average smoothing, pp 143-145 * data(unit=input) 1 11 shipments 200 135 195 197.5 310 175 155 130 220 277.5 235 * * The filter instruction with TYPE=LAGGING computes the average of the input data * for periods t,t-1,...,t-span+1 * filter(type=lagging,span=3) shipments / ma3 filter(type=lagging,span=5) shipments / ma5 * * The forecast values for t is just the smoothed value for t-1. This instruction * handles that. * set ma3fore = ma3{1} set ma5fore = ma5{1} * * This analyzes the forecasts errors * @uforeerrors(title="MA(3) forecasts") shipments ma3fore @uforeerrors(title="MA(5) forecasts") shipments ma5fore * graph(footer="Figure 4-4 Shipments of Electric Can Openers with Moving Average Forecasts",$ key=attached,klabels=||"Observed values","MA(3)","MA(5)"||) 3 # shipments # ma3fore # ma5fore