Professional Documents
Culture Documents
Anastasia
2
Objectives
• Give the fundamental rules of forecasting
3
Demand Management
4
Definition (Tersine)
??
• Forecasting is the prediction, projection, or
estimation of the occurrences of uncertain future
events or levels of activity or to predictor estimate
future demand
• Fortunately, many item produced by an organization
do not need forecasts.
• Dependent demand items such as components,
subassemblies can be calculated from the forecasts
for the end item. Forecasts should be made only
for end items (independent demand) that have an
uncertain demand.
5
Why is forecasting important?
Demand for products and services is usually uncertain.
Forecasting can be used for…
• Strategic planning (long range planning)
• Finance and accounting (budgets and cost controls)
• Marketing (future sales, new products)
• Production and operations
Predicted
demand
looking
Time back six
Jan Feb Mar Apr May Jun Jul Aug months
Actual demand (past sales)
Predicted demand
7
Some general characteristics of forecasts
8
Forecasting Time Horizons (Narasimhan)
Short-range forecast
Up to 1 year, generally less than 3 months
Purchasing, job scheduling, workforce levels, job
assignments, production levels
Medium-range forecast
3 months to 3 years or 1-3 years
Sales and production planning, budgeting
Long-range forecast
Over 5 years
New product planning, facility location, research
and development
9
Key issues in forecasting
10
Example: Mercedes E-class vs. M-class Sales
Month E-class Sales M-class Sales
Jan 23,345 -
Feb 22,034 -
Mar 21,453 -
Apr 24,897 -
May 23,561 -
Jun 22,684 -
Jul ? ?
• W
12
Types of Forecasting Models
13
• Q
Qualitative Methods
15
Time Series Forecasting
• Anything that is observed sequentially over time is a time
series
• Examples of time series data include:
– Daily IBM stock prices
– Monthly rainfall
– Quarterly sales results for Amazon
– Annual Google profits
16
Causal Method
17
Linear regression in forecasting
Alcohol Sales
Average Monthly
Temperature
19
The best line is the one that minimizes the error
20
Least Squares Method of Linear Regression
Min i
2
Y a bX
a y bx b
xy nx y
x nx
2 2
21
What does that mean?
Alcohol Sales ε ε
ε
So LSM tries to
minimize the distance
between the line and
the points!
Average Monthly
Temperature
22
Time Series Forecasting
23
Time Series Components
Trend Cyclical
Seasonal Random
24
Components
Trend
component
Demand for product or service
Seasonal peaks
Actual
demand
Average
demand over
Random four years
variation
| | | |
1 2 3 4
Year
25
Trend Component
• Persistent, overall upward or downward pattern
• Changes due to population, technology, age,
culture, etc.
• Typically several years duration
Sales
Time Time
Downward linear trend Upward nonlinear trend
26
Seasonal Component
• Regular, relatively short-term pattern of up and
down fluctuations
• Due to weather, customs, etc.
• Occurs within a single year
Number of
Period Length Seasons
Week Day 7
Month Week 4-4.5
Month Day 28-31
Year Quarter 4
Year Month 12
Year Week 52
27
Cyclical Component
• Repeating up and down movements
• Affected by business cycle, political, and economic factors
• Multiple years duration
• Often causal or associative relationships
• normally not included in short-term forecasting models
but do play a role in long-range forecasting.
1 Cycle
Sales
Year 28
Irregular/Random Component
• Erratic, unsystematic, ‘residual’ fluctuations
• Due to random variation or unforeseen events
• Short duration and nonrepeating
M T W T F
29
Time Series Plot
A time-series plot (time plot) is a two-dimensional
plot of time series data
12.00
10.00
• the horizontal axis 8.00
6.00
corresponds to the
4.00
time periods 2.00
0.00
1975
1979
1981
1983
1985
1987
1991
1993
1995
1997
1999
2001
1977
1989
Y ear
30
Time Series: Moving average
• The moving average model uses the last t periods in order to
predict demand in period t+1 by averaging the actual demand
for the last N time periods
• There can be two types of moving average models: simple
moving average and weighted moving average
• The moving average model assumption is that the most accurate
prediction of future demand is a simple (linear) combination of
past demand.
• The choice of the value of N should be determined by
experimentation and often lies within the range of 3 to 8
(Tersine) and 5 to 7 (Smith)
Large N for stable demand (response to change will be slow);
Small N for demand subject to frequent significant change
(response to change will be fast) 31
Naïve Model/Last Period Demand
et Yt Yˆt
32
Example for the Naïve Model
Similar to the naïve model, this model uses part of the historical
data to make a forecast.
In the simple moving average models the forecast value is
𝑁
𝑑 𝑡 − 1 + 𝑑 𝑡 − 2+ … .+ 𝑑 𝑡 − 𝑁 ∑ 𝑑 𝑡 −𝑖
d t′ = = 𝑖= 1
𝑁 𝑁
35
Example: forecasting sales at Kroger
Month Bottles
Jan 1,325
Feb 1,353
Mar 1,305 What will
the sales be
Apr 1,275
for July?
May 1,210
Jun 1,195
Jul ?
36
What if we use a 3-month simple moving average?
37
1400
1350 5-month
1300 MA forecast
1250
1200
1150
3-month
1100
MA forecast
1050
1000
0 1 2 3 4 5 6 7 8
What do we observe?
1000
900
Demand
800
Demand
3-Week
700
6-Week
600
500
1 2 3 4 5 6 7 8 9 10 11 12
Week
40
Last Period Demand Arithmetic Average Moving Average (2)
Month Demand Forecast Absolut Forecast Absolut Forecast Absolut
Demand Deviation Demand Deviation Demand Deviation
1 34 - - - - - -
2 44 34 10 - - - -
3 42 44 2 39 3 39 3
4 30 42 12 40 10 43 13
5 46 30 16 38 8 36 10
6 44 46 2 39 5 38 6
7 56 44 12 40 16 45 11
8 50 56 6 42 8 50 0
9 38 50 12 43 5 53 15
10 44 38 6 43 1 44 0
11 36 44 8 43 7 41 5
12 46 36 10 42 4 40 6
13 42 46 4 43 1 41 1
14 30 42 12 42 12 44 14
15 52 30 22 42 10 36 16
16 48 52 4 42 6 41 7
17 58 48 10 43 15 50 8
18 54 58 4 44 10 53 1
19 46 54 8 44 2 56 10
20 48 46 2 44 4 50 2
21 40 48 8 44 4 47 7
22 50 40 10 44 6 44 6
23 58 50 8 44 14 45 13
24 60 58 2 45 15 54 6
25 - 60 - 46 - 59 -
190 166 160
41
160/22=7,2
MAD= 190/23=8,26 MAD= 166/22=7,55 MAD= 7
Data Plot
70
60
50
40
30
20
10
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
42
Time series: Weighted Moving Average
For a 6-month
SMA, attributing
equal weights to all
past data we miss
Time the downward trend
Jan Feb Mar Apr May Jun Jul Aug
44
Example: Kroger sales of bottled water
Month Bottles
Jan 1,325
Feb 1,353
What will
Mar 1,305
be the sales
Apr 1,275 for July?
May 1,210
Jun 1,195
Jul ?
45
6-month simple moving average…
46
What if we use a weighted moving average?
Make the weights for the last three months more than the first
three months…
Average demand of the first three-months = 1,328
Average demand of the last three-months = 1,227
48
Another Example: WMA (4)
Mo(t) Demand (dt) Forecast Demand(dt') WMA (4)
1 280
2 270
3 330
4 250
5 340 {(4)(250) + (3)(330)+ (2)(270) + (1)(280)} / 10 = 284
6 330 {(4)(340) + (3)(250)+ (2)(330) + (1)(270)} / 10 = 304
7 350 {(4)(330) + (3)(340)+ (2)(250) + (1)(330)} / 10 = 317
8 300 {(4)(350) + (3)(330)+ (2)(340) + (1)(250)} / 10 = 332
9 330 {(4)(300) + (3)(350)+ (2)(330) + (1)(340)} / 10 = 325
10 350 {(4)(330) + (3)(300)+ (2)(350) + (1)(330)} / 10 = 325
11 270 {(4)(350) + (3)(330)+ (2)(300) + (1)(350)} / 10 = 334
12 290 {(4)(270) + (3)(350)+ (2)(330) + (1)(300)} / 10 = 309
13 {(4)(290) + (3)(270)+ (2)(350) + (1)(330)} / 10 = 300
14 {(4)(?) + (3)(290)+ (2)(270) + (1)(350)} / 10 = ?
49
Time Series: Double Moving Average
50
Procedure
1.Calculate Single Moving Average (SMA) as St’
2.Calculate the second moving average using
moving average St’ and denotated as St’’
3. Calculate difference between 2 MAs (at):
4. Compute trend bt :
51
Example (DMA (4))
t Demand MA (4) MA at bt Forecast Demand(dt’)
(dt) S t' (4x4) Ft+m = at + bt (m)
St''
1 140
2 159
3 136
4 157 148
5 173 156,25
6 131 149,25
7 177 159,5 153,25 165,75 4,17 d7’=F6+1=a6+b6(1)=-
8 188 167,25 158,06 176,43 6,13 d8’=F7+1=a7+b7(1)=165,75+4,17(1)=169,92
9 154 162,5 159,62 165,37 1,92 d9’=F8+1=a8+b8(1)=176,43+6,13(1)=182,56
10 179 174,5 165,93 183,06 5,71 d10’=F9+1=a9+b9(1)=165,37+1,92(1)=167,29
11 180 175,25 169,87 180,62 3,58 d11’=F10+1=a10+b10(1)=183,06+5,71(1)=188,77
12 160 168,5 170,12 166,37 -1,25 d12’=F11+1=a11+b11(1)=180,62+3,58(1)=184,2
13 d13’=F12+1=a12+b12(1)=166,37-1,25(1)=165,12
14 d14’=F12+2=a12+b12(2)=166,37-1,25(2)=163,87
52
Time Series: Exponential Smoothing (ES)
Smoothing
constant
Denotes the importance
alpha α of the past error
53
Time Series: Exponential Smoothing (ES)
54
Time Series: Exponential Smoothing (ES)
• Several approaches are followed in selecting the
smoothing constant.
– If a great amount of smoothing is desired, a small
alpha should be chosen.
– The choice of alpha is affected by the characteristics
of the time series. If sharp ups and downs are
noticed in the data, the best smoothing constant is
0.1. That is alpha chosen should equal 0.1.
– If the data show that the past is very different from
the present, then alpha of 0.9 is appropriate.
55
Exponential smoothing: the method
Assume that we are currently in period t. It is calculated the
forecast for the last period (dt-1’) and we know the actual demand
last period (dt-1) …
’
Iniatilization of F1 (d1’) can be chosen using:
1. The Value d1 or
2. The Average of first 4 -5 month actual demand (dt)
Correlation between and N :
56
Example: bottled water at Kroger
Jun ? 1,309
57
Example: bottled water at Kroger
Jun ? 1,225
58
Impact of the smoothing constant
1380
1360
1340
1320
Actual
1300
a = 0.2
1280
1260 a = 0.8
1240
1220
1200
0 1 2 3 4 5 6 7
59
Trend..
60
Impact of trend
Sales
Actual
Regular exponential
Data smoothing will always lag
Forecast behind the trend.
Can we include trend
analysis in exponential
smoothing?
Month
61
Double Exponential Smoothing
• Similar to the double moving average model.
• Also known as Brown’s double exponential smoothing
model.
• The model is represented as:
Ft m at bt m
Ft m = forecast value x periods in the future
at = the difference between the simple St’ and the
double St” smoothed values
bt = slope in a time series
m = number of periods ahead to be forecasted
62
Double Exponential Smoothing
• To compute the difference between simple and double
smoothed values:
S d t (1 ) S
t
' '
t 1
bt ( St St )
' ''
1 63
Example of DES (BROWN)
t Demand St ' St'' at bt Forecast Demand
(dt) (dt’)
Ft+m = at + bt (m)
1 143 143 143
2 152 144,8 143,36 146,24 0,36
3 161 148,04 144,3 151,784 0,936 146,6
4 139 146,23 144,68 147,781 0,387 152,72
5 137 144,39 144,62 144,148 -0,06 148,17
6 174 150,31 145,76 154,856 1,137 144,09
7 142 148,65 146,34 150,956 0,577 155,99
8 141 147,12 146,49 147,741 0,156 151,53
9 162 150,09 147,21 152,974 0,72 147,9
10 180 156,08 148,99 163,164 1,772 153,69
11 164 157,66 150,72 164,599 1,735 164,94
12 171 160,33 152,64 168,014 1,921 166,33
13 169,935
14 171,856
64
Holt’s Exponential Smoothing (DES-Holt)
• To handle linear trend, similar to the Brown’s Method.
• The difference is that in this method we smooth the
trend and the slope in the time series by using different
constants for each.
• How do we find the best combination of smoothing
constant?
• Low values of alpha and gamma should be used when
there are frequent random fluctuations in the data.
• High values of alpha and gamma should be used when
there is a pattern such as trend in the data.
65
Holt’s Exponential Smoothing (DES-Holt)
St d t (1 )( St 1 bt 1 )
bt ( St St 1 ) (1 )bt 1
Ft m S t mbt
66
Example DES-Holt α=0,2; γ=0,3
t Demand Pemulusan St Trend St Ramalan Permintaan (dt')
(dt) Nilai Ft+m = at + bt (m)
1 143 143 9
2 152 152 9
3 161 161 9 161
4 139 163,8 7,14 170
5 137 164,15 5,1 170,94
6 174 170,2 5,38 169,25
7 142 168,87 3,37 175,59
8 141 165,99 1,49 172,24
9 162 166,39 1,16 167,49
10 180 170,05 1,91 167,56
11 164 170,37 1,43 171,96
12 171 171,64 1,38 171,8
13 173,02
14 174,4
67
Winters’ Seasonal Exponential Smoothing
• Allows for both trend and seasonal patterns to be taken
into account.
• This is an extension of the Holt’s method of smoothing.
• In computing the forecast, we add an equation for
seasonality as an index.
• The forecast model is:
Ft m ( S t mbt ) * I t L m
68
Winters’ Seasonal Exponential Smoothing
69
Example of Winter’s ES
70
• S1 = 0,2 (146/I-3) + 0,8 (S0 + b0)
• Initialization b0:
– Average demand 1992 = 108,5
– Average demand 1993 = 146
– Trend difference = 146 – 108,5 = 37,5 for 1 year or for 1
quarter = 37,5/4 = 9,38 = b0
• Initialization S0:
For Quarterly: S0 = average demand – b0 (2,5)
For Monthly: S0 = average demand – b0 (6,5)
71
Determination of Initial Value
Trend Line Sales Estimates
1992 1993
Quarter 1 85,05 + 9,38 = 94,43 122,57 + 9,38 = 131,95
Quarter 2 94,43 + 9,38 = 103,81 131,95 + 9,38 = 141,33
Quarter 3 103,81 + 9,38 = 113,19 141,33 + 9,38 = 150,71
Quarter 4 113,19 + 9,38 = 122,57 150,71 + 9,38 = 160,09
Seasonal Index Estimates = demand/ trend line estimates
1992 1993 Average Adjustment
Quarter 1 146/ 94,43 = 1,55 1,46 (1,55+1,46)/ 2 = 1,51 1,51 * (4/4,07) = 1,48 = I-3
Quarter 2 96/ 103,81 = 0,92 0,9 0,91 0,91 * (4/4,07) = 0,89 = I-2
Quarter 3 0,52 0,52 0,52 0,51 = I-1
Quarter 4 1,09 1,16 1,13 1,11 = I0
4,07 4
72
•
73
S1 = 0,2 (146/1,48) + 0,8 (85,05 + 9,38) = 95,27
b1 = 0,1 (95,27 – 85,05) + 0,9 (9,38) = 9,46
F2 = (95,27 + 9,46)*0,89 = 93,21
I1 = 0,05 (146/95,27) + 0,95 (1,48) = 1,48
S2 = 0,2 (96/0,89) + 0,8 (95,27+9,46) = 105,36
b2 = 0,1 (105,36-95,27) + 0,9 (9,46) = 9,52
F3 = (105,36+9,52)*0,51 = 58,59
I2 = 0,05 (96/105,36) + 0,95 (0,89) = 0,89
74
Time Series: Regression Analysis
•• Linier pattern
75
Time Series: Regression Analysis – Cyclical pattern
• MAD
• Mean Squared Error (MSE)
• Standard Error of Estimation (SEE)
• Mean Absolute Percentage Error (MAPE)
• Mean Forecast Error (MFE) or Mean Error (ME) or Bias
78
Measuring Accuracy: MAD
d t d t'
MAD i 1
n
79
Measuring Accuracy: MSE, SEE
•
Where:
• dt = actual demand at period t
• dt’ = forecast demand at period t
• n = number of periods
f = degree of freedom (constant = 1, Linier = 2, Cyclical
Quadratic = 3, Cyclical Linier = 4). Note: SEE if is for
regression analysis
80
Measuring Accuracy: MAPE
= percengahe of error
•• PE
81
Measuring Accuracy: MFE/ME
t t
d d '
MFE i 1
n
83
An Analogy (cont’d)
On average, the
arrows hit the
bullseye (so much
for averages!)
84
MFE & MAD:
An Analogy
The forecasts
are inaccurate &
biased
85
Key Point
86
Validation: Tracking signal
The tracking signal is a measure of how often our estimations
have been above or below the actual value. It is used to decide
when to re-evaluate using a model.
n
RSFE
RSFE (d t d 't ) TS
i 1 MAD
Positive tracking signal: most of the time actual values are
above our forecasted values
Negative tracking signal: most of the time actual values are
below our forecasted values
MAD TS
Exponential
Smoothing 70 - 6.0
Forecast
Including Trend 33 - 2.0
0.4 80
Autocorrelation
70
0.2
Percent
60
0.0 50
40
-0.2 30
20
-0.4
10
-0.6
5
-0.8
-1.0 1
-100 -50 0 50 100
1 2
Re sidual
Lag
92