Demand Forecasting : Time Series Models Professor Stephen R. Lawrence

Transcription

Demand Forecasting : Time Series Models Professor Stephen R. Lawrence
Demand Forecasting:
Time Series Models
Professor Stephen R. Lawrence
College of Business and Administration
University of Colorado
Boulder, CO 80309-0419
Forecasting Horizons

Long Term
 5+ years into the future
 R&D, plant location, product planning
 Principally judgement-based

Medium Term
 1 season to 2 years
 Aggregate planning, capacity planning, sales forecasts
 Mixture of quantitative methods and judgement

Short Term
 1 day to 1 year, less than 1 season
 Demand forecasting, staffing levels, purchasing, inventory levels
 Quantitative methods
Short Term Forecasting:
Needs and Uses

Scheduling existing resources
 How many employees do we need and when?
 How much product should we make in anticipation of demand?

Acquiring additional resources
 When are we going to run out of capacity?
 How many more people will we need?
 How large will our back-orders be?

Determining what resources are needed
 What kind of machines will we require?
 Which services are growing in demand? declining?
 What kind of people should we be hiring?
Types of Forecasting Models

Types of Forecasts
 Qualitative --- based on experience, judgement, knowledge;
 Quantitative --- based on data, statistics;

Methods of Forecasting
 Naive Methods --- eye-balling the numbers;
 Formal Methods --- systematically reduce forecasting errors;
– time series models (e.g. exponential smoothing);
– causal models (e.g. regression).
 Focus here on Time Series Models

Assumptions of Time Series Models
 There is information about the past;
 This information can be quantified in the form of data;
 The pattern of the past will continue into the future.
Forecasting Examples

Examples from student projects:





Demand for tellers in a bank;
Traffic on major communication switch;
Demand for liquor in bar;
Demand for frozen foods in local grocery warehouse.
Example from Industry: American Hospital Supply Corp.





70,000 items;
25 stocking locations;
Store 3 years of data (63 million data points);
Update forecasts monthly;
21 million forecast updates per year.
Simple Moving Average

Forecast Ft is average of n previous observations or
actuals Dt :
Ft 1
Ft 1
1
 ( Dt  Dt 1    Dt 1n )
n
1 t

Di

n i t 1n
Note that the n past observations are equally weighted.
 Issues with moving average forecasts:





All n past observations treated equally;
Observations older than n are not included at all;
Requires that n past observations be retained;
Problem when 1000's of items are being forecast.
Simple Moving Average
Include n most recent observations
 Weight equally
 Ignore older observations

weight
1/n
n
...
3
2
1
today
Moving Average
Internet Unicycle Sales
n=3
450
400
350
Units
300
250
200
150
100
50
0
Apr-01
Sep-02
Jan-04
May-05
Oct-06
Feb-08
Month
Jul-09
Nov-10
Apr-12
Aug-13
Example:
Moving Average
Forecasting
Exponential Smoothing I
Include all past observations
 Weight recent observations much more heavily
than very old observations:

weight
Decreasing weight given
to older observations
today
Exponential Smoothing I
Include all past observations
 Weight recent observations much more heavily
than very old observations:

0  1
weight

Decreasing weight given
to older observations
today
Exponential Smoothing I
Include all past observations
 Weight recent observations much more heavily
than very old observations:

0  1
weight

 (1  )
Decreasing weight given
to older observations
today
Exponential Smoothing I
Include all past observations
 Weight recent observations much more heavily
than very old observations:

0  1

 (1   )
weight
Decreasing weight given
to older observations
 (1   ) 2
today
Exponential Smoothing: Concept
Include all past observations
 Weight recent observations much more heavily
than very old observations:

0  1
weight

 (1   )
Decreasing weight given
to older observations
 (1   ) 2
 (1   )
today

3
Exponential Smoothing: Math
Ft  Dt   (1   ) Dt 1   (1   ) 2 Dt 2  
Ft  Dt  (1   )Dt 1   (1  a ) Dt 2  
Exponential Smoothing: Math
Ft  Dt   (1   ) Dt 1   (1   ) 2 Dt 2  
Ft  Dt  (1   )Dt 1   (1  a ) Dt 2  
Ft  aDt  (1  a ) Ft 1
Exponential Smoothing: Math
Ft  aDt  a (1  a ) Dt 1  a (1  a ) 2 Dt 2  
Ft  aDt  (1  a ) Ft 1
Thus, new forecast is weighted sum of old forecast and actual
demand
 Notes:

 Only 2 values (Dt and Ft-1 ) are required, compared with n for moving
average
 Parameter a determined empirically (whatever works best)
 Rule of thumb:  < 0.5
 Typically,  = 0.2 or  = 0.3 work well

Forecast for k periods into future is:
Ft  k  Ft
Exponential Smoothing
Internet Unicycle Sales (1000's)
450
400
 = 0.2
350
Units
300
250
200
150
100
50
0
Jan-03
May-04
Sep-05
Feb-07
Jun-08
Month
Nov-09
Mar-11
Aug-12
Example:
Exponential Smoothing
Complicating Factors
 Simple
Exponential Smoothing works well
with data that is “moving sideways”
(stationary)
 Must be adapted for data series which
exhibit a definite trend
 Must be further adapted for data series
which exhibit seasonal patterns
Holt’s Method:
Double Exponential Smoothing

What happens when there is a definite trend?
A trendy clothing boutique has had the following sales
over the past 6 months:
1
2
3
4
5
6
510
512
528
530
542
552
560
550
540
Demand530
520
510
500
490
480
Actual
Forecast
1
2
3
4
5
6
Month
7
8
9
10
Holt’s Method:
Double Exponential Smoothing

Ideas behind smoothing with trend:
 ``De-trend'' time-series by separating base from trend effects
 Smooth base in usual manner using 
 Smooth trend forecasts in usual manner using 

Smooth the base forecast Bt
Bt  Dt  (1   )( Bt 1  Tt 1 )

Smooth the trend forecast Tt
Tt   ( Bt  Bt 1 )  (1   )Tt 1

Forecast k periods into future Ft+k with base and trend
Ft k  Bt  kTt
ES with Trend
Internet Unicycle Sales (1000's)
450
400
 = 0.2,  = 0.4
350
Units
300
250
200
150
100
50
0
Jan-03
May-04
Sep-05
Feb-07
Jun-08
Month
Nov-09
Mar-11
Aug-12
Example:
Exponential Smoothing
with Trend
Winter’s Method:
Exponential Smoothing
w/ Trend and Seasonality

Ideas behind smoothing with trend and seasonality:
 “De-trend’: and “de-seasonalize”time-series by separating base from
trend and seasonality effects
 Smooth base in usual manner using 
 Smooth trend forecasts in usual manner using 
 Smooth seasonality forecasts using g

Assume m seasons in a cycle




12 months in a year
4 quarters in a month
3 months in a quarter
et cetera
Winter’s Method:
Exponential Smoothing
w/ Trend and Seasonality

Smooth the base forecast Bt
Dt
Bt  
 (1   )( Bt 1  Tt 1 )
St  m

Smooth the trend forecast Tt
Tt   ( Bt  Bt 1 )  (1   )Tt 1

Smooth the seasonality forecast St
Dt
St  g
 (1  g ) St m
Bt
Winter’s Method:
Exponential Smoothing
w/ Trend and Seasonality

Forecast Ft with trend and seasonality
Ft k  ( Bt 1  kTt 1 ) St k m

Smooth the trend forecast Tt
Tt   ( Bt  Bt 1 )  (1   )Tt 1

Smooth the seasonality forecast St
Dt
St  g
 (1  g ) St m
Bt
ES with Trend and Seasonality
Internet Unicycle Sales (1000's)
500
450
 = 0.2,  = 0.4, g = 0.6
400
350
Units
300
250
200
150
100
50
0
Jan-03
May-04
Sep-05
Feb-07
Jun-08
Month
Nov-09
Mar-11
Aug-12
Example:
Exponential Smoothing
with
Trend and Seasonality
Forecasting Performance
How good is the forecast?

Mean Forecast Error (MFE or Bias): Measures
average deviation of forecast from actuals.

Mean Absolute Deviation (MAD): Measures
average absolute deviation of forecast from
actuals.

Mean Absolute Percentage Error (MAPE):
Measures absolute error as a percentage of the
forecast.

Standard Squared Error (MSE): Measures
variance of forecast error
Forecasting Performance Measures
n
1
MFE   ( Dt  Ft )
n t 1
1 n
MAD   Dt  Ft
n t 1
100 n Dt  Ft
MAPE 

n t 1 Dt
1 n
2
MSE   ( Dt  Ft )
n t 1
Mean Forecast Error (MFE or Bias)
n
1
MFE   ( Dt  Ft )
n t 1
Want MFE to be as close to zero as possible -minimum bias
 A large positive (negative) MFE means that the forecast
is undershooting (overshooting) the actual observations
 Note that zero MFE does not imply that forecasts are
perfect (no error) -- only that mean is “on target”
 Also called forecast BIAS

Mean Absolute Deviation (MAD)
1 n
MAD   Dt  Ft
n t 1
Measures absolute error
 Positive and negative errors thus do not cancel out (as
with MFE)
 Want MAD to be as small as possible
 No way to know if MAD error is large or small in
relation to the actual data

Mean Absolute Percentage Error
(MAPE)
100 n Dt  Ft
MAPE 

n t 1 Dt
Same as MAD, except ...
 Measures deviation as a percentage of actual data

Mean Squared Error (MSE)
1 n
2
MSE   ( Dt  Ft )
n t 1
Measures squared forecast error -- error variance
 Recognizes that large errors are disproportionately more
“expensive” than small errors
 But is not as easily interpreted as MAD, MAPE -- not as
intuitive

Fortunately, there is software...