* * Examples of exponential smoothing from pp 161-172 * open data fsales.dat calendar(q) 2001 data(format=free,org=columns) 2001:1 2006:4 fsales * graph(footer="Figure 4-9 Time plot of quarterly sales data",vlabel="Sales(thousand of francs") # fsales * * Simple exponential smoothing * esmooth(estimate,initial=start,fit=sesfit) fsales @uforeerrors fsales sesfit 10 24 * * Holt's model * esmooth(trend=linear,estimate,constrain,initial=start,fit=holtfit) fsales @uforeerrors fsales holtfit 10 24 * graph(footer="Figure 4-10 Forecasts from SES and Holt's method",$ key=upleft,klabels=||"Observed Data","SES forecast","Holt's forecast"||) 3 # fsales # sesfit # holtfit * * Holt's seasonal model using a linear trend. (There's also a TREND=EXPON option * for an exponential trend). * esmooth(trend=linear,seasonal=multiplicative,initial=start,constrain,estimate,fit=seasfit) fsales @uforeerrors fsales seasfit 10 24 * * The ESMOOTH instruction includes all nine of the Pegels models. To select a * model automatically (from the in-sample fit), use the options TREND=SELECT and * SEASONAL=SELECT. In this case, it selects the exponential trend with * multiplicative seasonal, which gives a slightly better fit than the linear * trend with multiplicative seasonal. * esmooth(trend=select,seasonal=select,initial=start,constrain) fsales