You are on page 1of 34

# Practice with Forecasting

Introduction

Instructions
1
2
References

1

2

Additional Instructional Resources from the Author
1

2

Practice with Forecasting
Naïve Forecast
Naïve Trend
Moving Average
Weighted Moving Average
Single Exponential Smoothing
Double Exponential Smoothing
(Measuring Forecast Accuarcy)
This file can be found online as Excel 2007 and Excel 2003 spreasheets:
http://jcflowers1.iweb.bsu.edu/rlo/PracticeWithForecasting.xlsx
http://jcflowers1.iweb.bsu.edu/rlo/PracticeWithForecasting.xls
By Jim Flowers, Ball State University
http://jcflowers1.iweb.bsu.edu
April 9, 2009
Revised September 28, 2009
Introduction
The purpose of this spreadsheet is to provide instruction on how to perform some simple
forecasting techniques, and to suggest practice.
Instructions
Procede through the numbered worksheet tabs in order.
The answers are in the final tab. Use the values specified to get the answers listed.
References
The approach take in this spreadsheet is based on the information and examples in Levin,
Rubin, & Stinson (1986).
Levin, R., Rubin, D., & and Stinson, J. (1986). Quantitative Approaches to Management. New
York: McGraw-Hill.
United States Department of Energy. (2009). CFL Market Profile - March 2009. Washington,
DC: Author. Retrieved April 7, 2009 from
Additional Instructional Resources from the Author
Forecasting Trends
http://jcflowers1.iweb.bsu.edu/rlo/trends.htm

bsu.iweb.edu/rlo/ForecastingCFLMercury.bsu.Forecasting Exercise / Example: Cumulative Release of Mercury from Compact Fluorescent Lamps http://jcflowers1.xls .iweb.edu/rlo/ForecastingCFLMercury.xlsx http://jcflowers1.

and is often superior to some very complex strategies. PRACTICE 1: Naïve Forecast Use the naïve forecast method to predict: Number of CFL manufacturers estimated for the year 2009 Year Mfgs 1999 10 2000 21 2001 48 2002 69 2003 81 2004 93 2005 96 2006 97 2007 101 2008 93 Predict: 2009 93 Answer: . Note This assumes a constant trend centered on the most recent datum.0 Formula: =+D16 Rationale: We merely entered the most recent data from 26-Jun as the forecast for 27-Jun. Example Historical Data on Mosquito Counts at Station 7 Date Mosquitoes 20-Jun 294 21-Jun 265 22-Jun 322 23-Jun 311 24-Jun 280 25-Jun 328 26-Jun 315 Predict: 27-Jun ? Answer: 315. Naïve Forecast a. Enter the most recent datum for the next forecast.1.

so with another decrease of 13 the result is 302. PRACTICE 2: Naïve Trend Use the naïve trend method to predict: Number of CFL manufacturers estimated for the year 2009 Year Mfgs 1999 10 2000 21 2001 48 2002 69 2003 81 2004 93 2005 96 2006 97 2007 101 2008 93 Predict: 2009 85. Assume the data will change as it did in the most recent period. Naïve Trend a. Example Historical Data on Mosquito Counts at Station 7 Date Mosquitoes 20-Jun 294 21-Jun 265 22-Jun 322 23-Jun 311 24-Jun 280 25-Jun 328 26-Jun 315 Predict: 27-Jun ? Answer: 302.0 Formula: =+D16+(D16-D15) Rationale: There was a decrease of 13 from 25 to 26 Jun.0 . Note This assumes a linear trend based on the most recent change between the last two data points.2.

PRACTICE 3: Moving Average Use the moving average method to predict: Number of CFL manufacturers estimated for the year 2009 Predict: Year 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 Mfgs 10 21 48 69 81 93 96 97 101 93 97 . Example Historical Data on Mosquito Counts at Station 7 Date Mosquitoes 20-Jun 294 21-Jun 265 22-Jun 322 23-Jun 311 24-Jun 280 25-Jun 328 26-Jun 315 Predict: 27-Jun ? Answer: 311. Note A moving average can eliminate minor fluctuation in the data. b. Moving Average a.2 Formula: =AVERAGE(D12:D16) Rationale: Here. Selecting the number of items (n) determines the degree of smoothing. so the average for the last five days was the preduction. n=5 was used. Use the average of the previous n data items. Determine the number (n) of data items to average.3.

n=? The solution in the Answers tab used: n=3 .

Determine the number of past items to average.0 26-Jun 315 30% 94.7 24-Jun 280 20% 56. PRACTICE 4: Weighted Moving Average Use the weighted moving average method to predict: Number of CFL manufacturers estimated for the year 2009 Year Mfgs 1999 10 2000 21 2001 48 2002 69 . Multiply each of these past data items by its weighting factor. ensuring these factors add to 1. For each item.4 Formula: =+D13*E13+D14*E14+D15*E15+D16*E16+D17*E17 Rationale: The percentages shown in Column E allowed more weight to be given to more recent data items. c. d.2 23-Jun 311 15% 46. Weighted Moving Average a.4 Answer: 311.0 or 100%. Add the products of the factors and their data items. the most recent period should cary more weight in a moving average than one that is more distant. making sure all weighting factors add up to 100%. So assign factors to each of the different historical data used in a moving average. Note Sometimes. Example Historical Data on Mosquito Counts at Station 7 Date Mosquitoes Factor Product 20-Jun 294 21-Jun 265 22-Jun 322 10% 32. b.4.5 Predict: 27-Jun ? 100% 311.0 25-Jun 328 25% 82. determine a different weighting factor.

4 in the Answers tab used: 3 50% 35% 15% .Predict: n=? The solution n= wt1 wt2 wt3 2003 2004 2005 2006 2007 2008 2009 81 93 96 97 101 93 96.

like 70% and 30%. Example Historical Data on Mosquito Counts at Station 7 Date Mosquitoes 20-Jun 294 21-Jun 265 22-Jun 322 23-Jun 311 24-Jun 280 25-Jun 328 26-Jun 315 Predict: 27-Jun ? Worksheet 60% Primary Factor: 40% Damping Factor: Date Mosquitoes Prediction 20-Jun 294 none 21-Jun 265 294 <== Enter the first datum as the first prediction. We use one of these (70%) as a factor to multiply by the previous data item. Determine two factors (Primary and Damping) that add to 100%.5. Multiply the damping factor by the last prediction. 100% is divided into two parts. Single (or Simple) Exponential Smoothing a. and the other (30%) as a damping factor to multiply by our last predication. b. Multiply the primary factor by the last datum. This tends to act as a buffer. d. 22-Jun 322 277 <== (60% * 265) + (40% * 294) = 277 23-Jun 311 304 24-Jun 280 308 25-Jun 328 291 . c. Add the products of these two calculations. Note Here. keeping the predication from being too radically effected by fluctuations in the data.

3 =+E\$21*D30+E\$22*E30 Rationale: The first predication was the datum from 20-Jun.78106 2007 101 96.5264 2005 96 89.3 PRACTICE 5: Single Exponential Smoothing Use the single exponential smoothing method to predict: Number of CFL manufacturers estimated for the year 2009 Year Mfgs 1999 10 2000 21 10 2001 48 18.16 2003 81 63. Select the adjacent cells as output.1112 Predict: 2009 94.26-Jun 27-Jun Answer: Formula: 315 313 ? 314 314.4. in this case. Enter the smoothing factor. .55621 2008 93 100. Select all historical data plus the next cell as input.632 2004 93 77.90528 2006 97 94. Alternate Method In Excel 2007 with the Analysis ToolPak Add-In: 1. 2. 3. The next (277) was 60% of 265 plus 40% of 294.8 2002 69 42. 5. Click Data Analysis on the Data Tab.42224845 Smoothing Factor: The solution in the Answers tab used: . Select Exponential Smoothing. 4. and OK. Answer: 60% Primary Factor: 40% Damping Factor: Date Mosquitoes Prediction 20-Jun 294 #N/A 21-Jun 265 294 22-Jun 322 277 23-Jun 311 304 24-Jun 280 308 25-Jun 328 291 26-Jun 315 313 27-Jun 314 314.

Primary Factor: Damping Factor: 80% 20% .

m as the first prediction. % * 294) = 277 .

.

.

9 300.4 330.2 and .1 Level at the end of t e L 16. and another to the trend.5 333. 03.53 313.80 -42.6.34 12. b.7 323.36 313.80 Time t Date 0 1 2 3 4 5 6 7 20-Jun 21-Jun 22-Jun 23-Jun 24-Jun 25-Jun 26-Jun 27-Jun Mosquitoes Prediction Error X F 294 265 322 311 280 328 315 ? 281.03.78 322.50 318.20 0.92 -27. We begin by estimating the trend.49 18.2.6 323. such as . Note As in single exponential smoothing.41 271. something small like .00 268.68 . Using the equations below apply one factor to the level. Determine two levels of adjustment factors to be multiplied by the forecast error. Example Historical Data on Mosquito Counts at Station 7 Date Mosquitoes 20-Jun 294 21-Jun 265 22-Jun 322 23-Jun 311 24-Jun 280 25-Jun 328 26-Jun 315 Predict: 27-Jun ? Worksheet Primary Factor: Secondary Factor: 0.57 43.03 Intial T 10. like . Double Exponential Smoothing a.8 279. But we also apply a smoothing factor to the trend itself. we still use a primary smoothing factor. and then the formulas self-adjust over time.51 288.

Answer: Formulas: 330. though there are means to better choose these two values. and the formula =+LINEST(D11:D14) was entered. Next cells G23 and H23 were selected. which produced the slope and intercept of the linear regression equation. These are used as starting points for the level and trend. But instead of hitting the Enter key.01 .2 and .03 arbitrarily.1 Secondary Factor: 0. PRACTICE 6: Double Exponential Smoothing Use the double exponential smoothing method to predict: Number of CFL manufacturers estimated for the year 2009 Year 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 Predict: Primary Factor: Secondary Factor: Initial Level: Initial Trend: Mfgs 10 21 48 69 81 93 96 97 101 93 ? The solution in the Answers tab used: Range for regression: 1999-2003 data Primary Factor: 0.1 21-Jun =+E\$21*D30+E\$22*E30 =+E29-D29 =+D29+E\$21*F29 Rationale: First. The forumlas used in the 21-Jun line are shown above. I clicked Ctrl-Shift Enter. the primary and secondary smoothing factors were set at .

8 279.6 323.9 300.1 .7 323.5 333.30 10.80 11.73 10.90 11.4 330. Forecast for next datum.03 10.Initial S 271 Trend at the end of t. T F 10.46 281.41 11.

=+H28+E\$22*F29 =+G29+H29 .

5 26-Jun 315 333.92 .34 12.41 MAE 26.92 -27.8 279. and Mean Absolute Percent Error.6 24-Jun 280 323. b.49 18.4 27-Jun 330.1 16.8 22-Jun 322 279.57 43.9 300. Use the formulas in Columns I-L to compute the Mean Absolute Error. Mean Squared Error. Error X F e |e| 294 265 322 311 280 328 315 281. Example Historical Data on Mosquito Counts at Station 7 Date Mosquitoes PredicationError 20-Jun 294 21-Jun 265 281. a value closer to zero means a more accurate forecast.49 18.7 323.7 23-Jun 311 323.80 -42.80 42.34 12. and MAPE Date t 0 1 2 3 4 5 6 7 Statistic Mean 20-Jun 21-Jun 22-Jun 23-Jun 24-Jun 25-Jun 26-Jun 27-Jun Mosquitoes Forecast Error Abs.80 -42.57 43. For each of these statistics. Calculate Theil's U statistic. Note Data from our double exponential smoothing forecasts to illustrate how to compute four different statistics related to forecast accuracy.41 Worksheet A to compute MAE.41 16. MSE.9 25-Jun 328 300.Measuring Forecast Accuracy a.57 43.49 18.4 330.92 27.1 16.34 12.6 323.92 -27.5 333.

0015 0. a lower statistic means better accuracy. and Theil's U for the following: Number of CFL manufacturers estimated for the year 2009 Year Mfgs Forecast .8 =+((E42-D42)/D41)^2 =+SQRT(G49/H49) Rationale: The denominator is the percent error of the naïve forecast. In all cases. though expressed here as a decimal.823 Formulas 21-Jun Theil's U Formula: Numerator 0. MSE. MAPE. but is instead a percentage of error.0031 0. Values less than 1.0598 265 281. Theil's U is computed by taking the positive square root of this fraction of the sum of the numerator values divided by the sum of the denominator values.9 5 25-Jun 328 300. Worksheet B to compute Theil's U Date Mosquitoes Forecast t X F 0 20-Jun 294 1 21-Jun 265 281.4 7 27-Jun 330. The mean absolute percent error is not based on those units.000 indicate greater accuracy. the prediction would be exactly as accurate as the naïve forecast. as a decimal.0096 0.8 =+E24-D24 =+ABS(F24) Rationale: The mean absolute error and the mean squared error are in units based on the observed values. Both base the error as a percentage of the value observed from the previous period. again.0255 0.6 4 24-Jun 280 323. The numerator is the percent error of the forecast.000. The forumlas used in the 21-Jun line are shown above.1 Sum Theil's U 0. PRACTICE: Measuring Forecast Accuracy Determine the MAE.8 2 22-Jun 322 279. If Theil's U were 1.Formulas 21-Jun 265 281.0199 0. and thus may facilitate comparing models based on different units.5 6 26-Jun 315 333. The forumlas used in the 21-Jun line are shown above.7 3 23-Jun 311 323.

0856533085 .0323202559 0.0421903505 0.0050590027 0.2082835737 0.0079045768 0.1 100.4 122.1630802 3.6 87.0079280206 0.4 2.0313411601 0.5 116.8332064 1.8 38.1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 MAE: MSE: MAPE: Theil's U Sum of Numerators: Theil's U Sum of Numerators: Theil's U: 10 21 48 69 81 93 96 97 101 93 7.7424 0.1157846 0.6 116.7 118.2 112.4 65.

92 1929.51 338.0% 15.7% 8.34 157.9% MSE .8% 876.03 MAPE 8. Percent Error |e/X| 282.1% 4.81 6.3% 13.24 1792.4% 5.Squared Error e^2 Abs.34 755.

0012 0.0099 0.=+F24^2 =+ABS(F24/D24) Denominator 0.0294 0.0016 0.0463 0.0883 =+((D42-D41)/D41)^2 .

1.21 1.19140625 0.0219478738 0.6530612245 0.0302457467 0.0017004995 0.0010405827 0.0001085069 0.0062738947 .

0 Explanation: Just choose the previous datum point from 2008. a subtraction of 8.0 Explanation: Apply the most recent change in data (in this case. PRACTICE 2: Naïve Trend Use the naïve trend method to predict: Number of CFL manufacturers estimated for the year 2009 Year Mfgs 1999 10 2000 21 2001 48 2002 69 2003 81 2004 93 2005 96 2006 97 2007 101 2008 93 Predict: 2009 85.) PRACTICE 3: Moving Average Use the moving average method to predict: Number of CFL manufacturers estimated for the year 2009 Year 1999 2000 2001 Mfgs 10 21 48 .Answers PRACTICE 1: Naïve Forecast Use the naïve forecast method to predict: Number of CFL manufacturers estimated for the year 2009 Year Mfgs 1999 10 2000 21 2001 48 2002 69 2003 81 2004 93 2005 96 2006 97 2007 101 2008 93 Predict: 2009 93.

there should be a weighting factor multiplied by the datum. it will be the average of the preceding n data items.0 There are many correct answers since different values are acceptable for n. from 2 to 10.4 n= 3 Explanation: There are many correct answers since different values are acceptable for n. In each case. PRACTICE 5: Single Exponential Smoothing Use the single exponential smoothing method to predict: Number of CFL manufacturers estimated for the year 2009 80% Primary Factor: 20% Damping Factor: Year Mfgs Prediction 1999 10 . PRACTICE 4: Weighted Moving Average Use the weighted moving average method to predict: Number of CFL manufacturers estimated for the year 2009 Year Mfgs 1999 10 2000 21 2001 48 2002 69 2003 81 2004 93 2005 96 2006 97 15% 2007 101 35% 2008 93 50% Predict: 2009 96. These factors must add to 100%.Predict: If n = If n = Explanation: 2002 2003 2004 2005 2006 2007 2008 2009 3 5 69 81 93 96 97 101 93 97.0 97. from 2 to 10.0 96. It makes more sense to give more weight to the more recent items. In each case.

4 0.6 19.2 19.5 89.1 6.5 69 65.6 77.6 100.5 16. MAPE.8 A factor of .2 93.8 -13.2 was multiplied by the previous prediction.4 0.6 93 100.4 116. and Theil's U for the following: Number of CFL manufacturers estimated for the year 2009 .7 19.7 19.7 99.1 94.4 102.6 18.2 19.4 20.2 19 -11.Predict: Smoothing Factor: Explanation: 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 21 48 69 81 93 96 97 101 93 10.1 0.2 7.4 -9.5 97.7 96 112. PRACTICE 6: Double Exponential Smoothing Use the double exponential smoothing method to predict: Number of CFL manufacturers estimated for the year 2009 19 Predict: Primary Factor: Secondary Factor: Initial Level: Initial Trend: Year t 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 0.4 17. MSE.4 PRACTICE: Measuring Forecast Accuracy Determine the MAE.8 was multipled by the previous data point.7 18.1 81. the results were summed. However.1 97 116.7 18.5 101 118.8 93 122.6 -3.6 47.0 18.0 20.6 29. other examples that used different weighting factors would have different results.8 42.7 18.2 63.7 48 38.0 18.0 21 7. and .4 68.8 96.02 -11.6 96.2 Mfgs PredictionError Level at theTrend at the X F e L T 10 -11.4 116.9 94.0 19.5 81 87.0 116.

24 91.63 52.8 38.56 174.44 29.4 65.20 9.58 -3.5 116.1% 2.02 21.21 16.8332 Error Abs.64 245.58 3.85 11.44 29.83 304.66 37.41 6.2 112.75 13.21 16.13 7.20 -9.Year 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 Mfgs 10 21 48 69 81 93 96 97 101 93 Forecast 7.6 116.41 6.72 17.6 87.1631 3.7 118.56 13.1 100.10 873.46 19.4 122.72 17.4 Mean Sum MAE: MSE: MAPE: Theil's U Sum of Numerators: Theil's U Sum of Denominators: Theil's U: 13.1158 0.07 388.02 .46 19. Error Squared Error e |e| e^2 -13.64 245.02 271.13 7.

.

.

7 118.5 116.1 100.6 87.4 122.8 38.Forecast for next datum.8 .4 136. F 7.4 65.2 112.6 116.

9% 7.8% Numerator Denominator 1.1% .2083 0.2100 1.0051 0.0079 0.0001 0.8% 17.0313 0.Abs.0% 4.0323 0. Percent Error |e/X| 62.0079 0.1914 0.0010 0.6531 0.0857 1.6% 7.1631 3.0219 0.0063 2.0422 0.9% 20.2% 20.3% 17.1158 21.0017 0.0302 0.3% 31.7424 0.