Professional Documents
Culture Documents
8 Time Series Forecasting
8 Time Series Forecasting
◦ The fitted value is the part calculated from past data and any other available
information.
◦ The residual is the forecast error.
◦ The fitted value should include all components of the original series that can
possibly be forecast, and the leftover residuals should be unpredictable
noise.
Objective: To fit a linear trend line to monthly population and examine its
residuals for randomness.
Solution: Data file contains monthly population data for the United States
from January 1952 to December 2011. During this period, the population
has increased steadily from about 156 million to about 313 million.
To estimate the trend with regression,
use a numeric time variable
representing consecutive
months 1 through 720.
Then run a simple regression
of Population versus Time.
Example 12.2:
US Population.xlsx (slide 2 of 2)
Use Excel’s® Trendline tool to superimpose a trend line on the time series graph.
This equation is not useful for estimation; for that, a linear equation is required.
◦ You can achieve linearity by taking natural logarithms of both sides of the
equation, as shown below, where a = ln(c) and et = ln(ut).
To use this equation for forecasting the future, substitute later values of Time
into the regression equation, so that each future forecast is about 6.54%
larger than the previous forecast.
Check whether the exponential growth continued beyond 2008 by creating
the Forecast column shown below (by substituting into the regression
equation for the entire period through Q4-13).
Then use StatTools to create a time series graph of the two series Sales and
Forecast, also shown below.
The Random Walk Model
The random walk model is an example of using random series as building
blocks for other time series models.
◦ In this model, the series itself is not random.
◦ However, its differences—that is, changes from one period to the next—are
random.
◦ This type of behavior is typical of stock price data and other similar data.
◦ The equation for the random walk model is shown below, where m (mean
difference) is a constant, and et is a random series (noise) with mean 0 and a
standard deviation that remains constant through time.
◦ A series that behaves according to this random walk model has random
differences, and the series tends to trend upward (if m > 0), or downward (if m <
0) by an amount m each period (Yt – Yt-1 = m + et )
◦ If you are standing in period t and want to forecast Yt+1, then a reasonable
forecast is given by the equation below:
Example 12.4:
Stock Prices.xlsx (slide 1 of 2)
To forecast future closing prices, multiply the mean difference by the number
of periods ahead, and add this to the final closing price e.g. a forecast for the
Closing Price for Sep 2012 (5 months from April 2012) is:
53.947 + 0.418 (5) = 56.037
Moving Averages Forecasts
One of the simplest and the most frequently used extrapolation models is
the moving averages model.
◦ A moving average is the average of the observations in the past few
periods, where the number of terms in the average is the span.
◦ If the span is large, extreme values have relatively little effect on the
forecasts, and the resulting series of forecasts will be much smoother
than the original series.
◦ For this reason, this method is called a smoothing method.
◦ If the span is small, extreme observations have a larger effect on the
forecasts, and the forecast series will be much less smooth.
◦ Using a span requires some judgment:
◦ If you believe the ups and downs in the series are random noise, use a
relatively large span.
◦ If you believe each up and down is predictable, use a smaller span.
Example 12.5:
House Sales.xlsx (slide 1 of 3)
The output consists of several parts, with the summary measures MAE, RMSE,
and MAPE of the forecast errors included.
Example 12.5:
House Sales.xlsx (slide 3 of 3)
◦ The second equation says that the k-period-ahead forecast, Ft+k, made
of Yt+k in period t is essentially the most recently estimated level, Lt.
Example 12.5 (Continued):
House Sales.xlsx (slide 1 of 2)
Objective: To see how well a simple
exponential smoothing model, with an
appropriate smoothing constant, fits
the housing sales data, and to see how
StatTools implements this method.
Solution: Select Forecast from the
StatTools Time Series and Forecasting
dropdown list.
Then select the simple exponential
smoothing option in the Forecast
Settings tab, and choose a smoothing
constant.
The results are shown to the right.
Example 12.5 (Continued):
House Sales.xlsx (slide 2 of 2)
The graph below shows the forecast series superimposed on the original
series.
Holt’s Model for Trend
When there is a trend in the series, Holt’s method deals with it explicitly by
including a trend term, Tt, and a corresponding smoothing constant β.
◦ The interpretation of Lt is exactly as before.
◦ The interpretation of Tt is that it represents an estimate of the change
in the series from one period to the next.
The equations for Holt’s model are shown below:
Example 12.5 (Continued):
House Sales.xlsx (slide 1 of 2)
Objective: To see whether Holt’s
method, with appropriate
smoothing constants, captures
the trends in the housing sales
data better than simple
exponential smoothing (or
moving averages).
Solution: Implement Holt’s
method in StatTools almost
exactly as for simple exponential
smoothing.
The only difference is that you
now choose two smoothing
constants.
The output is very similar to the
simple exponential smoothing
output, except that there is now a
trend column.
Example 12.5 (Continued):
House Sales.xlsx (slide 2 of 2)
Now perform a second run of Holt’s method, using the Optimize Parameters
option.
The forecasts with nonoptimal smoothing constants are shown below, on
the left. The forecasts with optimal smoothing constants are shown below,
on the right.
Seasonal Models
Seasonality is the consistent month-to-month (or quarter-to-quarter) differences
that occur each year.
◦ The easiest way to check for seasonality is graphically: Look for a regular pattern of ups
and/or downs in particular months or quarters.
There are three basic methods for dealing with seasonality:
◦ Winters’ exponential smoothing model
◦ Deseasonalizing the data (then use any forecasting method to model the deseasonalized
data and finally “reseasonalize” these forecasts)
◦ Multiple regression with dummy variables for the seasons
Seasonal models are classified as additive or multiplicative.
◦ In an additive seasonal model, an appropriate seasonal index is added to a base
forecast.
◦ The indexes, one for each season, typically average to 0.
◦ In a multiplicative seasonal model, a base forecast is multiplied by an appropriate
seasonal index.
◦ These indexes, one for each season, typically average to 1.
Winters’ Exponential
Smoothing Model
Winters’ exponential smoothing model is very similar to Holt’s model, but it
also has seasonal indexes and a corresponding smoothing constant γ.
◦ This new smoothing constant controls how quickly the method reacts to observed
changes in the seasonality pattern.
◦ If the constant is small, the method reacts slowly.
◦ If it is large, the method reacts more quickly.
◦ The equations for this method are shown below:
Example 12.6:
Soft Drink Sales.xlsx (slide 1 of 2)