sales and operations planning (sop) - demand forecasting

9
Sales and operations planning (SOP) Demand forecasting To balance supply with demand and synchronize all oper- ational plans Capture demand data Demand forecasting Balancing of supply, demand, and budgets. Deter- mine the best product mix, optimal inventory targets, postponement strategies, and supply plans Adapt and adjust to changing business conditions: Sim- ulate multiple business scenarios; react quickly to chang- ing conditions through automated exception manage- ment Integrated Solution: Drive continuous improvement through integrated performance management Sub-tasks Demand Planning, Advanced Supply Chain Planning, Collaborative Planning, Inventory Optimization, Man- ufacturing Scheduling, and Global Order Promising. 1 Forecasting, introduction Predict demands and resources to schedule production Sales of computers Energy production Seats in airplane Motivation: Beer game Time series measuring quantity of interest X 1 , X 2 ,..., X t forecast values at X t +1 , X t +2 ,... our predictions are denoted ˆ X t +1 , ˆ X t +2 ,... Assume measurements in time series are correlated 2 Motivation Australian Wine Sales 5 0 0 . 1 0 0 0 . 1 5 0 0 . 2 0 0 0 . 2 5 0 0 . 3 0 0 0 . 0 2 0 4 0 6 0 8 0 1 0 0 1 2 0 1 4 0 S e rie s Trend Seasonal variation Irregular variation 3 Components Trend (global heating brings more rain) Seasonal variation (swim suits sold every spring) Cyclical variation (beer consumption increase during Soccer Championship) Irregular variation Seasonal and cyclical variation Multiplicative: (beer consumption increase hot days) dependent on current sales Additive: (beer consumption during Roskilde Festival) independent of current sales 4

Upload: bakkour

Post on 28-Nov-2014

203 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Sales and Operations Planning (SOP) - Demand Forecasting

Sales and operations planning (SOP)Demand forecasting

To balance supply with demand and synchronize all oper-ational plans

• Capture demand data

• Demand forecasting

• Balancing of supply, demand, and budgets. Deter-mine the best product mix, optimal inventory targets,postponement strategies, and supply plans

• Adapt and adjust to changing business conditions: Sim-ulate multiple business scenarios; react quickly to chang-ing conditions through automated exception manage-ment

• Integrated Solution: Drive continuous improvementthrough integrated performance management

Sub-tasks

• Demand Planning, Advanced Supply Chain Planning,Collaborative Planning, Inventory Optimization, Man-ufacturing Scheduling, and Global Order Promising.

1

Forecasting, introduction

Predict demands and resources to schedule production

• Sales of computers

• Energy production

• Seats in airplane

Motivation: Beer game

Time series measuring quantity of interest

X1,X2, . . . ,Xt

forecast values at

Xt+1,Xt+2, . . .

our predictions are denoted

X̂t+1, X̂t+2, . . .

Assume measurements in time series are correlated

2

Motivation

Australian Wine SalesRecall Australian Red Wine Sales

5 0 0 .

1 0 0 0 .

1 5 0 0 .

2 0 0 0 .

2 5 0 0 .

3 0 0 0 .

0 2 0 4 0 6 0 8 0 1 0 0 1 2 0 1 4 0

S e r ie s

• Trend

• Seasonal variation

• Irregular variation

3

Components

• Trend (global heating brings more rain)

• Seasonal variation (swim suits sold every spring)

• Cyclical variation (beer consumption increase duringSoccer Championship)

• Irregular variation

Seasonal and cyclical variation

• Multiplicative:(beer consumption increase hot days)dependent on current sales

• Additive:(beer consumption during Roskilde Festival)independent of current sales

4

Page 2: Sales and Operations Planning (SOP) - Demand Forecasting

ModelsRecall Australian Red Wine Sales

5 0 0 .

1 0 0 0 .

1 5 0 0 .

2 0 0 0 .

2 5 0 0 .

3 0 0 0 .

0 2 0 4 0 6 0 8 0 1 0 0 1 2 0 1 4 0

S e r ie s

Additive model with trend

Xt = L+Tt +St + It

Multiplicative model with trend

Xt = (L+Tt)St + It

where

• L level of series

• Tt trend time t

• St seasonal variation time t

• It irregular variation time t

forecasting: model fitting to time series

5

Quality of forecast

• Error εt = |X̂t −Xt|

• Error total ∑nt=1 εt

• Mean squared error 1n ∑n

t=1 ε2t

• Root mean squared error√

1n ∑n

t=1 ε2t

Punish large errors more than small errors

Model selection

• Analyze problem, use experience, common sense

• Automatic model selection

– For all models– For all parameters– Evaluate error of forecast up to time t– Use best model for future time

6

Overview

• Moving average, weighted moving average

• First order exponential smoothing

• Second order exponential smoothing

• Trends and seasonal pattern

• Croston’s method

• Hyndman unified framework

7

Moving Average

ES would work well here

Typical Behavior for Exponential Smoothing

-14

-12

-10

-8

-6

-4

-2

0

2

4

1 7 13 19 25 31 37 43 49 55 61 67 73 79 85 91 97 103

109

115

Period

De

ma

nd

Given observations

X1,X2, . . . ,Xt

Level at time t

Lt =1m

m−1

∑i=0

Xt−i

ForecastX̂t+i = Lt for i = 1,2, . . .

• advantage large m

• advantage small m

• average age of data m/2

8

Page 3: Sales and Operations Planning (SOP) - Demand Forecasting

Weighted Moving Average

Level at time t

Lt =t

∑i=1

WiXi

where Wi is weight attached to each historic pointW1 +W2 + . . .+Wt = 1

ForecastX̂t+i = Lt for i = 1,2, . . .

New data more weight than old data

all forecasting schemes are variants ofweighted moving average

Weights on past data

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

1 2 3 4 5 6 7 8 9 10

Expo Smooth a=0.6

MoveAve(M=5)

9

Exponential Smoothing

Data have no trend or seasonal pattern

Lt = Lt−1 +α(Xt −Lt−1)

(correct mistake of last forecast)

Lt = αXt +(1−α)Lt−1

(weighted average of last observation and last forecast)Forecast

X̂t+i = Lt for i = 1,2, . . .

Substituting Lt−1 = αXt−1 +(1−α)Lt−2 we get

Lt = αXt +α(1−α)Xt−1 +(1−α)2Lt−2

Repeating substitution

Lt = αXt +α(1−α)Xt−1 +α(1−α)2Xt−2

+α(1−α)3Xt−3 + . . .

Weights decrease exponentially (exponential smoothing)

• Appropriate for mean plus noise

• Or when mean is wandering around

• Quite stable processesNote: some authors use 1−α instead of α

10

Exponential Smoothing

-4

-3

-2

-1

0

1

2

3

4

1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91 96

Series

Mean

Shifting Mean + Zero Mean White Noise

-4

-3

-2

-1

0

1

2

3

4

1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91 96

Series

0.1

Mean

11

Exponential Smoothing

-4

-3

-2

-1

0

1

2

3

4

1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91 96

Series

0.3

Mean

Choice of smoothing parameter α

RMSE vs Alpha

1.15

1.2

1.25

1.3

1.35

1.4

1.45

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Alpha

RM

SE

12

Page 4: Sales and Operations Planning (SOP) - Demand Forecasting

Exponential Smoothing

Actual vs Forecast for Various Alpha

-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

1 7 13 19 25 31 37 43 49 55 61 67 73 79 85 91 97

Period

Fo

reca

st

Demand

a=0.1

a=0.3

a=0.9

Smoothing parameter α, 0 < α < 1

• Large α, adjust more quickly to changes

• Small α, more averaging, stable

Typically α should be 0.05 – 0.3

RMSE analysis show larger α, smoothing not appropriate

13

Exponential Smoothing

Series and Forecast using Alpha=0.9

-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91 96 101

Period

Fo

reca

st

Series and Forecast using Alpha=0.9

-0.5

0

0.5

1

1.5

2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

PeriodF

ore

cast

14

Exponential Smoothing

Forecast RMSE vs Alpha

0.57

0.58

0.59

0.6

0.61

0.62

0.63

0.64

0.65

0.66

0.67

0 0.2 0.4 0.6 0.8 1

Alpha

Fo

reca

st R

MS

E

Series1

15

Exponential Smoothing on a Trend

Exponential Smoothing on a Trend

0

2

4

6

8

10

12

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

Period

Trend Data

0.2

0.5

Exponential smoothing will lag behind a trend

16

Page 5: Sales and Operations Planning (SOP) - Demand Forecasting

Exponential Smoothing on a Trend

Data have trend but no seasonal pattern

Ordinary exponential smoothing

Lt = αXt +(1−α)Lt−1

Double exponential smoothing (Holt 1957)

Level:Lt = αXt +(1−α)(Lt−1 +Tt−1)

Trend:Tt = β(Lt −Lt−1)+(1−β)Tt−1

(weighted average new trend, trend last time)

Starting values (t ≥ 2)

T2 = X2−X1, L2 = X2

Forecast:X̂t+i = Lt + iTt

Smoothing parameters 0 < α < 1 and 0 < β < 1

17

Exponential Smoothing on a Trend

-1

0

1

2

3

4

5

6

1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91 96 101

Trend

Series

Example

-1

0

1

2

3

4

5

6

1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91 96 101

Trend

Series Data

Single Smoothing

Double smoothing

α=0.2

Overshoots (dot-com, house prices?)

18

Exponential Smoothing, Seasonal Pattern

Xt =(1 + 0.04t)(1.5,0.5,1)

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

5

1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58

(1+0.04t)

Australian Wine SalesRecall Australian Red Wine Sales

5 0 0 .

1 0 0 0 .

1 5 0 0 .

2 0 0 0 .

2 5 0 0 .

3 0 0 0 .

0 2 0 4 0 6 0 8 0 1 0 0 1 2 0 1 4 0

S e r ie s

19

Exponential Smoothing, Seasonal Pattern

Data have trend and seasonal pattern

Multiplicative Seasonal Series (Winters 1960)

• St multiplicative seasonal factor time t

• Season length s

Xt = (L+Tt)St + It

Level:

Lt = αXt

St−s+(1−α)(Lt−1 +Tt−1)

Trend:Tt = β(Lt −Lt−1)+(1−β)Tt−1

Seasonal factor:

St = γXt

Lt−1 +Tt−1+(1− γ)St−s

Forecast:

X̂t+i =

{

(Lt + iTt)St+i−s for i = 1,2, . . . ,s(Lt + iTt)St+i−2s for i = s+1,s+2, . . . ,2s. . .

Smoothing parameters 0 < α < 1, 0 < β < 1 and 0 < γ < 1.

20

Page 6: Sales and Operations Planning (SOP) - Demand Forecasting

Exponential Smoothing, Seasonal Pattern

Additive Seasonal Series

Xt = L+Tt +St + It

Level:

Lt = α(Xt −St−s)+(1−α)(Lt−1 +Tt−1)

Trend:Tt = β(Lt −Lt−1)+(1−β)Tt−1

Seasonal factor:

St + γ(Xt −Lt−1 −Tt−1)+(1− γ)St−s

Forecast:

X̂t+i =

{

Lt + iTt +St+i−s for i = 1,2, . . . ,sLt + iTt +St+i−2s for i = s+1,s+2, . . . ,2s. . .

21

Croston’s Method

Demand Distribution

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0 1 2 3 4 5 6 7 8 9

Demand

Pro

bab

ilit

y

• Small quantities (e.g. sales of cars)

• Fine-grained time series (e.g. automatic data collec-tion)

• Orders in huge quantities (e.g. containers of beer)

22

Croston’s Method

Example

An intermittent Demand Series

0

0.5

1

1.5

2

2.5

3

3.5

1 14 27 40 53 66 79 92 105

118

131

144

157

170

183

196

209

222

235

248

261

274

287

300

313

326

339

352

365

378

391

Period

Dem

and

Example

�Exponential smoothing applied (α=0.2)

Exponential Smoothing Applied

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1 19

37

55

73

91

109

127

145

163

181

199

217

235

253

271

289

307

325

343

361

379

397

Period

Dem

an

d

Exponential smoothing

• Forecast is highest right after non-zero demand

• Forecast is lowest right before non-zero demand

23

Croston’s Method

Keep track on

• Time between non-zero demands

• Demand size when non-zero

• Smooth both time between and demand size

• Combine both for forecasting

Definitions

• Xt demand time t

• X̂t predicted demand at time t

• Zt estimate of demand when not zero

• Tt time between non-zero demands

• q time since last non-zero demand

24

Page 7: Sales and Operations Planning (SOP) - Demand Forecasting

Croston’s Method

Example

An intermittent Demand Series

0

0.5

1

1.5

2

2.5

3

3.5

1 14 27 40 53 66 79 92 105

118

131

144

157

170

183

196

209

222

235

248

261

274

287

300

313

326

339

352

365

378

391

Period

Dem

and

Update (if zero demand)

Zt = Zt−1

Tt = Tt−1

q = q+1

Update (if not zero demand)

Zt = α(Xt −Zt−1)+(1−α)Zt−1

Tt = α(q−Tt−1)+(1−α)Tt−1

q = 1

ForecastX̂t =

Zt

Tt

25

Croston’s Method

Example

An intermittent Demand Series

0

0.5

1

1.5

2

2.5

3

3.5

1 14 27 40 53 66 79 92 105

118

131

144

157

170

183

196

209

222

235

248

261

274

287

300

313

326

339

352

365

378

391

Period

Dem

and

Recall example

�Croston’ s method applied (α=0.2)

Croston's Method Applied to Example Data

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1 12 23 34 45 56 67 78 89 100

111

122

133

144

155

166

177

188

199

210

221

232

243

254

265

276

287

298

309

320

331

342

353

364

375

386

397

26

Hyndman (2002)

Seasonal ComponentTrend N A MComponent (none) (additive) (multiplicative)

N (none) NN NA NMA (additive) AN AA AMM (multiplicative) MN MA MMD (damped) DN DA DM

Damped: trend is damped over long horizons

NN Simple exponential smoothing

AN Holt’s linear method

AA Holt-Winter’s method (additive)

AM Holt-Winter’s method (multiplicative)

12 exponential smoothing methodsLevel `t = αPt +(1−α)Qt

Trend bt = βRt +(φ−β)bt−1

Seasonal st = γTt +(1− γ)st−m

Values Pt,Qt,Rt,Tt vary• Smoothing parameters α,β,γ• Damping φ

27

Terminology

• Yt observed value time t (was Xt)

• Yt(1) forecast one step ahead at time t (was X̂t)

• Level `t (was Lt)

• Trend bt (was Tt)

• Season st (was St)

• Season length m (was s)

28

Page 8: Sales and Operations Planning (SOP) - Demand Forecasting

HyndmanForecasting based on state space models for exponential smoothing 6

Seasonal component

Trend N A Mcomponent (none) (additive) (multiplicative)

Pt = Yt Pt = Yt − st−m Pt = Yt/st−m

N Qt = `t−1 Qt = `t−1 Qt = `t−1

(none) Tt = Yt − Qt Tt = Yt/Qt

φ = 1 φ = 1 φ = 1Yt(h) = `t Yt(h) = `t + st+h−m Yt(h) = `tst+h−m

Pt = Yt Pt = Yt − st−m Pt = Yt/st−m

A Qt = `t−1 + bt−1 Qt = `t−1 + bt−1 Qt = `t−1 + bt−1

(additive) Rt = `t − `t−1 Rt = `t − `t−1 Rt = `t − `t−1

Tt = Yt − Qt Tt = Yt/Qt

φ = 1 φ = 1 φ = 1Yt(h) = `t + hbt Yt(h) = `t + hbt + st+h−m Yt(h) = (`t + hbt)st+h−m

Pt = Yt Pt = Yt − st−m Pt = Yt/st−m

M Qt = `t−1bt−1 Qt = `t−1bt−1 Qt = `t−1bt−1

(multiplicative) Rt = `t/`t−1 Rt = `t/`t−1 Rt = `t/`t−1

Tt = Yt − Qt Tt = Yt/Qt

φ = 1 φ = 1 φ = 1

Yt(h) = `tbht Yt(h) = `tb

ht + st+h−m Yt(h) = `tb

ht st+h−m

Pt = Yt Pt = Yt − st−m Pt = Yt/st−m

D Qt = `t−1 + bt−1 Qt = `t−1 + bt−1 Qt = `t−1 + bt−1

(damped) Rt = `t − `t−1 Rt = `t − `t−1 Rt = `t − `t−1

Tt = Yt − Qt Tt = Yt/Qt

β < φ < 1 β < φ < 1 β < φ < 1Yt(h) = `t+ Yt(h) = `t+ Yt(h) = [`t+

(1 + φ + · · · + φh−1)bt (1 + φ + · · · + φh−1)bt + st+h−m (1 + φ + · · · + φh−1)bt]st+h−m

Table 1: Formulae for recursive calculations and point forecasts.

Writing (2.1)–(2.3) in their error-correction form we obtain

`t = Qt + α(Pt − Qt) (2.4)

bt = φbt−1 + β(Rt − bt−1) (2.5)

st = st−m + γ(Tt − st−m). (2.6)

The method with fixed level (constant over time) is obtained by setting α = 0, the method

with fixed trend (drift) is obtained by setting β = 0, and the method with fixed seasonal

pattern is obtained by setting γ = 0. Note also that the additive trend methods are obtained

by letting φ = 1 in the damped trend methods.

29

HyndmanForecasting based on state space models for exponential smoothing 7

Trend Seasonal componentcomponent N A M

(none) (additive) (multiplicative)

N µt = `t−1 µt = `t−1 + st−m µt = `t−1st−m

(none) `t = `t−1 + αεt `t = `t−1 + αεt `t = `t−1 + αεt/st−m

st = st−m + γεt st = st−m + γεt/`t−1

µt = `t−1 + bt−1 µt = `t−1 + bt−1 + st−m µt = (`t−1 + bt−1)st−m

A `t = `t−1 + bt−1 + αεt `t = `t−1 + bt−1 + αεt `t = `t−1 + bt−1 + αεt/st−m

(additive) bt = bt−1 + αβεt bt = bt−1 + αβεt bt = bt−1 + αβεt/st−m

st = st−m + γεt st = st−m + γεt/(`t−1 + bt−1)

µt = `t−1bt−1 µt = `t−1bt−1 + st−m µt = `t−1bt−1st−m

M `t = `t−1bt−1 + αεt `t = `t−1bt−1 + αεt `t = `t−1bt−1 + αεt/st−m

(multiplicative) bt = bt−1 + αβεt/`t−1 bt = bt−1 + αβεt/`t−1 bt = bt−1 + αβεt/(st−m`t−1)st = st−m + γεt st = st−m + γεt/(`t−1bt−1)

µt = `t−1 + bt−1 µt = `t−1 + bt−1 + st−m µt = (`t−1 + bt−1)st−m

D `t = `t−1 + bt−1 + αεt `t = `t−1 + bt−1 + αεt `t = `t−1 + bt−1 + αεt/st−m

(damped) bt = φbt−1 + αβεt bt = φbt−1 + αβεt bt = φbt−1 + αβεt/st−m

st = st−m + γεt st = st−m + γεt/(`t−1 + bt−1)

Table 2: State space equations for each additive error model in the classification. Multiplicative errormodels are obtained by replacing εt by µtεt in the above equations.

3 State space models

HKSG describe the state space models that underlie the exponential smoothing methods.

For each method, there are two models—a model with additive errors and a model with

multiplicative errors. The pointwise forecasts for the two models are identical, but prediction

intervals will differ.

The general model involves a state vector xt = (`t, bt, st, st−1, . . . , st−(m−1)) and state space

equations of the form

Yt = µt + k(xt−1)εt (3.1)

xt = f (xt−1) + g(xt−1)εt (3.2)

where {εt} is a Gaussian white noise process with mean zero and variance σ2 and µt =

Yt−1(1). The model with additive errors has k(xt−1) = 1, so that Yt = µt + εt. The model

with multiplicative errors has k(xt−1) = µt, so that Yt = µt(1 + εt). Thus, εt = (Yt − µt)/µt is

a relative error for the multiplicative model.

All the methods in Table 1 can be written in the form (3.1) and (3.2). The underlying equa-

tions are given in Table 2. The models are not unique. Clearly, any value of k(xt−1) will

• Two variants of state-space model (additive error, mul-tiplicative error)

• Likelihood functions

• Model selection

Automatic model selection, parameter optimizationApplied to M3 competition

30

Forecasting is model fitting to time series

• Linear Trend (regression)

• Linear Trend and Additive Seasonality

• Linear Trend and Multiplicative Seasonality

• Polynomial

• Logarithmic

• Exponential

Frequency identification

• All forecasting methods assume season known

• Identify seasonality of time series

De-noising

• Removing noise from time series improves forecast

• Haar Wavelet transformation

• Daubechies Wavelet transformation

Fourier transformation

• ???

31

Advanced methods

• Stochastic models

• Likelihood calculations

• Prediction intervals

• Procedures for model selection

Neural Networks

• Trained for model selection

• Smoothing parameters

32

Page 9: Sales and Operations Planning (SOP) - Demand Forecasting

Forecasting is important

• Forecasts of sales

• Sales prices of houses and flats

• Water level in lakes

• Share prices

Which forecast method should we use in Beer game?Xt = {4,4,4,4,8,8,8, . . .}

Discussion

• Stochastic programming

• Deterministic optimization (using forecasts)

Data sets

• Famous M1, M2, M3 (April 2006) competitionhttp://mktg-sun.wharton.upenn.edu/forecast/m3-competition.html

– 645 annual series– 756 quarterly series– 174 other series– 1428 monthly series

33

Acknowledgements

Figures from

• HOLT WINTERS file archivehttp://www.barbich.net/holt/

34