Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Rohit Kapoor
Demand Forecasting
Rohit Kapoor
Framework
Forecasting models
Judgement
Old realizations of
demand: y1, …, yt
Old realizations of
variables: x1, …, xt Forecasting Forecast for: yt+1
Process
Subjective opinions
about the future
Analytical Methods for Forecasting
• Static Methods
• Adaptive Methods
• Casual Methods
Static Methods
• Case 1: Forecasting the trend form
• Case 2: Forecasting seasonality
• Case 3: Forecasting combination of seasonality
and trend
Case 1: Forecasting the Trend Form
• A constant increase or decrease in demand
denotes
– Linear trend
– Model
• Forecast (t) = a + b * t
Case 1: Forecasting the Trend Form
t D(t)
1 328 D(t)
2 310
600
3 355
500
4 362
400
5 375
Demand
300 D(t)
6 380
200
7 408
100
8 415
0
9 417 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
10 412 Period
11 429
12 434
13 449
14 471
15 475
16 489
Case 1: Forecasting the Trend Form …
Calculations
t D(t) t-Tavg D(t) - Davg (t-Tavg) * (D(t)-Davg) (t-tavg)^2 Forecast Abs error
1 328 -7.5 -78.81 591.09 56.25 326.40 1.60
2 310 -6.5 -96.81 629.28 42.25 337.12 27.12
3 355 -5.5 -51.81 284.97 30.25 347.84 7.16
4 362 -4.5 -44.81 201.66 20.25 358.56 3.44
5 375 -3.5 -31.81 111.34 12.25 369.29 5.71
6 380 -2.5 -26.81 67.03 6.25 380.01 0.01
7 408 -1.5 1.19 -1.78 2.25 390.73 17.27
8 415 -0.5 8.19 -4.09 0.25 401.45 13.55
9 417 0.5 10.19 5.09 0.25 412.17 4.83
10 412 1.5 5.19 7.78 2.25 422.90 10.90
11 429 2.5 22.19 55.47 6.25 433.62 4.62
12 434 3.5 27.19 95.16 12.25 444.34 10.34
13 449 4.5 42.19 189.84 20.25 455.06 6.06
14 471 5.5 64.19 353.03 30.25 465.78 5.22
15 475 6.5 68.19 443.22 42.25 476.51 1.51
16 489 7.5 82.19 616.41 56.25 487.23 1.77
Mean 8.5 406.8125 7.57
Sum 3645.50 340.00
b 10.72206
a 315.675
Estimating Forecasting Error
• Four ways:
– Mean error (ME)
• Value close to 0
– Magnitude of the error?
– Mean absolute deviation (MAD)
– Mean square error (MSE)
– Mean absolute percentage error (MAPE)
Different Estimates of Forecast Error
Absolute Square Absolute
Month Sales Forecast Error Deviation Error % Error
1 328 326 2 2 4 0.61%
2 310 337 -27 27 729 8.71%
3 355 348 7 7 49 1.97%
4 362 359 3 3 9 0.83%
5 375 369 6 6 36 1.60%
6 380 380 0 0 0 0.00%
7 408 391 17 17 289 4.17%
8 415 401 14 14 196 3.37%
9 417 412 5 5 25 1.20%
10 412 423 -11 11 121 2.67%
11 429 434 -5 5 25 1.17%
12 434 444 -10 10 100 2.30%
13 449 455 -6 6 36 1.34%
14 471 466 5 5 25 1.06%
15 475 476 -1 1 1 0.21%
16 489 487 2 2 4 0.41%
Mean 0.0625 7.5625 103.0625 1.98%
ME MAD MSE MAPE
Case 2: Forecasting Seasonality
Period Demand Data
within
Time Block block Demand 700
1 1 6
Demand
600
2 2 55 500
1
3 3 249 400
4 4 646 300
Demand
5 1 24 200
6 2 73
2 100
7 3 140 0
8 4 569 1 2 3 4 5 6 7 8 9 10 11 12
9 1 12 Period
10 2 28
3
11 3 136
12 4 631
Case 2: Forecasting Seasonality …Some
Equations
• Seasonality index of period i for block j
– S(i, j) = (di)/[(d1 + d2 + … + dp)/p]
• For each period i within block j
• Average seasonality index for period i within a
block
– S(i)
Case 2: Forecasting Seasonality … Analysis
Period Seasonal
within Index of
Time Block block Demand Average Period
1 1 6 0.03
2 2 55 0.23
1 239
3 3 249 1.04
4 4 646 2.70
5 1 24 0.12
6 2 73 0.36
2 201.5
7 3 140 0.69
8 4 569 2.82
9 1 12 0.06
10 2 28 0.14
3 201.75
11 3 136 0.67
12 4 631 3.13
Case 2: Forecasting Seasonality …Seasonality
Index Calculation
Average
Seasonality
Period/Block S(i, 1) S(i, 2) S(i, 3) Index
1 0.03 0.12 0.06 0.07
2 0.23 0.36 0.14 0.24
3 1.04 0.69 0.67 0.80
4 2.70 2.82 3.13 2.88
Case 2: Forecasting Seasonality … De-
seasonalizing Demand
• De-seasonalized demand data (t)
– Demand(t)/S(t)
• Forecast (t)
– [Level (t)] * Seasonal index (t)
Case 2: Forecasting Seasonality …
Calculations
7 590 Sales
600
8 170 400
9 100
200
10 585
0
11 830 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
12 285 Quarter
13 100
14 725
15 1160
16 310
Case 3: Forecasting Combination of
Seasonality and Trend
• Methodology
– Forecasting model
• Demand (t) = (Level (t) + Trend parameter * t) * Seasonality
parameter (t) + random error
– Step 1: Determine the seasonality index for each time
period within a block (similar to Case 2)
– Step 2: De-seasonalize the demand data (similar to Case 2)
– Step 3: Determine the trend and level components for the
de-seasonalized data series (similar to Case 1)
– Step 4: Finalize the forecasting model
Case 3: Forecasting Combination of
Seasonality and Trend … Analysis
Period
within Average Seasonality
Time Block Block Demand Demand Index
1 1 45 0.18
2 2 335 1.34
1 250
3 3 520 2.08
4 4 100 0.40
5 1 70 0.23
6 2 370 1.23
2 300
7 3 590 1.97
8 4 170 0.57
9 1 100 0.22
10 2 585 1.30
3 450
11 3 830 1.84
12 4 285 0.63
13 1 100 0.17
14 2 725 1.26
4 573.75
15 3 1160 2.02
16 4 310 0.54
Case 3: Forecasting Combination of
Seasonality and Trend … Analysis
Average
Seasonality
Period/Block 1 2 3 4 Index
1 0.18 0.23 0.22 0.17 0.20
2 1.34 1.23 1.30 1.26 1.28
3 2.08 1.97 1.84 2.02 1.98
4 0.40 0.57 0.63 0.54 0.54
Case 3: Forecasting Combination of
Seasonality and Trend … Analysis
De-
seasonlized
Time Demand t-Tavg D(t) - Davg (t-Tavg) * (D(t) - Davg) (t-tavg)^2
1 222 -7.5 -172 1290.14 56.25
2 261 -6.5 -133 867.28 42.25
3 263 -5.5 -131 722.82 30.25
4 187 -4.5 -207 933.27 20.25
5 346 -3.5 -49 169.89 12.25
6 288 -2.5 -106 265.44 6.25
7 298 -1.5 -96 144.05 2.25
8 318 -0.5 -77 38.29 0.25
9 494 0.5 100 49.82 0.25
10 456 1.5 61 91.86 2.25
11 420 2.5 25 63.21 6.25
12 533 3.5 138 484.23 12.25
13 494 4.5 100 448.37 20.25
14 565 5.5 170 936.40 30.25
15 586 6.5 192 1248.66 42.25
16 579 7.5 185 1388.05 56.25
Mean 8.5 394.28
Sum b 27 9141.77 340
a 165.74
Case 3: Forecasting Combination of
Seasonality and Trend … Analysis
1400
1200
1000
800 Demand
Demand
600 Forecast
400
200
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Period
Adaptive Methods
• Moving Average
• Simple Exponential Smoothening
• Holt’s Method
• Winter’s Method
Basic Data
Month TV Sales CD Sales AC Sales
1 30 40 13
2 32 47 7
3 30 50 23
4 39 49 32
5 33 56 58
6 34 53 60
7 34 55 90
8 38 63 93
9 36 68 63
10 39 65 39
11 30 72 37
12 36 69 29
13 38 79 36
14 30 82 21
15 35 80 47
16 30 85 81
17 34 94 112
18 40 89 139
19 36 96 230
20 32 100 201
21 40 100 122
22 36 105 84
23 40 108 74
24 34 110 62
TV Sales
TV Sales
45
40
35
30
T V Sales
25
TV Sales
20
15
10
5
0
1
3
5
7
9
13
19
11
15
17
21
23
Month
CD Sales
CD Sales
120
100
80
CD Sales
60 CD Sales
40
20
0
10
16
22
13
19
1
Month
AC Sales
AC Sales
250
AC Sales
200
150
AC Sales
100
50
0
1 3 5 7 9 11 13 15 17 19 21 23
Month
Moving Average Method
• Time series that fluctuates about a constant
base level
• ft,1
Forecast for period t + 1made after observing xt
ft,1= Average of last N observations
Moving Average Method Calculations
Month TV Sales MAF (N = 2) Error MAF (N = 3) Error MAF (N = 4) Error MAF (N = 5) Error MAF (N = 6) Error
1 30
2 32
3 30 31 1
4 39 31 8 30.67 8.33
5 33 34.5 1.5 33.67 0.67 32.75 0.25
6 34 36 2 34.00 0.00 33.50 0.50 32.80 1.20
7 34 33.5 0.5 35.33 1.33 34.00 0.00 33.60 0.40 33.00 1.00
8 38 34 4 33.67 4.33 35.00 3.00 34.00 4.00 33.67 4.33
9 36 36 0 35.33 0.67 34.75 1.25 35.60 0.40 34.67 1.33
10 39 37 2 36.00 3.00 35.50 3.50 35.00 4.00 35.67 3.33
11 30 37.5 7.5 37.67 7.67 36.75 6.75 36.20 6.20 35.67 5.67
12 36 34.5 1.5 35.00 1.00 35.75 0.25 35.40 0.60 35.17 0.83
13 38 33 5 35.00 3.00 35.25 2.75 35.80 2.20 35.50 2.50
14 30 37 7 34.67 4.67 35.75 5.75 35.80 5.80 36.17 6.17
15 35 34 1 34.67 0.33 33.50 1.50 34.60 0.40 34.83 0.17
16 30 32.5 2.5 34.33 4.33 34.75 4.75 33.80 3.80 34.67 4.67
17 34 32.5 1.5 31.67 2.33 33.25 0.75 33.80 0.20 33.17 0.83
18 40 32 8 33.00 7.00 32.25 7.75 33.40 6.60 33.83 6.17
19 36 37 1 34.67 1.33 34.75 1.25 33.80 2.20 34.50 1.50
20 32 38 6 36.67 4.67 35.00 3.00 35.00 3.00 34.17 2.17
21 40 34 6 36.00 4.00 35.50 4.50 34.40 5.60 34.50 5.50
22 36 36 0 36.00 0.00 37.00 1.00 36.40 0.40 35.33 0.67
23 40 38 2 36.00 4.00 36.00 4.00 36.80 3.20 36.33 3.67
24 34 38 4 38.67 4.67 37.00 3.00 36.80 2.80 37.33 3.33
Moving Average Method
N MAD
2 3.27
3 3.21
4 2.78
5 2.79
6 3.08
Simple Exponential Smoothing
• A time series that fluctuates about a base level
• At = αxt + (1 – α) At-1
• A0 = 32
• α = 0.1
Simple Exponential Smoothing
Calculations
Month TV Sa le s Fore ca st At et
1 30 32 31.8 2.00
2 32 31.8 31.82 0.20
3 30 31.82 31.64 1.82
4 39 31.64 32.37 7.36
5 33 32.37 32.44 0.63
6 34 32.44 32.59 1.56
7 34 32.59 32.73 1.41
8 38 32.73 33.26 5.27
9 36 33.26 33.53 2.74
10 39 33.53 34.08 5.47
11 30 34.08 33.67 4.08
12 36 33.67 33.91 2.33
13 38 33.91 34.32 4.09
14 30 34.32 33.88 4.32
15 35 33.88 34.00 1.12
16 30 34.00 33.60 4.00
17 34 33.60 33.64 0.40
18 40 33.64 34.27 6.36
19 36 34.27 34.45 1.73
20 32 34.45 34.20 2.45
21 40 34.20 34.78 5.80
22 36 34.78 34.90 1.22
23 40 34.90 35.41 5.10
24 34 35.41 35.27 1.41
Simple Exponential Smoothing
Alpha MAD
0.05 3.20
0.1 3.04
0.15 2.94
0.2 2.89
0.25 2.88
0.3 2.90
0.35 2.94
0.4 2.98
0.45 3.05
0.5 3.14