* * Example of exponential smoothing from pp 153-160 * open data invent15.dat data(format=free,org=columns) 1 24 e15 * * In order to estimate the parameters, use the option ESTIMATE. * esmooth(trend=none,estimate,fit=sesfit) e15 @uforeerrors(title="Simple Exponential Smoothing") e15 sesfit 10 24 * * To get Holt's model, use the option TREND=LINEAR. The default method used by * RATS to get the initial value of the trend is to estimate the trend rate over * the full sample. To get results which match those in the text, include the * option INITIAL=START. (This isn't necessary for SES, since the smoothed value * is always set to hit the first data point exactly). The option CONSTRAIN forces * the estimated parameters into the range of [0.0,1.0). (The exponential * smoothing recursions are stable outside of that range, so RATS allows such * values to be considered). * esmooth(trend=linear,estimate,constrain,initial=start,fit=holtfit) e15 @uforeerrors(title="Holt's Model") e15 holtfit 10 24 * * To get out-of-sample forecasts, include options FORECAST=series for forecasts * and STEPS=# of forecast steps * esmooth(trend=linear,estimate,constrain,initial=start,forecast=holtfore,steps=6) e15 print / holtfore