Demand Forecasting
Demand Forecasting
Demand Forecasting
INDE 6641
Demand Forecasting
1 Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Role of Forecasting in a Supply Chain
Forecasting: is the basis for all Planning Decisions in a Supply Chain
2
Characteristics of Forecasts
Forecasts are always “inaccurate”.
• Therefore, Forecasts should include both the expected value of Forecast &
a measure of Forecast Error.
The longer into the future the Forecast is, the less accurate it will be.
3
Forecasting Methods
Forecasting Methods are classified as:
1. Qualitative & Judgmental Method
2. Time Series Models
3. Explanatory or Causal Models
4
Forecasting Methods – Cont’d
1. Qualitative or Judgmental Method: Most appropriate when:
No Historical Data are available or
Human Expertise and Knowledge are required
Examples:
• Identifying future Opportunities and Threats as part of a SWOT Analysis (Strengths, Weakness, Opportunities, and
Threats)
• Incorporating Non-quantitative Information (such as impact of Government Regulations or Competitor Behavior)
in a Qualitative Forecast.
6
Important Points in Forecasting Process
Effective Forecasting involves:
1. Understand objective of Forecasting.
7
Time Series
A Time Series is a stream of Historical Data
Many Forecasts are based on analysis of Historical Time Series Data
Assumption: Future is an extrapolation of the Past.
Components of Time Series
• Randomness
• Trend
• Seasonal Effects
• Cyclical Effects
8
Forecast Notation
: Observed Values at Period
• {, t>=1} is the Time Series we predict for
• : is Current Period
• uses Data up to
9
Evaluating Forecasts (Forecast Accuracy)
Forecast Error is define as:
𝑬 𝒕= 𝑭 𝒕 − 𝑫 𝒕
∑ |𝐸𝑡|
Mean Absolute Error (MAE): 𝑀𝐴 𝐸 = 𝑡=1
𝑛
√
𝑛
[ | | ]
𝑛
𝐸𝑡
∑ 𝐷𝑡
Mean Absolute Percentage Error (MAPE): 𝑡 =1
𝑀𝐴𝑃𝐸= × 100
𝑛
10
Evaluating Forecasts (Forecast Accuracy) – Example 1
[ | | ]
𝑛
𝑛
𝐸𝑡
∑
𝑛
∑ |𝐸𝑡| ∑ 𝐸 𝑡2
𝐸𝑡 = 𝐹 𝑡 − 𝐷𝑡 𝑀𝐴 𝐸 = 𝑡 =𝑡 𝑀𝑆𝐸 = 𝑡 =1 𝑀𝐴𝑃𝐸=
𝑡 =1 𝐷𝑡
× 100
𝑛 𝑛 𝑛
[ | | ] [ | | ]
𝑛 𝑛 𝑛
𝐸𝑡 𝑛
𝐸𝑡
Obs. Forecast
𝑛
∑ |𝐸𝑡|
𝑛
12
Forecasting Stationary Time Series
Stationary Time Series:
Time Series are Stationary if they do not have Trend or Seasonal Effects. (The only Component
is Randomness)
Forecasting Methods for Stationary Time Series are:
• Simple Moving Average
• Weighted Moving Average
• Exponential Smoothing
13
Forecasting Stationary Time Series – Simple Moving Average
t 1
D i
Dt 1 Dt 2 Dt N
Ft i t N
N N
14
Simple Moving Average – Example 3
t 1
D i
Dt 1 Dt 2 Dt N Arithmetic Average of the N most Recent Observations
Ft i t N
N N
Note:
In Simple Moving Average approach, Data are equally weighted, which is not desirable.
• Because we might wish to assign more Weights on Recent Observation than the Older ones.
Alternative Method:
Weighted Moving Average:
Weights are adjusted to reflect fluctuations in Data.
We assign more Weights on Recent Observations.
t 1
WMAt Wi Di
i t N
W 1 i
16
Weighted Moving Average – Example 4
Three-Month Weighted Moving Average: WMA (3)
Weights are:
∑ 𝒘𝒊=𝟏
• 0.5 for the most Recent Period (the last period)
• 0.33 for the next most Recent Period 𝒘 𝟐 =𝟎 .𝟑𝟑 𝒘 𝟑 =𝟎 .𝟏𝟕
𝒘 𝟏 =𝟎 .𝟓
• 0.17 for the least Recent Period
Three-Month
Three-Month Weighted
Weighted
Month
Month
Orders
Orders per
per Moving
Moving Average
Average
April:
Month
Month WMA(3)
WMA(3) March 0.5
January 120
January
February 120
90 February 0.33
February
March 90
100 January 0.17
April
March 75
100
May
April 110
75 100.10 (0.5)(100)+(0.33)(90)+(0.17)(120)=100.10
June
May 50
110 85.80
July
June
75
50 96.75 May:
August 130
July
September 75
110 74.05 April 0.5
August
October 130
90 72.70 March 0.33
November
September -
110 98.25
February 0.17
October 90 110.65
November - 103.40 (0.5)(75)+(0.33)(100)+(0.17)(90)=85.80
17
Weighted Moving Average – Example 4 – Cont’d
Errors Calculation : Mean Absolute Error (MAE) & Mean Square Error (MSE)
∑ |𝐸𝑡| ∑ 𝐸 𝑡2 𝟕𝟐𝟒𝟗 . 𝟖𝟗
𝟏𝟖𝟔 . 𝟕𝟎 𝑀𝑆𝐸 = 𝑡 =1 = =1035.70
𝑀𝐴 𝐸 = 𝑡=1 = =26.67 𝑛 𝟕
𝑛 𝟕
18
Forecasting Stationary Time Series – Exponential Smoothing
Exponential Smoothing (unequal Weight to Data points)
𝐹 𝑡 =𝜶 𝐷𝒕 − 𝟏+(𝟏 − 𝜶) 𝐹 𝒕 −𝟏 0 <𝜶 ≤ 1
a is called “Smoothing" Constant
19
Exponential Smoothing – Example 5
The Observed number of Engine Failures for eight Quarters is given in table below.
Forecast the Engine Failure using Exponential Smoothing Method.
Assume: & F1 = 200
20
Effect of a – Example
Demand for Personal Computers
Forecast • The Smoothing Constant α is usually chosen
Period Month Demand α=0.30 α=0.50 by Experimentation.
1 January 37 37.00 37.00
• Different values of α, affect "how quickly"
2 February 40 37.00 37.00
3 March 41 37.90 38.50
the Forecast Model responds to changes in
4 April 37 38.83 39.75 Time Series Data.
5 May 45 38.28 38.38 For Example:
6 June 50 40.30 41.69 • For a value of α = 0, Forecast will be the
7 July 43 43.21 45.84 same as last Period’s Forecast.
8 August 47 43.15 44.42
9 September 56 44.30 45.71 • For a value of α = 1, Forecast will be the last
10 October 52 47.81 50.86 Period’s Actual Observation
11 November 55 49.07 51.43 α=0
12 December 54 50.85 53.21 𝐹 𝑡 =𝐹 𝑡 −1
𝐹 𝑡 =𝛼 𝐷𝑡 −1 + ( 1− 𝛼 ) 𝐹 𝑡 −1 α=1 𝐹 𝑡 =𝐷𝑡 −1
21
Effect of a – Example
• The closer α is to 1, the quicker the Forecast Model responds to changes in Time Series Data.
Because it assigns more Weights on recent Actual Observation than the Forecast.
• The closer α is to 0, more Weight is put on prior Forecast. Therefore, Forecast Model will
respond to changes more slowly.
General Rule: The closer α is to 1 the better
Exponential Smoothing Forecasts 𝐹 𝑡 =𝛼 𝐷𝑡 −1 + ( 1− 𝛼 ) 𝐹 𝑡 −1
60
50 α=1 𝐹 𝑡 =𝐷𝑡 −1
40
α=0
Demand
30
𝐹 𝑡 =𝐹 𝑡 −1
20
10
0
0 2 4 6 8 10 12 14
Period
Demand Alpha=0.3 Alpha=0.5
22
Forecasting Stationary Time Series – Practice (Class Activity)
The Observed number of Demands for seven Periods is given in table below.
Period Demand
1 50
2 52
3 54
4 67
5 42
6 51
7
b) Calculate Mean Squared Error (MSE) for all Methods. Please explain which Method performs
better and why.
23
Forecasting Models With Linear Trends
Time Series with Trends: Data points are Random & have Trend Effect but they do not
have Seasonal Effect.
Common Forecasting Models with Trends are:
• Double Exponential Smoothing (Holt’s Trend/Model)
• Regression Analysis: Regression-Based Forecasting
24
Double Exponential Smoothing (Holt’s Trend/Model)
Two Exponential Smoothing Constants ():
• one for Intercept ()(value of series)
• one for Slope ()
𝑺 𝒕 =𝛼 𝐷 𝑡 +(1 −𝛼)( 𝑆𝑡 − 1+ 𝐺𝑡 −1) Intercept (level)
Period 1: we are forecasting for , using information from previous Period () 𝐹 0 ,𝟏=𝑺 𝟎 + 𝑮𝟎
Period 2: we are forecasting for , using information from previous Period () 𝐹 1 ,𝟐=𝑺 𝟏+ 𝑮𝟏
25
Double Exponential Smoothing (Holt’s Trend/Model) – Example 6
Use Double Exponential Smoothing (Holt’s Trend/Model):
• Find Forecast Values for the given Series (Actual Data) in Table.
• Calculate Errors: Mean Absolute Deviation (MAD) & Mean Square Error (MSE)
• Assume = 0.1, = 0.1 & S0=200, G0=10.
Period Actual
1 200
2 250
3 175
4 186
5 225
6 285
7 305
8 190
26
Double Exponential Smoothing (Holt’s Trend/Model) – Example 6
Period 1: 𝑭 𝟎, 𝟏=𝑺𝟎+𝑮𝟎
𝑺 𝟏=𝛼 𝐷1 +(1− 𝛼)( 𝑆0 + 𝐺0)
S1 = (0.1) (200) + (0.9) (200 + 10) = 209
=1 𝑮𝟏= 𝛽 ( 𝑆1 − 𝑆0 )+(1− 𝛽) 𝐺 0
G1= (0.1) (209-200) + (0.9) (10) = 9.90
Forecast
Period Actual |Error| Error^2
1 200 210 Period 2:
209.00
209 9.90 10.00 100.00
𝑺 𝟐=𝛼 𝐷2 +(1 −𝛼)( 𝑆1 +𝐺1 )
2 250 222.01
222.01 10.21
10.21 218.90 31.10 967.21
S2 = (0.1) (250) + (0.9) (209 + 9.9) = 222.01
3 175 226.50
226.50 9.64
9.64 232.22
232.22 57.22 3274.24 𝑮𝟐= 𝛽 ( 𝑆2 − 𝑆1 )+(1− 𝛽) 𝐺1
4 186 231.12 9.14 236.14 50.14 2513.79 G2 = (0.1) (222.01-209) + (0.9) (9.9) = 10.21
5 225 238.74 8.98 240.26 15.26 232.91
Period 3:
6 285 251.45 9.36 247.72 37.28 1389.80
𝑺 𝟑=𝛼 𝐷3 +(1 −𝛼)( 𝑆2 + 𝐺2)
7 305 265.23 9.80 260.81 44.19 1953.14 S3= (0.1) (175) + (0.9) (222 + 10.2) = 226.50
8 190 266.52 8.95 275.02 85.02 7229.18 𝑮𝟑= 𝛽 ( 𝑆3 −𝑆 2)+(1 − 𝛽) 𝐺2
G3= (0.1) (226.5-222) + (0.9) (10.2) = 9.64
27
Double Exponential Smoothing (Holt’s Trend/Model) – Example 6
Calculate Errors: Mean Absolute Error (MAE) & Mean Square Error (MSE)
Forecast
Period Actual |Error| Error^2
𝑛
𝑛
∑ 𝐸 𝑡2
∑ |𝐸𝑡| 330.22 𝑀𝑆𝐸 = 𝑡 =1 =
17660.27
= 2207.53
𝑀𝐴 𝐸 = 𝑡=1
= = 41.28 𝑛 8
𝑛 8
28
Double Exponential Smoothing (Holt’s Trend/Model) – Example 6
29
Double Exponential Smoothing (Holt’s Trend/Model) – Practice
(Class Activity)
The Actual Demands for eight Periods is given in table below.
a) Use Double Exponential Smoothing (Holt’s Trend/Model) to forecast Demand for all Periods.
Assume: = 0.1, = 0.1 & S0 = 200, G0 = 10.
b) Calculate Errors using Mean Absolute Deviation (MAD) & Mean Square Error (MSE) Methods.
Period Actual Demand
1 200
2 250
3 175
4 186
5 225
6 285
7 305
8 190
9
10
30
Forecasting Models With Seasonality (No Trend)
Time Series with Seasonality: Data points are Random & have Seasonality Effect but
they do not have Trend Effect.
When Time Series show Seasonality (no Trend: no ), different Techniques provides better
Forecasting.
Seasonal Factors can be used for Forecasting by adjusting level () in two different ways:
34
Forecasting Models With Seasonality – Example 7
Given Daily Demand for four Weeks, we want to forecast Daily Demand for Week 5.
Plot Time Series Data:
Week 1 Week 2 Week 3 Week 4
Monday 16.2 17.3 14.6 16.1
Tuesday 12.1 11.5 13.1 11.8
Wednesday 14.2 15 13 12.9
Thursday 17.3 17.6 16.9 16.6
Friday 22.5 23.5 21.9 24.3
Total 82.4 84.9 79.5 81.7 25
20
86
84.9 15
83 82.4
81.7 5
82
81 79.5
0
80 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5
79
78 Days of Week
77
Week 1 Week 2 Week 3 Week 4
76
0 1 2 3 4 5
1: Monday 2: Tuesday 3: Wednesday 4: Thursday 5: Friday
Period (week) There is Seasonality: each Day of Week is a Season
There is No Trend each Day of Week is a Season: N=5
35
Forecasting Models With Seasonality – Example 7
Given Daily Demand for four weeks, we want to forecast Daily Demand for week 5.
36
Forecasting Models With Seasonality – Example 7
Step 2: Divide each Observation by the Sample Mean (Overall Average )
37
Forecasting Models With Seasonality – Example 7
Step 3: Take average of Factors for similar Periods within each Season.
Take average of Factors corresponding to the same day of week (same Season).
Seasonal
Week 1 Week 2 Week 3 Week 4
Factor
0.99+1.05+ 0.89+ 0.98
Monday 0.99 1.05 0.89 0.98 0.98 =𝟎 . 𝟗𝟖
4
38
Forecasting Models With Seasonality – Example 7
Step 4: Calculate Forecast: multiply Overall Average by appropriate Seasonal Factor.
Seasonal Forecast
Week 1 Week 2 Week 3 Week 4 Average = 16.425
Factor Week 5
39
Forecasting Models With Seasonality – Example 7
25 25
20 20
15 15
10 10
5 5
0 0
0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5
40
Forecasting Models with Trend & Seasonality
Time Series with Trend & Seasonality: Data Points are Random & have Trend & Seasonality
Effects.
Year 1 2 3 4
42
Forecasting Models with Trend & Seasonality – Example 8
Plot Time Series Data:
Demand (1000s) per Quarter
Year 1 2 3 4 Total
2016 12.6 8.6 6.3 17.5 45
2017 14.1 10.3 7.5 18.2 50.1
2018 15.3 10.6 8.1 19.6 53.6
25
53.6
54
10
52
50.1
50 5
48
0
46 45 0 1 2 3 4 5
44
0 1 2 3 4 Quarter of Year
∑ 𝑠 𝑖=1 ∑ 𝑠 𝑖=1
𝑖 =1
𝟏 .𝟏𝟑 0.28 + 0.20 + 0.15 + 0.37 = 1
=𝟎 .𝟐𝟖
i=1 𝟒 i=1
44
Forecasting Models with Trend & Seasonality – Example 8
Demand (1000s) per Quarter Normalized seasonal factors
Year 1 2 3 4 Total Year 1 2 3 4
2016 12.6 8.6 6.3 17.5 45
0.28 0.20 0.15 0.37
2017 14.1 10.3 7.5 18.2 50.1
2018 15.3 10.6 8.1 19.6 53.6
Step 5: Calculate a Linear Trend Line for Periods of Data (Observations) in table to get a rough Forecast estimate for the
Period that we want to forecast for (in this example: Linear Trend Line for three Years of Data to get estimate for Year 4)
We need to calculate Slope & Intercept for the Linear Trend Line
Demand (1000s) per
Quarter =INTERCEPT(known_ys,known_x’s) Intercept = 40.97
Year 1 2 3 4 Total
1 2016 12.6 8.6 6.3 17.5 45 =SLOPE(known_ys,known_x’s) Slope = 4.30
2 2017 14.1 10.3 7.5 18.2 50.1
3 2018 15.3 10.6 8.1 19.6 53.6
Linear Trend Line:𝒚 =𝟒𝟎 . 𝟗𝟕+𝟒 . 𝟑𝟎 (𝒚𝒆𝒂𝒓 ) rough estimate for Year 4: 𝒚 =𝟒𝟎 . 𝟗𝟕+𝟒 . 𝟑𝟎 ( 𝟒 )=𝟓𝟖 . 𝟏𝟕
𝐹 1=𝑠1 𝑦=𝟎.𝟐𝟖×(𝟓𝟖.𝟏𝟕)=16.28
Now, we can calculate forecast for each Quarter Forecast for Quarter 1 for Year 4
(Quarters 1 to 4) of Year 4 via: Forecast for Quarter 2 for Year 4
multiplying the rough Forecast estimate by Forecast for Quarter 3 for Year 4
corresponding Normalized Seasonal Factor
Forecast for Quarter 4 for Year 4
45
Forecasting Models with Trend & Seasonality – Example 8
𝐹 1=𝑠1 𝑦=𝟎.𝟐𝟖×(𝟓𝟖.𝟏𝟕)=16.28
Forecast for Quarter 1 for Year 4
Forecast for Quarter 2 for Year 4
Forecast for Quarter 3 for Year 4
Forecast for Quarter 4 for Year 4
60
[Y VALUE]
Demand (1000s) per Quarter 58
Year 1 2 3 4 Total 56
46 45
44
0 1 2 3 4 5
If we sum Forecasts for all Quarters in Year 4, 2016 2017 2018 2019
46
Forecasting Models with Trend & Seasonality – Example 8
Demand (1000s) per Quarter
Demand (1000s) per Quarter
Year 1 2 3 4 Total
Year 1 2 3 4 Total
2016 12.6 8.6 6.3 17.5 45 1 2016 12.6 8.6 6.3 17.5 45
2017 14.1 10.3 7.5 18.2 50.1 2 2017 14.1 10.3 7.5 18.2 50.1
2018 15.3 10.6 8.1 19.6 53.6 3 2018 15.3 10.6 8.1 19.6 53.6
4 2019 58.17
60
60 [Y VALUE]
58
Total Demand (1000)
58
25 25
20 20
15 15
10 10
5 5
0
0 0 1 2 3 4 5
0 1 2 3 4 5
Quarter of Year Quarter of Year
47 2016 2017 2018 2016 2017 2018 2019
Model Choice
48