Sie sind auf Seite 1von 34

Practice with Forecasting

Introduction

Instructions
1
2
References

Additional Instructional Resources from the Author


1

Practice with Forecasting


Nave Forecast
Nave Trend
Moving Average
Weighted Moving Average
Single Exponential Smoothing
Double Exponential Smoothing
(Measuring Forecast Accuarcy)
(Answers)
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
http://www.energystar.gov/ia/products/downloads/CFL_Market_Profile.pdf
Additional Instructional Resources from the Author
Forecasting Trends
http://jcflowers1.iweb.bsu.edu/rlo/trends.htm

Forecasting Exercise / Example: Cumulative Release of Mercury from Compact Fluorescent


Lamps
http://jcflowers1.iweb.bsu.edu/rlo/ForecastingCFLMercury.xlsx
http://jcflowers1.iweb.bsu.edu/rlo/ForecastingCFLMercury.xls

1. Nave Forecast
a. Enter the most recent datum for the next
forecast.
Note

This assumes a constant trend centered on the most recent datum,


and is often superior to some very complex strategies.

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.0
Formula:
=+D16
Rationale: We merely entered the most recent data from 26-Jun as the forecast
for 27-Jun.
PRACTICE 1: Nave Forecast
Use the nave 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:

2. Nave Trend
a. Assume the data will change as it did in the
most recent period.
Note

This assumes a linear trend based on the most recent change


between the last two data points.

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, so with another
decrease of 13 the result is 302.
PRACTICE 2: Nave Trend
Use the nave 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.0

3. Moving Average
a. Determine the number (n) of data items to
average.
b. Use the average of the previous n data items.
Note

A moving average can eliminate minor fluctuation in the data.


Selecting the number of items (n) determines the degree of
smoothing.

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.2
Formula:
=AVERAGE(D12:D16)
Rationale: Here, n=5 was used, so the average for the last five days was the
preduction.
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

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

4. Weighted Moving Average


a. Determine the number of past items to
average.
b. For each item, determine a different weighting
factor, making sure all weighting factors add
up to 100%.
c. Multiply each of these past data items by its
weighting factor.
d. Add the products of the factors and their data
items.
Note

Sometimes, the most recent period should cary more weight in a


moving average than one that is more distant. So assign factors to
each of the different historical data used in a moving average,
ensuring these factors add to 1.0 or 100%.

Example
Historical Data on Mosquito Counts at Station 7
Date Mosquitoes Factor
Product
20-Jun
294
21-Jun
265
22-Jun
322
10%
32.2
23-Jun
311
15%
46.7
24-Jun
280
20%
56.0
25-Jun
328
25%
82.0
26-Jun
315
30%
94.5
Predict:
27-Jun
?
100%
311.4
Answer:
311.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.
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

Predict:
n=?
The solution
n=
wt1
wt2
wt3

2003
2004
2005
2006
2007
2008
2009

81
93
96
97
101
93
96.4

in the Answers tab used:


3
50%
35%
15%

5. Single (or Simple) Exponential


Smoothing
a. Determine two factors (Primary and Damping)
that add to 100%.
b. Multiply the primary factor by the last datum.
c. Multiply the damping factor by the last
prediction.
d. Add the products of these two calculations.
Note

Here, 100% is divided into two parts, like 70% and 30%. We use one
of these (70%) as a factor to multiply by the previous data item, and
the other (30%) as a damping factor to multiply by our last
predication. This tends to act as a buffer, keeping the predication
from being too radically effected by fluctuations in the data.

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.
22-Jun
322
277 <== (60% * 265) + (40% * 294) = 277
23-Jun
311
304
24-Jun
280
308
25-Jun
328
291

26-Jun
27-Jun
Answer:
Formula:

315
313
?
314
314.3
=+E$21*D30+E$22*E30

Rationale: The first predication was the datum from 20-Jun. The next (277) was
60% of 265 plus 40% of 294.
Alternate Method
In Excel 2007 with the Analysis ToolPak Add-In:
1. Click Data Analysis on the Data Tab.
2. Select Exponential Smoothing, and OK.
3. Select all historical data plus the next cell as input.
4. Select the adjacent cells as output.
5. Enter the smoothing factor, in this case, .4.

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.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.8
2002
69
42.16
2003
81
63.632
2004
93
77.5264
2005
96 89.90528
2006
97 94.78106
2007
101 96.55621
2008
93 100.1112
Predict:
2009 94.42224845
Smoothing Factor:
The solution in the Answers tab used:

Primary Factor:
Damping Factor:

80%
20%

m as the first prediction.


% * 294) = 277

6. Double Exponential Smoothing


a. Determine two levels of adjustment factors to be
multiplied by the forecast error, such as .2 and .
03.
b. Using the equations below apply one factor to
the level, and another to the trend.
Note

As in single exponential smoothing, we still use a primary smoothing


factor, like .2. But we also apply a smoothing factor to the trend itself,
something small like .03. We begin by estimating the trend, and then the
formulas self-adjust over time.

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.20
0.03

Intial T
10.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.8
279.7
323.6
323.9
300.5
333.4
330.1

Level at the end of t


e

16.80
-42.34
12.57
43.92
-27.49
18.41

271.00
268.36
313.53
313.51
288.78
322.50
318.68

Answer:
Formulas:

330.1
21-Jun =+E$21*D30+E$22*E30 =+E29-D29 =+D29+E$21*F29

Rationale: First, the primary and secondary smoothing factors were set at .2 and .03
arbitrarily, though there are means to better choose these two values.
Next cells G23 and H23 were selected, and the formula
=+LINEST(D11:D14) was entered. But instead of hitting the Enter key, I
clicked Ctrl-Shift Enter, which produced the slope and intercept of the
linear regression equation. These are used as starting points for the level
and trend.
The forumlas used in the 21-Jun line are shown above.

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
Secondary Factor:
0.01

Initial S
271
Trend at the end of t.

Forecast for next datum.


T
F

10.80
11.30
10.03
10.41
11.73
10.90
11.46

281.8
279.7
323.6
323.9
300.5
333.4
330.1

=+H28+E$22*F29

=+G29+H29

Measuring Forecast Accuracy


a. Use the formulas in Columns I-L to compute the
Mean Absolute Error, Mean Squared Error, and
Mean Absolute Percent Error.
b. 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. For each of
these statistics, a value closer to zero means a more accurate forecast.

Example
Historical Data on Mosquito Counts at Station 7
Date Mosquitoes PredicationError
20-Jun
294
21-Jun
265
281.8
22-Jun
322
279.7
23-Jun
311
323.6
24-Jun
280
323.9
25-Jun
328
300.5
26-Jun
315
333.4
27-Jun
330.1

16.80
-42.34
12.57
43.92
-27.49
18.41

Worksheet A to compute MAE, MSE, 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. Error

|e|

294
265
322
311
280
328
315

281.8
279.7
323.6
323.9
300.5
333.4
330.1

16.80
-42.34
12.57
43.92
-27.49
18.41

16.80
42.34
12.57
43.92
27.49
18.41

MAE
26.92

Formulas

21-Jun

265

281.8 =+E24-D24

=+ABS(F24)

Rationale: The mean absolute error and the mean squared error are in units based on
the observed values. The mean absolute percent error is not based on
those units, but is instead a percentage of error, and thus may facilitate
comparing models based on different units. In all cases, a lower statistic
means better accuracy.
The forumlas used in the 21-Jun line are shown above.

Worksheet B to compute Theil's U


Date
Mosquitoes Forecast
t
X
F
0
20-Jun
294
1
21-Jun
265
281.8
2
22-Jun
322
279.7
3
23-Jun
311
323.6
4
24-Jun
280
323.9
5
25-Jun
328
300.5
6
26-Jun
315
333.4
7
27-Jun
330.1
Sum
Theil's U
0.823
Formulas
21-Jun
Theil's U Formula:

Numerator

0.0255
0.0015
0.0199
0.0096
0.0031

0.0598
265

281.8

=+((E42-D42)/D41)^2
=+SQRT(G49/H49)

Rationale: The denominator is the percent error of the nave forecast, though
expressed here as a decimal. The numerator is the percent error of the
forecast, again, as a decimal. Both base the error as a percentage of the
value observed from the previous period.
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.
If Theil's U were 1.000, the prediction would be exactly as accurate as the
nave forecast. Values less than 1.000 indicate greater accuracy.
The forumlas used in the 21-Jun line are shown above.

PRACTICE: Measuring Forecast Accuracy


Determine the MAE, MSE, MAPE, and Theil's U for the following:
Number of CFL manufacturers estimated for the year 2009

Year

Mfgs Forecast

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.8
38.4
65.6
87.1
100.2
112.5
116.7
118.4
122.6
116.4

2.1630802
3.1157846
0.8332064

1.7424
0.2082835737
0.0050590027
0.0079045768
0.0079280206
0.0313411601
0.0421903505
0.0323202559
0.0856533085

Squared Error
e^2

Abs.
Percent
Error
|e/X|

282.24
1792.34
157.92
1929.34
755.51
338.81

6.3%
13.1%
4.0%
15.7%
8.4%
5.8%

876.03

MAPE
8.9%

MSE

=+F24^2

=+ABS(F24/D24)

Denominator

0.0463
0.0012
0.0099
0.0294
0.0016

0.0883
=+((D42-D41)/D41)^2

1.21
1.6530612245
0.19140625
0.0302457467
0.0219478738
0.0010405827
0.0001085069
0.0017004995
0.0062738947

Answers
PRACTICE 1: Nave Forecast
Use the nave 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.0
Explanation:
Just choose the previous datum point from 2008.
PRACTICE 2: Nave Trend
Use the nave 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.0
Explanation:

Apply the most recent change in data (in this case, a


subtraction of 8.)

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

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.0
96.0

There are many correct answers since different values


are acceptable for n, from 2 to 10. In each case, it will
be the average of the preceding n data items.

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.4
n=
3
Explanation:

There are many correct answers since different values


are acceptable for n, from 2 to 10. In each case, there
should be a weighting factor multiplied by the datum.
These factors must add to 100%. It makes more sense
to give more weight to the more recent items.

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

Predict:
Smoothing Factor:
Explanation:

2000
2001
2002
2003
2004
2005
2006
2007
2008
2009

21
48
69
81
93
96
97
101
93

10.0
18.8
42.2
63.6
77.5
89.9
94.8
96.6
100.1
94.4

0.8
A factor of .8 was multipled by the previous data point,
and .2 was multiplied by the previous prediction; the
results were summed. However, other examples that
used different weighting factors would have different
results.

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.1
0.02
-11.2
19

-11.2

Mfgs PredictionError
Level at theTrend at the
X
F
e
L
T
10
-11.2
19.0
21
7.8
-13.2
19.7
18.7
48
38.4
-9.6
47.0
18.5
69
65.6
-3.4
68.7
18.5
81
87.1
6.1
81.6
18.6
93
100.2
7.2
93.7
18.7
96
112.5
16.5
97.6
19.1
97
116.7
19.7
99.0
19.5
101
118.4
17.4
102.7
19.8
93
122.6
29.6
96.0
20.4
116.4
116.4
0.0
116.4
20.4

PRACTICE: Measuring Forecast Accuracy


Determine the MAE, MSE, MAPE, and Theil's U for the following:
Number of CFL manufacturers estimated for the year 2009

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.8
38.4
65.6
87.1
100.2
112.5
116.7
118.4
122.6
116.4

Mean
Sum
MAE:
MSE:
MAPE:
Theil's U Sum of Numerators:
Theil's U Sum of Denominators:
Theil's U:

13.64
245.02
21.1%
2.1631
3.1158
0.8332

Error

Abs.
Error

Squared
Error

|e|

e^2

-13.20
-9.58
-3.41
6.13
7.21
16.46
19.72
17.44
29.56

13.20
9.58
3.41
6.13
7.21
16.46
19.72
17.44
29.56

174.24
91.85
11.66
37.63
52.02
271.07
388.83
304.10
873.75

13.64

245.02

Forecast for next datum.


F
7.8
38.4
65.6
87.1
100.2
112.5
116.7
118.4
122.6
116.4
136.8

Abs.
Percent
Error
|e/X|
62.9%
20.0%
4.9%
7.6%
7.8%
17.2%
20.3%
17.3%
31.8%

Numerator

Denominator

1.7424
0.2083
0.0051
0.0079
0.0079
0.0313
0.0422
0.0323
0.0857

1.2100
1.6531
0.1914
0.0302
0.0219
0.0010
0.0001
0.0017
0.0063

2.1631

3.1158

21.1%

Das könnte Ihnen auch gefallen