Вы находитесь на странице: 1из 10

C H A P T E R

2 1

Forecasting Models
Chapter Guide. In decision making, we deal with devising future plans. The data describing the decision situation must thus be representative of what occurs in the future. For example, in inventory control, we base our decisions on the nature of demand for the controlled item during a specified planning horizon. Also, in financial planning, we need to predict the pattern of cash flow over time. The chapter presents three forecasting techniques: moving average, exponential smoothing, and regression. Excel-based spreadsheet computations of these techniques are also given. This chapter includes 3 solved examples, 3 Excel applications, 9 end-of-section problems, and 1 case. The case is in Appendix E on the CD. The AMPL/Excel/Solver/ TORA programs are in folder ch21Files.

21.1

MOVING AVERAGE TECHNIQUE This technique assumes that the time series is stable, in the sense that its data, yt, for period t, can be represented as yt = b + et where b = Unknown constant parameter estimated from historical data et = Random 1noise2 component for period t with zero mean and constant variance. The technique assumes that the data for the different periods are not correlated. The moving average technique assumes that the most recent n observations are equally important in estimating the parameter b. Thus, at a current period t, if the data for the most recent n periods are yt - n + 1, yt - n + 2, p , and yt, then the estimated value for period t + 1 is computed as y*+ 1 = t yt - n + 1 + yt - n + 2 + n

+ yt

CD-37

CD-38

Chapter 21

Forecasting Models

There is no exact rule for selecting the moving average base, n. If the variations in the variable remain reasonably constant over time, a large n is recommended. Otherwise, if the data exhibit change patterns, a small value of n is advisable. In practice, the value of n ranges between 2 and 10.

Example 21.1-1
The demand (in number of units) for an inventory item over the past 24 months is summarized in Table 21.1. Use the moving average technique to forecast next months demand 1t = 252. To select a reasonable value for the number of periods, n, over which the moving average is computed, first examine the nature of the given data. The data in Table 21.1 show that the demand yt exhibits an upward trend with time. Generally speaking, this trend means that the moving average would not be a good predictor over a long planning horizon. In particular, the use of a large base, n, for the moving average is not advisable in this case, because it will suppress the data trend. On the other hand, if we use a small n, we will be in a better position to capture the nature of the trend in the data. If we use n = 3, the estimated demand for next month 1t = 252 will equal the average of the demands for months 22 to 24; that is, y* = y* = 68 units 25 24 The estimated demand of 68 units for t = 25 is also used as an estimate for t = 26; that is, x* = 26 70 + 72 + 68 = 70 units 3

When the actual demand for t = 25 becomes known, we should use it to re-estimate the demand for t = 26 as the average for periods 23, 24, and 25.

TABLE 21.1 Month, t 1 2 3 4 5 6 7 8 9 10 11 12 Demand, yt 46 56 54 43 57 56 67 62 50 56 47 56 Month, t 13 14 15 16 17 18 19 20 21 22 23 24 Demand, yt 54 42 64 60 70 66 57 55 52 62 70 72

21.1

Moving Average Technique

CD-39

Excel Moment The moving average computations are part of the statistical package of Excel. To use this module, first enter the data in contiguous cells in a single column. Next, from the Excel menu bar, select Tools 1 Data Analysis 1 Moving Average to produce a dialogue box that allows you to specify the cells where the input data are stored as well as the cells where you want to store the output results. Figure 21.1 demonstrates the application of Excels moving average to Example 21.1-1 (file excelEx21.1-1.xls). The top part is the dialogue box. The chart can be requested as part of the output.
FIGURE 21.1 Application of Excel moving average method to Example 21.1-1 (file excelEx21.1-1.xls)

CD-40

Chapter 21

Forecasting Models

PROBLEM SET 21.1A


1. In Example 21.1-1, estimate the demand for t = 25 based on n = 12. What effect does larger n have on suppressing the trend of the data? 2. The number of air conditioning units sold over the past 24 months is given in Table 21.2. Analyze the data from the standpoint of the applicability of the moving average technique. 3. Table 21.3 gives the number of individuals who visit a tourist area by car and air over a 10-year period. Analyze the data from the standpoint of the applicability of the moving average technique. 4. Table 21.4 gives the sales in millions of dollars for a department store. Analyze the data from the standpoint of the applicability of the moving average technique. 5. The U of A offers off-campus courses at five different locations around the state. Table 21.5 summarizes the enrollment data over a 6-year period. The data for each year are categorized by semester: fall (1), spring (2), and summer (3). It is desired to use these data to estimate the enrollment for next year. Analyze the given data from the standpoint of the applicability of the moving average technique.

TABLE 21.2 Mo 1 2 3 4 5 6 7 8 9 10 11 12 Sales 25 15 30 38 58 62 85 88 60 40 40 38 Mo 13 14 15 16 17 18 19 20 21 22 23 24 Sales 40 35 50 60 66 90 105 85 60 55 50 45

TABLE 21.3 Yr Car Air 1980 1042 500 1981 1182 522 1982 1224 540 1983 1338 612 1984 1455 715 1985 1613 790 1986 1644 840 1987 1699 900 1988 1790 935 1989 1885 980

TABLE 21.4 Yr Sales 1980 21.0 1981 23.2 1982 23.2 1983 24.0 1984 24.9 1985 25.6 1986 26.6 1987 27.4 1988 28.5 1989 29.6

21.2
TABLE 21.5

Exponential Smoothing

CD-41

Course location Semester 1989 1 2 3 1990 1 2 3 1991 1 2 3 1992 1 2 3 1993 1 2 3 1994 1 2 3 231 259 102 88 66 23 2 3 0 0 0 0 1 27 0 226 241 125 102 110 46 22 16 7 16 0 0 30 24 12 269 301 119 149 113 50 17 25 14 90 54 17 51 28 6 240 261 138 126 134 48 31 19 9 104 83 56 46 38 32 227 239 101 108 106 50 41 46 15 108 128 54 28 43 16 288 247 117 136 150 69 48 49 14 165 168 61 59 46 15 1 2 3 4 5

21.2

EXPONENTIAL SMOOTHING The exponential smoothing technique assumes that the process is constant or changes slowly with time, the same assumption used in the moving average method. However, it is designed to alleviate a drawback in the moving average method. Specifically, exponential smoothing places a larger weight on the most recent observation, whereas in the moving average method all observations are assigned equal weights. Define a10 6 a 6 12 as the smoothing constant, and assume that the time series points for the past t periods are y1, y2, , yt. Then, y*+ 1, the estimate for period t + 1 t is computed as y*+ 1 = ayt + a11 - a2yt - 1 + a11 - a22yt - 2 + t Because the respective coefficients of yt, yt - 1, yt - 2, are progressively smaller, the new procedure puts more weight on the more recent data points. The formula for computing y*+ 1 can be simplified as follows: t y*+ 1 = ayt + 11 - a25ayt - 1 + a11 - a2yt - 2 + a11 - a22yt - 3 + 6 t = ayt + 11 - a2y* t

CD-42

Chapter 21

Forecasting Models

In this manner, y*+ 1 can be computed recursively from y*. The recursive equation is t t started by skipping the estimate y1 * at t = 1 and taking the estimate for t = 2 equal to the actual data value for t = 1that is, y* = y1. Actually, any reasonable procedure 2 can be used to start the computations. For example, some suggest estimating y* as the 0 average of a reasonable number of periods at the start of the time series. The selection of the smoothing constant a is crucial in estimating future forecasts. A large value of a implies that recent observations carry heavier weights. In practice, the value of a lies between .01 and .30. Example 21.2-1
Apply the exponential smoothing technique to the data in Example 21.11. Use a = .1. The computations are started by skipping y1 * and assuming that y2* = y1 = 46 units. To illustrate the recursive computations, we have y* = ay2 + 11 - a2y* = .1 * 56 + .9 * 46 = 47 3 2

y* = ay3 + 11 - a2y* = .1 * 54 + .9 * 47 = 47.7 4 3 File excelEx21.2-1.xls provides the dialogue box and the output of Excels exponential smoothing module applied to the data of Example 21.2-1.The module is accessed using the same steps as in the moving average module (Section 21.1). Note that Excel uses the damping factor 1= 1 - a2, which is the complement of the smoothing constant 1= a2. From the given computations, the estimate for t = 25 is computed as y* = ay24 + 11 - a2y* 25 24 = .11722 + .9157.632 = 59.07 units This estimate is considerably different from that given by the moving average 1= 68 units2. A larger value of a will produce a closer estimate for t = 25.

PROBLEM SET 21.2A


1. Apply exponential smoothing with a = .2 to the following data: (a) Problem 2, Set 21.1a. (b) Problem 3, Set 21.1a. (c) Problem 4, Set 21.1a. (d) Problem 5, Set 21.1a.

21.3

REGRESSION Regression analysis determines the relationship between a dependent variable (e.g., demand for an item) and an independent variable (e.g., time). The general regression formula between the independent variable, x, and the dependent variable, y, is given as y = b0 + b1x + b2x2 + + bnxn + e

21.3

Regression

CD-43

The constants b0, b1, , bn are unknown parameters to be determined from available data. The random error e has a zero mean and a constant standard deviation. The simplest form of the regression model assumes that the dependent variable varies linearly with timethat is, y* = a + bx The constants a and b are determined using the least-squares criterion, which minimizes the sum of the squares of the differences between observed and estimated values. Given the ith raw data point, 1yi, xi2, i = 1, 2, , n, the sum of the squares of the deviations between observed and estimated values is defined as S = a 1yi - a - bxi22
i=1 n

The values of a and b are determined by solving the following necessary conditions for the minimization of S: n 0S = -2 a 1yi - a - bxi2 = 0 0a i=1
n 0S = -2 a 1yi - a - bxi2xi = 0 0b i=1

After some algebraic manipulations, we obtain the following solution:


n

b =

i=1 n

a yixi - ny x
2 2 a xi - nx

i=1

a = y - bx where
n n i=1

a xi n ,y =

x =

i=1

a yi n

The equations show that we need to compute b first, from which a can be computed. The estimates of a and b are valid for any probability distribution of yi. However, if yi is normally distributed with a constant standard deviation, a confidence interval can be established on the mean value of the estimator at x = x0 (i.e., y0 = a + bx0) as 1a + bx 02 ; ta, n - 2 i = 1 2 Q n - 2
n * 2 a 1yi - y i 2

1 + n

1x0 - x22

i=1

2 2 a xi - nx

For future (predicted) values of the dependent variable, y, we are interested in determining its prediction interval (rather than the confidence interval on its mean value).

CD-44

Chapter 21

Forecasting Models

As would be expected, the prediction interval of a future value is wider than the confidence interval on the mean value. Indeed, the formula for the prediction interval is the 1 same as that for the confidence interval, except that the term n under the second square 1n + 12 root is replaced with n . We can test how well the linear estimator y* = a + bx fits the raw data by computing the correlation coefficient, r, using the formula B
n i=1 n

a yixi - ny x
n

r =

a a x2 - nx2 b a a y2 - ny 2 b i i
i=1 i=1

where -1 r 1. If r = ;1, then a perfect linear fit exists between x and y. In general, the closer the value of r to 1, the better is the linear fit. If r = 0, then y and x may or may not be independent, in the sense that two dependent variables may yield r = 0. Example 21.3-1
Apply the linear regression model to the data in Example 21.1-1, which are repeated in Table 21.6 for convenience. From the data in Table 21.6, we get
24 i=1 24 i=1 24 i=1 24 i=1 24 i=1 2 2 a yixi = 17,842, a xi = 300, a xi = 4900, a yi = 1374, a yi = 80,254

Hence, x = 12.5, y = 57.25 b = 17,842 - 24 * 57.25 * 12.5 4900 - 24 * 12.52 = .58

a = 57.25 - .58 * 12.5 = 50

TABLE 21.6 Month, xi 1 2 3 4 5 6 7 8 9 10 11 12 Demand, yi 46 56 54 43 57 56 67 62 50 56 47 56 Month, xi 13 14 15 16 17 18 19 20 21 22 23 24 Demand, yi 54 42 64 60 70 66 57 55 52 62 70 72

21.3 The estimated demand is thus given as y* = 50 + .58x For example, at x = 25, y* = 50 + .581252 = 64.5 units. The correlation coefficient is computed as r = 214900 - 24 * 12.522180,254 - 24 * 57.2522 17,842 - 24 * 57.25 * 12.5

Regression

CD-45

= .493

The relatively low value of r shows that y* = 50 + .58x may not be a good linear fit for the raw data. Normally, a reasonable fit requires .75 r 1. Suppose that we wish to compute the 95% confidence interval for the given linear estimator. First, we need to compute the sum of the squares of the deviations about the fitted line. Table 21.7 summarizes this information. From the t-tables in Appendix B, t.025,22 = 2.074. Hence, the desired confidence interval is computed as 150 + 58x02 ; 2.074 1205.64 1x0 - 12.522 1 + A 124 - 22 B 24 4900 - 24 * 12.52

TABLE 21.7 x 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
24

y 46 56 54 43 57 56 67 62 50 56 47 56 54 42 64 60 70 66 57 55 52 62 70 72

y* 50.58 51.16 51.74 54.32 52.90 53.48 54.06 54.64 55.22 55.80 56.38 56.96 57.54 58.12 58.70 59.28 59.86 60.44 61.02 61.60 62.18 62.76 63.34 63.92

1y - y*22 20.98 23.43 5.11 86.86 16.81 6.35 167.44 54.17 27.25 0.04 87.98 0.92 12.53 259.85 28.09 0.52 102.82 30.91 16.16 43.56 103.63 0.58 44.36 65.29

i=1

*2 a 1yi - yi 2 = 1205.64

CD-46

Chapter 21

Forecasting Models B

This can be simplified to 150 + .58x02 ; 15.35

.042 +

1x0 - 12.522 1150

To illustrate the computation of the prediction interval, suppose that we are interested in establishing a prediction interval on the demand estimate for next month 1x0 = 252. In this case, the coefficient .042 must be replaced with 1.042, and the resulting prediction interval is computed as 164.5 ; 16.662 or (47.84, 81.16). We thus say that there is a 95% chance that the demand at x = 25 will fall between 47.84 units and 81.16 units.

Excel Moment The computations associated with regression analysis are typically tedious. Fortunately, we never need to use hand computations. Excel (among others) provides a convenient way to automate these calculations. File excelEx21.3-1.xls shows how the spreadsheet can be used to carry out regression analysis. A complete output report including all necessary information is generated by Excel. Again, regression in Excel is a module in Data Analysis under the Tools menu.

PROBLEM SET 21.3A


1. Apply linear regression to the following data sets: (a) Problem 2, Set 21.1a. (b) Problem 3, Set 21.1a. (c) Problem 4, Set 21.1a. (d) Problem 5, Set 21.1a. 2. In linear regression, prove that the sum of differences between the predicted and estimated values over all the data points always equals zerothat is,
* a 1yi - yi 2 = 0 n

i=1

REFERENCES
Brown, B.L., and R. T. OConnell, Forecasting and Time Series: An Applied Approach, Duxbury Press, Belmont, CA, 1993 Brown, R.G., Smoothing, Forecasting, and Prediction of Discrete Time Series, Prentice Hall, Upper Saddle River, NJ, 1972. Dent,Warren, and Joseph Swanson,Managerial forecasting by super sophisticated nave models, Interfaces, Vol. 6, pp. 6777, 1975. Also commentary in Interfaces, Vol. 6, No. 1, Part 1, pp. 2831, 1975. Montgomery, D., and E, Peck, Introduction to Linear Regression Analysis, Wiley, New York, 1991. Willis, R.E., A Guide to Forecasting for Planners and Managers, Prentice Hall, Upper saddle River, NJ, 1987.

Вам также может понравиться