You are on page 1of 22

Demand Forecasting I

Time Series Analysis

Chris Caplice
ESD.260/15.770/1.260 Logistics Systems
Sept 2006
Agenda “Predictions are usually difficult
– especially for the future”
Yogi Berra

Problem and Background


Four Fundamental Approaches
Time Series Methods

MIT Center for Transportation & Logistics – ESD.260 2 © Chris Caplice, MIT
Demand Processes
Demand Forecasting
„ Predict what will happen in the future
„ Typically involves statistical, causal or other model
„ Conducted on a routine basis (monthly, weekly, etc.)
Demand Planning
„ Develop plans for creating or affecting future demand
„ Results in marketing & sales plans – builds unconstrained
forecast
„ Conducted on a routine basis (monthly, quarterly, etc.)
Demand Management
„ Make decisions in order to balance supply and demand within
the forecasting/planning cycle
„ Includes forecasting and planning processes
„ Conducted on an on-going basis as supply and demand changes
„ Includes yield management, real-time demand shifting, forecast
consumption tracking, etc.

MIT Center for Transportation & Logistics – ESD.260 3 © Chris Caplice, MIT
Four Fundamental Approaches
Subjective Objective
Judgmental Time Series
„ Sales force surveys „ “Black Box” Approach
„ Delphi techniques
„ Uses past to predict the
„ Jury of experts future
Experimental Causal / Relational
„ Customer surveys
„ Econometric Models
„ Focus group sessions
„ Leading Indicators
„ Test Marketing
„ Simulation „ Input-Output Models

Often times, you will need to use a combination of approaches


MIT Center for Transportation & Logistics – ESD.260 4 © Chris Caplice, MIT
Cost of Forecasting vs Inaccuracy
Å Overly Naïve Models Æ Å Good Region Æ Å Excessive Causal Models Æ

Total Cost
Cost

Cost of Errors Cost of Forecasting


In Forecast

Forecast Accuracy

MIT Center for Transportation & Logistics – ESD.260 5 © Chris Caplice, MIT
Time Series
The typical problem:
„ Generate the large number of short-term, SKU level, locally
disaggregated demand forecasts required for production, logistics,
and sales to operate successfully.
Predominant use is for:
„ Forecasting product demand of . . .
„ Mature products over a . . .
„ Short time horizon (weeks, months, quarters, year) . . .
„ Using models to assist in the forecast where . . .
„ Demand of items is independent
Special situations are treated differently
„ New product introduction
„ Old product retirement
„ Short life-cycle products
„ Erratic and sparse demand

MIT Center for Transportation & Logistics – ESD.260 6 © Chris Caplice, MIT
Time Series
Method of using past occurrences to model the future
Assumes some regular & recurring basis over time
Basic Components

Demand rate
„ Level (a) a
Š Value where demand hovers around
„ Trend (b)
time
Š Persistent movement in one direction
Š Typically linear but can be exponential, quadratic, etc.

Demand rate
„ Seasonal Variations (F)
Š Movement that is periodic to the calendar
b
Š Hourly, daily, weekly, monthly, quarterly, etc.
„ Cyclical Movements (C)
Š Periodic movement not tied to calendar time

„ Random Fluctuations (e or ε)
Š Irregular and unpredictable variations, noise S

Demand rate
Combine components to model demand in period t
„ Multiplicative: xt = (b)(F)(C)(e) time
„ Additive: xt = a + b(t) + Ft + Ct + et
„ Mixed: Combination xt = a + b(Ft)t + et
MIT Center for Transportation & Logistics – ESD.260 7 © Chris Caplice, MIT
Time Series
Simple Procedure
1. Select an appropriate underlying model of
the demand pattern over time
2. Estimate and calibrate values for the model
parameters
3. Forecast future demand with the models
and parameters selected
4. Review model performance and adjust
parameters and model accordingly

MIT Center for Transportation & Logistics – ESD.260 8 © Chris Caplice, MIT
Time Series: Example
What is the forecast for period t+τ
made at the end of period t, ̂xt,t+τ?

116
115
114
Demand

113
112
111 140

110 120

109 100

108 80

Volume
1
10
19
28
37
46
55
64
73
82
91
10
60

40

Week 20

0
0 20 40 60 80 100 120
Week

So, what can I say?


MIT Center for Transportation & Logistics – ESD.260 9 © Chris Caplice, MIT
Time Series
How important is the history? Two
extreme assumptions . . . .
Cumulative Forecast Naïve Forecast
„ All history matters equally „ Most recent dictates next
„ Pure stationary demand „ Random Walk, Last is Next

Underlying Model: Underlying Model:


x t = a + e t x t = xt-1 + e t

where: where:
e t ~ iid (μ=0 , σ2=V[e]) e t ~ iid (μ=0 , σ2=V[e])
Forecasting Model: Forecasting Model:

t

x t ,t +1 =
x
i =1 i x t ,t +1 = xt
t
MIT Center for Transportation & Logistics – ESD.260 10 © Chris Caplice, MIT
Time Series
Moving Average
„ Only include the last M observations
„ Compromise between cumulative and naïve
Š Cumulative model (M=n)
Š Naïve model (M=1)
„ Assumes that some step (S) occurred

Underlying Model:
So, some questions
x t = a + e t „ How do we find M?
where: „ What trade-offs are
e t ~ iid (μ=0 , σ2=V[e]) involved?
„ How responsive are the
Forecasting Model: three models?

t
xi
x t ,t +1 = i =t +1− M

M
MIT Center for Transportation & Logistics – ESD.260 11 © Chris Caplice, MIT
Moving Average Forecasts
116.00
115.00
114.00
113.00
112.00
111.00
110.00
109.00
108.00

0
73
82
91
10
19
28
37
46
55
64
1

10
ActDemand Naïve MA3
MA10 MA20 Cumulative

MIT Center for Transportation & Logistics – ESD.260 12 © Chris Caplice, MIT
Time Series: Exponential Smoothing
Why should past observations all be weighted the same?
Value of observation degrades over time
Introduce smoothing constant (α)

Underlying Model:
x t = a + e t

where:
e t ~ iid (μ=0 , σ2=V[e])
Recall that
Forecasting Model: et = xt - ̂xt-1,t
̂xt,t+1 = ̂xt-1,t + αet (0<α<1)
or
̂xt,t+1=αxt + (1-α)̂xt-1,t
MIT Center for Transportation & Logistics – ESD.260 13 © Chris Caplice, MIT
Time Series: Exponential Smoothing

̂xt,t+1 = αxt + (1-α) ̂xt-1,t


but recalling that ̂xt-1,t = αxt-1 + (1-α) ̂xt-2,t-1

̂xt,t+1 = αxt + (1-α)(αxt-1 + (1-α) ̂xt-2,t-1)

̂xt,t+1 = αxt + α(1-α)xt-1 + (1-α)2 ̂xt-2,t-1

̂xt,t+1 = αxt + α(1-α)xt-1 + α(1-α)2xt-2 + (1-α)3 ̂xt-3,t-2

̂xt,t+1 = α(1-α)0xt + α(1-α)1xt-1 + α(1-α)2xt-2 + α(1-α)3xt-3...

MIT Center for Transportation & Logistics – ESD.260 14 © Chris Caplice, MIT
Time Series: Exponential Smoothing

Pattern of Decline in Weight

1
Effective Weight

0.8
alpha=.1
0.6
alpha=.5
0.4
alpha=.9
0.2
0
0 1 2 3 4 5
Age of Data Point

MIT Center for Transportation & Logistics – ESD.260 15 © Chris Caplice, MIT
Time Series: Non-Stationary Models
MA with Trend Data

30

25

20
Demand

15

10

0
1 2 3 4 5 6 7 8 9 10 11 12
Period

Demand MA(3) MA(6)

Note that MA and standard Exp Smoothing will just lag a trend
They only look at history to find the stationary level
Need to capture the ‘trend’ or ‘seasonality’ factors

MIT Center for Transportation & Logistics – ESD.260 16 © Chris Caplice, MIT
Time Series: Level & Trended Data
Similar to exponential smoothing
Holt’s Method - smoothing constants for level (a) and
trend (b) terms
Underlying Model:
x t = a + bt + e t

Demand rate
where: e t ~ iid (μ=0 , σ2=V[e])
a

time

Forecasting Model:

Demand rate
̂xt,t+τ = ̂at + τ ̂bt b

time

Where: ̂at = αxt + (1-α)( ̂at-1 + ̂bt-1)

̂bt = β( ̂at - ̂at-1) + (1- β) ̂bt-1

MIT Center for Transportation & Logistics – ESD.260 17 © Chris Caplice, MIT
Time Series: Level & Trended Data
This is a linear
Forecast follows weighted combination
on this line
of level at A and B
Forecast
at t+1
aˆt +1
aˆt = α HW xt + (1 − α HW )(aˆt −1 + bˆt −1 )
xt A
A B
Demand or Forecast

ât bˆt = β HW (aˆt − aˆt −1 ) + (1 − β HW )bˆt −1


C D
B (aˆt − aˆt −1 )
C
bˆt −1
aˆt −1 D
(aˆt −1 + bˆt −1 )
This is a linear weighted
combination of slopes
0 at C and D

t-1 t t+1
Time
Source: Atul Agarwal MLOG’05 Objective is to forecast t+1 & beyond

MIT Center for Transportation & Logistics – ESD.260 18 © Chris Caplice, MIT
Time Series: Level & Seasonal Data

Multiplicative model using exponential smoothing


Introduces seasonal term, F, that covers P periods.

Underlying Model:

Demand rate
x t = aFt + e t a

where: e t ~ iid (μ=0 , σ2=V[e])


time

Forecasting Model: S

Demand rate
̂xt,t+τ = ̂at ̂Ft+τ-P

Where : ̂at = α(xt/ ̂Ft-P) + (1- α) ̂at-1


time

̂Ft = γ(xt/ a
̂ t) + (1- γ) ̂Ft-P

An Example where P=4, t=12, τ=1:


̂x12,13 = ̂a12 ̂F9
̂a12 = α(x12/ ̂F8) + (1- α) ̂a12
̂F12 = γ (x12/ ̂a12) + (1- γ) ̂F8
MIT Center for Transportation & Logistics – ESD.260 19 © Chris Caplice, MIT
Time Series: Level, Seasonal, & Trended Data
Expand exponential model to include seasonality
Winter’s Method – Similar to Holt’s Method with added term
Seasonality is multiplicative

Underlying Model:
x t = (a+bt) Ft + e t

Demand rate
where: e t ~ iid (μ=0 , σ2=V[e]) a

Forecasting Model: time

̂xt,t+τ =( ̂at +τ ̂bt) ̂Ft+τ-P

Demand rate
b

Where : ̂at = α(xt/ ̂Ft-P) + (1- α)( ̂at-1+ ̂bt-1)


time
̂bt = β( ̂at - ̂at-1) + (1- β) ̂bt-1
̂Ft = γ(xt/ ̂at) + (1- γ) ̂Ft-P S

Demand rate
time

MIT Center for Transportation & Logistics – ESD.260 20 © Chris Caplice, MIT
Comments on Time Series Models
Most of the work is bookkeeping
„ Initialization procedures can be arbitrary
„ Adding seasonality greatly complicates calculations
Most of the value comes from sharing with users
„ Provide insights into explaining abnormalities
„ Assist in initial formulations and models
Picking appropriate smoothing factors
„ Level (α)
Š Stationary: ranges from 0.01 to 0.30 (0.1 reasonable)
Š Trend/Season: ranges from 0.02 to 0.51 (0.19 reasonable)
„ Trend (β)
Š Ranges from 0.005 to 0.176 (0.053 reasonable)
„ Seasonality (γ)
Š Ranges from 0.05 to 0.50 (0.10 reasonable)

MIT Center for Transportation & Logistics – ESD.260 21 © Chris Caplice, MIT
Questions, Comments,
Suggestions?

You might also like