Lesson 6: Demand Forecasting
Operations
Management
Forecasting: The art and science of predicting
future events
Demand forecast is an estimate of sales
for each time period in the planning
horizon [under a proposed business
plan, assuming several economic
premises and other external forces].
Forecasts are useful in projecting:
Factory capacity
Production, scheduling
Supply Chain Management, purchasing
Inventory levels
Staffing level: Hiring or laying off
workers
Investments, finance, payments
Components of demand
Red Eléctrica Española:
[Link]
Assumes demand in next
Naive period is the same as
Approach demand in the most recent
period.
Period Actual
(t) demand Demand
24
1 17
22
2 21
20
3 19
18
4 23 16
5 18 14
6 16 12
7 20 10
8 18 0 1 2 3 4 5 6 7 8 9 10
9 22
10 ?
Ft+1 = At
F10 = A9 = 22 units
En anglès, utilitzem At per a referir-nos a les dades “Actual” (les dades reals)
Period Actual
(t) demand
1 17 Simple Moving Average
2 21 (mitjana mòbil)
3 19
4 23
5 18
6 16
7 20
8 18 Uses an average of the n most
9 22 recent periods of data.
10 ?
En aquest exemple hem pres n = 3 periods,
F10 = (20+18+22)/3 = 20 units
Weighted Moving Average
Period Actual
(t) demand
1 17
2 21
3 19 En aquest exemple, hem decidit emprar tres
períodes, i prendre com a pesos els valors 1, 2 i
4 23 3 (El pes més alt, sempre correspon al període
5 18 més recent d’entre els emprats per a fer el
càlcul):
6 16
7 20 x1
8 18 x2
9 22 x3
10 ?
F10 = (22·3+18·2+20·1)/6 = 20.3 units
Exponential Smoothing
A sophisticated weighted moving average:
Ft + 1 = Ft + α(At - Ft )
where Ft+1 = new forecast
Ft = previous forecast
α = smoothing constant (0 ≤ α ≤ 1)
Exponential Smoothing
Actual
Period Forecast Error
demand
(t) F(t) A-F
A(t)
1 17 F1 = 17 units
2
3
4
5
6
7
8
9
10
Ft + 1 = Ft + α(At - Ft )
Actual Actual
Period Forecast Error Period Forecast Error
demand demand
(t) F(t) A-F (t) F(t) A-F
A(t) A(t)
1 17 17 1 17 17 0
2 2 17
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
Actual
Period Forecast Error
demand
(t) F(t) A-F
A(t)
1 17 17 0
2
3
21 17 F2 = 17 + α·0 = 17 units
4
5
6
7
8
9
10
Ft + 1 = Ft + α(At - Ft )
Actual Actual
Period Forecast Error Period Forecast Error
demand demand
(t) F(t) A-F (t) F(t) A-F
A(t) A(t)
1 17 17 0 1 17 17 0
2 21 17 4 2 21 17 4
3 3 17.80
4 4
5 5
6 6
7 7
8 8
9 9
10 10
F3 = 17 + 0.2·4 = 17.80 units
Exponential Smoothing
Actual
Period Forecast Error
demand
(t) F(t) A-F
A(t)
1 17 17 0
2 21 17 4
3 19 17.80 1.20
4 18.04 Ft + 1 = Ft + α(At - Ft )
5
6
7
8
9
10
F4 = 17.80 + 0.2·1.20 = 18.04 units
Exponential Smoothing
Period Actual Forecast Error
(t) demand F A-F
1 17 17 0
2 21 17 4
3 19 17.80 1.20
4 23 18.04 4.96
5 18 19.03 -1.03
6 16 18.83 -2.83
7 20 18.26 1.74
8 18 18.61 -0.61
9 22 18.49 3.51
10 ? 19.19 Ft + 1 = Ft + α(At - Ft )
F10 = 18.49 + 0.2·3.51 = 19.19 units
Trend Projection
Year Demand Demand (MWh) Demand
1 74 150
2 79 140 y = 10.536x + 56.714
3 80
130
R² = 0.8009
120
4 90 110
100
5 105 90
6 142 80
70
7 122 60 Time periods (years)
50
0 1 2 3 4 5 6 7
Trend is the gradual upward
(downward) movement of the data
over time.
Trend projection is a method that fits a trend line to
historical data points and then projects the line into the
future.
Linear trends can be found using the least squares
technique.
Current behavior of demand:
y(t) = 10.54·t + 56.71
b = 10.54 MWh more each year (slope)
Predicted value for period 8:
y(8) = 10.54·8 + 56.71 = 141 MWh
Coefficient of determination, r2, measures the amount of
change in y explained by the regression equation.
R2 = 0.80
Seasonal Variations in Data
Periods (quarters) Sales
Year 1 1 (Winter) 1 70
2 (Spring) 2 370
3 (Summer) 3 590
4 (Fall) 4 170 Quarterly Sales Chart
Year 2 1 (Winter) 5 45 900
2 (Spring) 6 335 800
3 (Summer) 7 520 700
600
4 (Fall) 8 100
Sales (units)
500
Year 3 1 (Winter) 9 100
400
2 (Spring) 10 585
300
3 (Summer) 11 830 200
4 (Fall) 12 285 100
Year 4 1 (Winter) 13 50 0
2 (Spring) 14 363 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
3 (Summer) 15 580 Period (quarters)
4 (Fall) 16 107
En aquest exemple, els períodes de temps són Quarters
(trimestres).
Our assumption is that data have no trend.
Seasonal Variations in Data
Quarter Year 1 Year 2 Year 3 Year 4
1 (Winter) 70 45 100 50
2 (Spring) 370 335 585 363
3 (Summer) 590 520 830 580
4 (Fall) 170 100 285 107
Quarterly Sales Chart
900
800
700 Year 1
600
Sales (units)
500 Year 2
400
300 Year 3
200
100 Year 4
0
Q1 Q2 Q3 Q4
Period (quarters)
Seasonality is a data pattern that repeats itself after a period of
quarters, months, days…
(Les dades tenen un patró repetitiu, amb temporades altes i baixes,
hores punta I hores vall, etc).
Computing seasonal indices
(multiplicative seasonal model)
Average
Quarter Year 1 Year 2 Year 3 Year 4 period
demand
1 (Winter) 70 45 100 50 66.25
2 (Spring) 370 335 585 363 413.25
3 (Summer) 590 520 830 580 630.00
4 (Fall) 170 100 285 107 165.50
Total (Y) 1200 1000 1800 1100 1275.00
1. Find the average historical demand each period (quarter in this
case) by summing the demand for that period in each year and
dividing by the number of years of data available.
Average Average
Quarter Year 1 Year 2 Year 3 Year 4 period quarterly
demand demand
1 (Winter) 70 45 100 50 66.25 318.75
2 (Spring) 370 335 585 363 413.25 318.75
3 (Summer) 590 520 830 580 630.00 318.75
4 (Fall) 170 100 285 107 165.50 318.75
Total (Y) 1200 1000 1800 1100 1275.00 318.75
2. Compute the average demand over all periods by dividing the
total average annual demand by the number of seasons (quarters,
months…)
Average demand = 1275 / 4 = 318.75 units
Average Average
Seasonal
Quarter Year 1 Year 2 Year 3 Year 4 period quarterly
index
demand demand
1 (Winter) 70 45 100 50 66.25 318.75 0.208
2 (Spring) 370 335 585 363 413.25 318.75 1.296
3 (Summer) 590 520 830 580 630.00 318.75 1.976
4 (Fall) 170 100 285 107 165.50 318.75 0.519
Total (Y) 1200 1000 1800 1100 1275.00 318.75
3. Compute a seasonal index for each season by dividing that
period’s historical average demand by the average demand over all
periods.
Seasonal Index = Average period demand /Average demand
Seasonality is expressed in terms of the amount that actual values
differ from the average values in the time series.
4. Estimate next year’s total annual demand and divide this
estimate of the total annual demand by the number of seasons.
Forecast
Quarter Year 1 Year 2 Year 3 Year 4 Year 5
deseasonalized
1 (Winter) 70 45 100 50 375
2 (Spring) 370 335 585 363 375
3 (Summer) 590 520 830 580 375
4 (Fall) 170 100 285 107 375
Total (Y) 1200 1000 1800 1100 1500
- 200 + 800
+ 400 -700
Let us assume that
Projected Annual Demand for year 5 = 1500
Haig de fer l'aproximacio jo mateix tenint en conta el total annual demands
Since projected annual demand is 1500 units
-if seasonality was not present-
quarterly demand would be = 1500/4 = 375
Forecast
Seasonal Forecast
Quarter Year 1 Year 2 Year 3 Year 4 Year 5
index Year 5
deseasonalized
1 (Winter) 70 45 100 50 375 0.208 78
2 (Spring) 370 335 585 363 375 1.296 486
3 (Summer) 590 520 830 580 375 1.976 741
4 (Fall) 170 100 285 107 375 0.519 195
Total (Y) 1200 1000 1800 1100 1500 1500
5. Multiply average demand by the seasonal index for each period.
This provides the seasonal forecast.
Year 5
Quarter 1: 375 x 0.21 = 78
Quarter 2: 375 x 1.30 = 486
Quarter 3: 375 x 1.98 = 741
Quarter 4: 375 x 0.52 = 195
Applying both trend and seasonal indices
Period Sales
(Quarters) (units)
Year 1 1 (Winter) 1 45
2 (Spring) 2 335
3 (Summer) 3 520
4 (Fall) 4 100
Year 2 1 (Winter) 5 70
2 (Spring) 6 370
3 (Summer) 7 590
4 (Fall) 8 170 Quarterly Sales Chart
Year 3 1 (Winter) 9 100 1400
y = 28.309x + 146.88
2 (Spring) 10 585 1200 R² = 0.1746
3 (Summer) 11 830 1000
4 (Fall) 12 285
Sales (units)
800
Year 4 1 (Winter) 13 100
600
2 (Spring) 14 725
3 (Summer) 15 1160 400
4 (Fall) 16 215 200
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Period (quarters)
Quarter Year 1 Year 2 Year 3 Year 4
1 (Winter) 45 70 100 100
2 (Spring) 335 370 585 725
3 (Summer) 520 590 830 1160
4 (Fall) 100 170 285 215
Quarterly Sales Chart
1400
1200
Year 1
1000
Sales (units)
800 Year 2
600
Year 3
400
200 Year 4
0
Q1 Q2 Q3 Q4
Period (quarters)
Average Average
Seasonal
Quarter Year 1 Year 2 Year 3 Year 4 period quarterly
index
demand demand
1 (Winter) 45 70 100 100 78.75 387.5 0.203
2 (Spring) 335 370 585 725 503.75 387.5 1.300
3 (Summer) 520 590 830 1160 775.00 387.5 2.000
4 (Fall) 100 170 285 215 192.50 387.5 0.497
Total (Y) 1000 1200 1800 2200 1550.00 387.5
1. Find the average historical demand each period (quarter in this
case) by summing the demand for that period in each year and
dividing by the number of years of data available.
2. Compute the average demand over all periods by dividing the total
average annual demand by the number of seasons (quarters,
months…)
3. Compute a seasonal index for each season by dividing that
period’s historical average demand by the average demand over all
periods.
Period Sales Seasonal Sales
(Quarters) (units) index deseasonalized
Year 1 1 (Winter) 1 45 0.203 221.43
2 (Spring) 2 335 1.300 257.69
3 (Summer) 3 520 2.000 260.00
4 (Fall) 4 100 0.497 201.30 4. Deseasonalize
Year 2 1 (Winter) 5 70 0.203 344.44
2 (Spring) 6 370 1.300 284.62
demand by dividing
3 (Summer) 7 590 2.000 295.00 each period’s sales by
4 (Fall) 8 170 0.497 342.21
Year 3 1 (Winter) 9 100 0.203 492.06 its seasonal index.
2 (Spring) 10 585 1.300 450.00
3 (Summer) 11 830 2.000 415.00
4 (Fall) 12 285 0.497 573.70
Year 4 1 (Winter) 13 100 0.203 492.06
2 (Spring) 14 725 1.300 557.69
3 (Summer) 15 1160 2.000 580.00
4 (Fall) 16 215 0.497 432.79
Sales y = 23.711x + 185.96
deseasonalized R² = 0.7718
700.00
5. Create a trend line. 600.00
500.00
Sales (units)
y^ = a + bx 400.00
300.00
200.00
100.00
0.00
0 2 4 6 8 10 12 14 16 18
Periods (Quarters)
Period Sales Seasonal Sales
Trend
(Quarters) (units) index deseasonalized
y^ = a + bx
Year 1 1 (Winter) 1 45 0.203 221.43 209.67
2 (Spring) 2 335 1.300 257.69 233.38
3 (Summer) 3 520 2.000 260.00 257.09
4 (Fall) 4 100 0.497 201.30 280.80
Year 2 1 (Winter) 5 70 0.203 344.44 304.52
2 (Spring) 6 370 1.300 284.62 328.23
3 (Summer) 7 590 2.000 295.00 351.94
4 (Fall) 8 170 0.497 342.21 375.65
Year 3 1 (Winter) 9 100 0.203 492.06 399.36
2 (Spring) 10 585 1.300 450.00 423.07
3 (Summer) 11 830 2.000 415.00 446.78
4 (Fall) 12 285 0.497 573.70 470.49
Year 4 1 (Winter) 13 100 0.203 492.06 494.20
2 (Spring) 14 725 1.300 557.69 517.91
3 (Summer) 15 1160 2.000 580.00 541.63
4 (Fall) 16 215 0.497 432.79 565.34
Year 5 1 (Winter) 17 589.05 Sales y = 23.711x + 185.96
2 (Spring) 18 612.76
deseasonalized R² = 0.7718
3 (Summer) 19 636.47
700.00
4 (Fall) 20 660.18
600.00
500.00
Sales (units)
6. Use time-series regression 400.00
300.00
to forecast sales for the next 4
200.00
quarters. 100.00
0.00
0 2 4 6 8 10 12 14 16 18
Periods (Quarters)
Period Sales Seasonal Sales Sales
Trend
(Quarters) (units) index deseasonalized Forecast
Year 1 1 (Winter) 1 45 0.203 221.43 209.67 43
2 (Spring) 2 335 1.300 257.69 233.38 303
3 (Summer) 3 520 2.000 260.00 257.09 514
4 (Fall) 4 100 0.497 201.30 280.80 139
Year 2 1 (Winter) 5 70 0.203 344.44 304.52 62
2 (Spring) 6 370 1.300 284.62 328.23 427
3 (Summer) 7 590 2.000 295.00 351.94 704
4 (Fall) 8 170 0.497 342.21 375.65 187
Year 3 1 (Winter) 9 100 0.203 492.06 399.36 81
2 (Spring) 10 585 1.300 450.00 423.07 550
3 (Summer) 11 830 2.000 415.00 446.78 894
4 (Fall) 12 285 0.497 573.70 470.49 234
Year 4 1 (Winter) 13 100 0.203 492.06 494.20 100
2 (Spring) 14 725 1.300 557.69 517.91 673
3 (Summer) 15 1160 2.000 580.00 541.63 1083
4 (Fall) 16 215 0.497 432.79 565.34 281
Year 5 1 (Winter) 17 0.203 589.05 120
2 (Spring) 18 1.300 612.76 797
3 (Summer) 19 2.000 636.47 1273
4 (Fall) 20 0.497 660.18 328
Forecast
Quarter Year 1 Year 2 Year 3 Year 4
7. To compute a seasonalized Year 5
or adjusted sales forecast, 1 (Winter) 45 70 100 100 120
2 (Spring) 335 370 585 725 797
multiply each seasonal index 3 (Summer) 520 590 830 1160 1273
4 (Fall) 100 170 285 215 328
by the appropriate trend Total (Y) 1000 1200 1800 2200 2518
forecast.