* * Example TABLE6-8.DAT from pp 219-221 * open data table6-8.dat data(format=free,org=columns) 1 30 demand * * Single exponential smoothing * esmooth(alpha=0.15,smoothed=single) demand * * Brown's double exponential smoothing * esmooth(trend=linear,alpha=0.15,gamma=0.15,initial=start,smoothed=double,fitted=fitted) demand set error = demand-fitted * * Note that, because of a different choice for the initial value of b (with * INITIAL=START, ESMOOTH chooses Y(2)-Y(1), so the ES recursions hit the first * two values exactly), the results are slightly different at the end of the * sample, and more noticeably different at the start. * print(picture="*.###") / demand single double fitted error graph(footer="Figure 6-4 Single and Double Exponential Smoothing",key=below) 4 # demand # single # double # fitted * * Building table 6-9 requires a bit of programming. RATS can optimize parameter * choices for the Holt model (next section in book), but not Brown's. Note, also, * that the results are somewhat different, again because of the different choice * for initializing the recursions. The minimum here is .10, though it's fairly * flat for most of the range from .05 to .20. * * DOFOR loops over a set of instructions, with the values of an index being taken * from a list. %rss is the sum of squared residuals, and %nobs is the number of * observations, so the RSE is the square root of %rss/%nobs * dofor [real] alpha = .02 .05 .10 .12 .14 .15 .16 .18 .20 .25 .30 .70 esmooth(trend=linear,alpha=alpha,gamma=alpha,initial=start,noprint) demand disp alpha sqrt(%rss/%nobs) end dofor