Chapter 2: Trend-Line Fitting and Forecasting A time series that appears to contain a smoothly increasing (or decreasing) component is said to contain a trend term , C (t ). Examples include population, prices, global temperature (upward trends), and the cost of computing (downward trend). Of course, we can never be sure that an apparent trend will continue in the future. In principle, the best estimates of the model parameters (slope and intercept for a straight line C (t ) = a + bt , the intercept and exponent for an exponential model C (t ) = exp (a +bt )) are obtained by least squares, i.e. by choosing the parameter values which minimize Σ(xt − C (t ))2. In the case straight line curve C (t ) = a + bt , for example, we would choose a and b to minimize of the Σ(xt − a − bt )2. Here, we can use calculus to obtain formulas for the resulting least squares estimates. To forecast for a particular time t = t 0 using the curve C (t ), we simply calculate C (t 0). Removing Trends by Differencing The method of fitting trend curves described above is easy to use, but it suffers from the drawback (among others) that no serious attempt is made to model the random component of the series. In the method of differencing, we try to find filters (di f f erence f ilters ) which remove the trend so that the remaining, relatively unsmooth parts can be forecast using the sophisticated methods described in the next two chapters, and the original series then forecast by unraveling the filter. When such a filter can be found, the method of differencing is preferable to simple trend-line fitting. If the original series is xt , the di f f erenced series is yt = xt − xt −1 . Thus, yt is just the change in xt . If xt is the straight line xt = a + bt , then yt = xt − xt −1 = (a + bt ) − (a + b (t −1)) = b , so although xt contains a trend, yt does not. If xt consists of a linear term plus some other nontrending random component x ′t , then xt = a + bt + x ′t , yt = b + (x ′t − x ′t −1) , -2- so that yt will be a nontrending random series, which can be forecast by the Box-Jenkins ARMA method. Suppose that f ny , h is the forecast of yn +h (perhaps, but not necessarily, obtained by the BoxJenkins method). By definition of yt , we have xn +h = yn +h + xn +h −1 . Thus, sensible forecasts of the original series xn +h are f nx , 1 = f ny , 1 + xn f nx , h = f ny , h + f nx , h −1 , . The sequence of forecasts f nx , h for h = 1 , 2 , . . . will contain a linear trend as long as the mean of yt (an estimate of b ) is nonzero. If the true trend curve is not linear, differencing the series once will not do a complete job of trend removal. If the trend is parabolic, it can be removed by differencing twice. In general, if the trend is a k ’th order polynomial xt = a 0 + a 1t + . . . + ak t k , then it can be removed by differencing k times. Differencing is a very important and widely-used technique. It is absolutely essential to take differences when the series contains a polynomial trend term and a nontrending random component, if one wants high quality forecasts of the complete series, accounting for both the trend and random terms. The reason is that the Box-Jenkins ARMA method assumes that the series consists solely of a stationary (and therefore nontrending) random component.