Forecasting Theory
- Time Series Models

An example of a time series for 25 periods is plotted in Fig. 1 from the numerical data in Table 1. The data might represent the weekly demand for some product. We use x to indicate an observation and t to represent the index of the time period. The observed demand for time t is specifically designated . The data from 1 through T is: . The lines connecting the observations on the figure are provided only to clarify the picture and otherwise have no meaning.

Table 1. Weekly demand for weeks 1 through 30

Figure 1. A time series of weekly demand



Mathematical Model


Our goal is to determine a model that explains the observed data and allows extrapolation into the future to provide a forecast. The simplest model suggests that the time series is a constant with variations about the constant value determined by a random variable .

The upper case represents the random variable that is the unknown demand at time t, while the lower case is a value that has actually been observed. The random variation about the mean value is called the noise, . The noise is assumed to have a mean value of zero and a specified variance. The variations in two different time periods are independent. Specifically

A more complex model includes a linear trend for the data.

Of course (1) and (3) are special cases of a polynomial model.

A model for a seasonal variation might include transcendental functions. The cycle of the model below is 4. The model might be used to represent data for the four seasons of the year.

In every model considered here, the time series is a function only of time and the parameters of the models. We can write

Since for any given time the value of f is a constant and the expected value of is zero,

The model supposes that there are two components of variability for the time series; the variation of the mean value with time and the noise. Time is the only factor affecting the mean value, while all other factors are described by the noise component. Of course, these assumptions may not in fact be true, but this section is devoted to cases that can be abstracted to this simple form with reasonable accuracy.

One of the problems of time series analysis is to find the best form of the model for a particular situation. In this introductory discussion we are primarily concerned about the simple constant or trend models. We leave the problem of choosing the best model to a more advanced discussion.

In the following paragraphs we describe methods for fitting the model, forecasting from the model and measuring the accuracy of the forecast. We illustrate the discussion of this section with the moving average forecasting method. Several other methods are described on later pages.


Fitting Parameters of the Model


Once a model is selected and data is available, it is the job of the statistician to find parameter values that best fit the historical data. We can only hope that the resulting model will provide good predictions of future observations.

Statisticians usually assume all values in a given sample are equally valid. For time series however, most methods recognize that data from recent times are more representative of current conditions than data from times well in the past. Influences governing the data almost certainly change with time and a method should have the capability of neglecting old data while favoring the new. A model estimate should be able to change over time to reflect changing conditions.

In this discussion, the time series model includes one or more parameters. We identify the estimated values of these parameters with hats on the parameter notation.

The procedures also provide estimates of the standard deviation of the noise . Again the estimate is indicated with a hat, .

To illustrate these concepts consider the data in Table 1. Say that the statistician has just observed the demand in period 20. She also has available the demands for periods 1 through 19. She cannot know the future, so the information shown as 21 through 30 is not available. The statistician thinks that the factors that influence demand are changing very slowly, if at all, and proposes the simple constant model for the demand as in Eq. 1.

With the assumed model, the values of demand are random variables drawn from a population with mean value b. The best estimator of b is the average of the observed data. Using all 20 points the estimate is

This is the best estimate that can be found from the 20 data points. It can be shown that this estimate minimizes the sum of squares of the errors. We note, however, that first data point is given the same weight as the last in the computation. If we think that the model is actually changing over time, perhaps it is better to use a method that gives less weight to old data and more to the new. One possibility is to include only later data in the estimate. Using the last ten observations and the last five we obtain

The latter two estimates are called moving averages because the range of the observations averaged is moving with time. Which is the better estimate for the application? We really can't tell at this point. The estimator that uses all data points will certainly be the best if the time series follows the assumed constant model, however, if the situation is actually changing, perhaps the estimator with only five data points is better.

In general, the moving average estimator is the average of the last m observations.

The quantity m is the moving average interval and is the parameter of this forecasting method.


Forecasting from the Model


The purpose of modeling a time series is usually to make forecasts of the future. The forecasts are used directly for making decisions such as ordering replenishments for an inventory or staffing workers for production. They might also be used as part of a mathematical model for a more complex decision analysis.

The current time is T, and the data for the actual demands for times 1 through T are known. Say we are attempting to forecast the demand at time . The unknown demand is the random variable , and its ultimate realization is . Our forecast of the realization is . Of course the best that we can hope to do is estimate the mean value of . Even if the time series actually follows the assumed model, the future value of the noise is unknowable.

Assuming the model is correct

The parameters of the forecast are estimated from the data for times 1 through T. Using a specific value of in this formula provides the forecast for time . When we look at the last T observations as only one of the possible time series that could have been observed, the forecast is a random variable. We should be able to describe the probability distribution of the random variable, including its mean and variance.

For the moving average example, the statistician adopts the model

Assuming T is 20 and using the moving average with ten periods, the estimated parameter is

Since this model has a constant expected value over time, the forecast is the same for all future periods.

Assuming the model is correct, the forecast is the average of m observations all with the same mean and standard deviation, . Since the noise is normally distributed, the forecast is also normally distributed with mean b and standard deviation



Measuring the Accuracy of the Forecast


Table 2 shows a series of forecasts for periods 11 through 20 using the data from Table 1. The forecasts are obtained with a moving average using m equal to 10 and equal to 1.

Table 2. Forecast errors

Although in practice one might round the forecasts to an integers, we keep fractions here to observe better statistical properties. The error of the forecast is the difference between the observation and the forecast.

One common measure of forecasting error is the mean absolute deviation, MAD.

where n error observations are used to compute the mean.

The sample variance of error is also a useful measure. The standard deviation is the square root of the sample variance.

Here is the average error, and n is the number of observations. As n grows the MAD provides a reasonable estimate of the sample standard deviation.

From the example data we compute the MAD and standard deviation for the ten observations.

MAD = (8.7 + 2.4 + … + 0.9)/10 = 4.11 and

We see that 1.25(MAD) = 5.138 is approximately equal to the sample standard deviation.

The time series used as an example is simulated with a constant mean. Deviations from the mean are normally distributed with mean zero and standard deviation 5. The error standard deviation includes the combined effects of errors in the model and the noise so one would expect a value greater than 5. Of course, a different realization of the simulation will yield different statistical values.

The Excel worksheet constructed by the Forecasting add-in illustrates the computation for the example data. The data is in column B. Column C holds the moving averages and the one-period forecasts are in column D. The error in column E is the difference between columns B and D for rows that have both data and forecast. The standard deviation of the error is in cell E6 and the MAD is in cell E7.

Return to Top

tree roots

Operations Management / Industrial Engineering
by Paul A. Jensen
Copyright 2004 - All rights reserved

Next Page