Forecasting

Download as pdf or txt
Download as pdf or txt
You are on page 1of 52

Operations and Supply Chain Management IIITDM, Kurnool

Operations and Supply Chain Management


Operations and Supply Chain Management

Forecasting

2
Operations and Supply Chain Management
Forecasting—Famous Quotations 1

I think there is a world market for maybe five computers.


Thomas Watson, IBM, 1943

640K ought to be enough for anybody.


Bill Gates, 1981

Everything that can be invented has been invented.


Commissioner, US Office of Patents, 1899

Prediction is very difficult, especially if it’s about the future.


Niels Bohr

I always avoid prophesying beforehand because it is much


better to prophesy after the event has already taken place.
Winston Churchill

An economist is an expert who will know tomorrow why the


things he predicted yesterday didn’t happen today.
Evan Esar
Operations and Supply Chain Management
What is forecasting all about?
Demand for Mercedes E Class We try to predict the
future by looking back
at the past

Predicted
demand
looking
Time back six
Jan Feb Mar Apr May Jun Jul Aug months
Actual demand (past sales)
Predicted demand
Operations and Supply Chain Management

Some general characteristics of forecasts

• Forecasts are always wrong


• Forecasts are more accurate for groups or families of
items
• Forecasts are more accurate for shorter time periods
• Every forecast should include an error estimate
• Forecasts are no substitute for calculated demand.
Operations and Supply Chain Management

What Makes a Good Forecast?


• It should be timely
• It should be as accurate as possible
• It should be reliable
• It should be in meaningful units
• It should be presented in writing
• The method should be easy to use and
understand in most cases.
Operations and Supply Chain Management

Uses of Forecasts
Accounting Cost/profit estimates

Finance Cash flow and funding

Human Resources Hiring/recruiting/training

Marketing Pricing, promotion, strategy

MIS IT/IS systems, services

Operations Schedules, MRP, workloads

Product/service design New products and services

8
Operations and Supply Chain Management

REMARKS
• Assume a causal system
• Future resembles the past
• Forecasts rarely perfect because of randomness
• Forecasts more accurate for groups vs. individuals.
• Forecasting errors among items in a group usually have a canceling
effect.
• Extremes in a group cancel each other
• Ex. I can forecast the class average from the midterm better than
Mrs. X’s individual grade.
• Sample variance of {-1,1,-1,1} is 1.
• Sample variance of {(-1+1)/2, {(-1+1)/2} is 0.
• Forecast accuracy decreases as time horizon for forecasts increases
• Ex. I can forecast this year’s class average better than next year’s
class average
9
Operations and Supply Chain Management

Elements of a Good Forecast

Timely

Reliable Accurate

Written

10
Operations and Supply Chain Management

Steps in the Forecasting Process

“The forecast”

Step 6 Monitor the forecast


Step 5 Prepare the forecast
Step 4 Gather and analyze data
Step 3 Select a forecasting technique
Step 2 Establish a time horizon
Step 1 Determine purpose of forecast

11
Operations and Supply Chain Management
Key issues in forecasting

1. A forecast is only as good as the information included in the


forecast (past data)
2. History is not a perfect predictor of the future (i.e.: there is
no such thing as a perfect forecast)

REMEMBER: Forecasting is based on the assumption


that the past predicts the future! When forecasting, think
carefully whether or not the past is strongly related to
what you expect to see in the future…
Operations and Supply Chain Management
What should we consider when looking at
past demand data?

• Trends

• Seasonality

• Cyclical elements

• Autocorrelation

• Random variation
Operations and Supply Chain Management

Some Important Questions

• What is the purpose of the forecast?


• Which systems will use the forecast?
• How important is the past in estimating the future?

Answers will help determine time horizons, techniques,


and level of detail for the forecast.
For example, they could have demand for a
particular product; let us say in the last 6 years as 25, 32, 24, 28, 26 and 27.

25 27 Average

32 26.25 Average of last 4 values

24 28 Increase 2 values Trend

28 30 Other factors

26 26 Increase or decrease trend

27 27 Average of last 3

? 26.833 Weighted on 3 values

26 Remove 32 find average


Operations and Supply Chain Management

Types of forecasting methods

Qualitative methods Quantitative methods

Rely on subjective Rely on data and


opinions from one or analytical techniques.
more experts.
Operations and Supply Chain Management

Forecasting Models
Forecasting
Techniques

Qualitative Time Series


Models Methods

Delphi
Naive
Method
Moving
Jury of Executive
Average
Opinion
Weighted
Sales Force
Moving Average
Composite
Exponential
Consumer Market
Smoothing
Survey

Trend Analysis
Causal
Methods
Seasonality
Simple Analysis
Regression
Analysis Multiplicative
Decomposition
Multiple
Regression
Analysis
Time Series: Naïve
– Naïve
• Whatever happened

Ft  Yt 1
recently will happen again
this time (same time
period)
• The model is simple and
flexible
• Provides a baseline to Ft  Yt  4 : Quarterly data
measure other models
• Attempts to capture Ft  Yt 12 : Monthly data
seasonal factors at the
expense of ignoring trend
Some notation: Forecast at time t is F(t)
Actual observation at time t is A(t)
Today is temperature is 98 F, A(Today)=98
F(Tomorrow)=98
F(Day after)=98
Time Series: Moving average

• The moving average model uses the last t periods in order to


predict demand in period t+1.
• There can be two types of moving average models: simple
moving average and weighted moving average
• The moving average model assumption is that the most
accurate prediction of future demand is a simple (linear)
combination of past demand.
Time Series: Simple Moving Average

In the simple moving average models the forecast value is

At + At-1 + … + At-n
Ft+1 =
n

t is the current period.


Ft+1 is the forecast for next period
n is the forecasting horizon (how far back we look),
A is the actual sales figure from each period.
Example: forecasting sales at Kroger

Kroger sells (among other stuff) bottled spring water

Month Bottles
Jan 1,325
Feb 1,353
Mar 1,305 What will
the sales be
Apr 1,275
for July?
May 1,210
Jun 1,195
Jul ?
What if we use a 3-month simple moving average?

AJun + AMay + AApr


FJul = = 1,227
3

What if we use a 5-month simple moving average?

AJun + AMay + AApr + AMar + AFeb


FJul = = 1,268
5
1400
1350
1300
5-month
1250
MA forecast
1200
3-month
1150 MA forecast
1100
1050
1000
0 1 2 3 4 5 6 7 8

What do we observe?

5-month average smoothes data more;


3-month average more responsive
Ex: Three period moving average
forecast
Month Demand
1 42 MA(6,3) = (43 + 40 + 41) / 3
2 40 = 41.33.
3 43 If A(6) = 39, then
4 40 MA(7,3) = (40 + 41 + 39) / 3
5 41 = 40.00
6 39

24
Time Series: Weighted Moving Average
We may want to give more importance to some of the data…

Ft+1 = wt At + wt-1 At-1 + … + wt-n At-n

wt + wt-1 + … + wt-n = 1

t is the current period.


Ft+1 is the forecast for next period
n is the forecasting horizon (how far back we look),
A is the actual sales figure from each period.
w is the importance (weight) we give to each period
Why do we need the WMA models?

Because of the ability to give more importance to what


happened recently, without losing the impact of the past.

Demand for Mercedes E-class Actual demand (past sales)


Prediction when using 6-month SMA
Prediction when using 6-months WMA

For a 6-month
SMA, attributing
equal weights to all
past data we miss
Time the downward trend
Jan Feb Mar Apr May Jun Jul Aug
Example: Kroger sales of bottled water

Month Bottles
Jan 1,325
Feb 1,353
What will
Mar 1,305
be the sales
Apr 1,275 for July?
May 1,210
Jun 1,195
Jul ?
6-month simple moving average…

AJun + AMay + AApr + AMar + AFeb + AJan


FJul = = 1,277
6

In other words, because we used equal weights, a slight downward


trend that actually exists is not observed…
What if we use a weighted moving average?

Make the weights for the last three months more than the first
three months…

6-month WMA WMA WMA


SMA 40% / 60% 30% / 70% 20% / 80%

July
1,277 1,267 1,257 1,247
Forecast

The higher the importance we give to recent data, the more we


pick up the declining trend in our forecast.
How do we choose weights?

1. Depending on the importance that we feel past data has


2. Depending on known seasonality (weights of past data
can also be zero).

WMA is better than SMA


because of the ability to
vary the weights!
Time Series: Exponential Smoothing (ES)

Main idea: The prediction of the future depends mostly on the


most recent observation, and on the error for the latest forecast.

Smoothing
constant Denotes the importance
alpha α of the past error
Why use exponential smoothing?

1. Uses less storage space for data


2. Extremely accurate
3. Easy to understand
4. Little calculation complexity
5. There are simple accuracy tests
Exponential Smoothing

Forecast error:=Actual – Forecast =A(t-1)-F(t-1)

Ft  Ft 1   ( At 1  Ft 1 )
Forecast today=Forecast yesterday+(alpha)*(Forecast error yesterday)
Each new forecast is equal to the previous forecast plus a percentage
of the previous error.
Today’s forecast
Depends on yesterday’s (time-wise dependence, strong memory)
But it has to be corrected by forecast error
Therefore, we should give more weight to the more recent time
periods when forecasting.
• Alpha = smoothing constant = percentage of the forecast error.
33
Exponential smoothing: the method

Assume that we are currently in period t. We calculated the


forecast for the last period (Ft-1) and we know the actual demand
last period (At-1) …

Ft  Ft1   ( At1  Ft1 )

The smoothing constant α expresses how much our forecast will


react to observed differences…
If α is low: there is little reaction to differences.
If α is high: there is a lot of reaction to differences.
Exponential Smoothing
as an Weighted Average
Ft  At 1  (1   ) Ft 1
Idea--The most recent observations might have the highest
predictive value along with the most recent forecast
errors. Let us balance them:

Ft

At 1 (1   ) Ft 1
35
Example: bottled water at Kroger

Month Actual Forecasted  = 0.2

Jan 1,325 1,370

Feb 1,353 1,361

Mar 1,305 1,359

Apr 1,275 1,349

May 1,210 1,334

Jun ? 1,309
Example: bottled water at Kroger

Month Actual Forecasted  = 0.8

Jan 1,325 1,370

Feb 1,353 1,334

Mar 1,305 1,349

Apr 1,275 1,314

May 1,210 1,283

Jun ? 1,225
Impact of the smoothing constant

1380
1360
1340
1320 Actual
1300
a = 0.2
1280
1260 a = 0.8
1240
1220
1200
0 1 2 3 4 5 6 7
Example of Exponential Smoothing
Forecasts made in a period and the period has the same color

Period Actual Forecast withAlpha


Error with
= 0.1
Forecast withError with
1 42 Alpha=0.1 Alpha=0.1 Alpha=0.4 Alpha=0.4
2 40 42 -2.00 42 -2
3 43 41.8 1.20 41.2 1.8
4 40 41.92 -1.92 41.92 -1.92
5 41 41.73 -0.73 41.15 -0.15
6 39 41.66 -2.66 41.09 -2.09
7 46 41.39 4.61 40.25 5.75
8 44 41.85 2.15 42.55 1.45
9 45 42.07 2.93 43.13 1.87
10 38 42.36 -4.36 43.88 -5.88
11 40 41.92 -1.92 41.53 -1.53
12 41.73 40.92

39 Ft  At 1  (1   ) Ft 1
Picking a Smoothing Constant:
Responsiveness vs. Smoothing
• The quickness of forecast adjustment to error is determined by the smoothing
constant.
• The closer the alpha is to zero, the slower the forecast will be to adjust to forecast
errors.
• Conversely, the closer the value of alpha is to 1.00, the greater the
responsiveness to the actual observations and the less the smoothing
• Select a smoothing constant that balances the benefits of responding to real
changes if and when they occur.

Ft  Ft 1   ( At 1  Ft 1 )  At 1  (1   ) Ft 1

 = 2/ ( N + 1)

40
Picking a Smoothing Constant
Sensitivity of Forecasts
Actual
50
Demand

45   0.1

40
  0.4
35
1 2 3 4 5 6 7 8 9 10 11 12
Period

Excel example
41
exponential-smoothing.xls
Operations and Supply Chain Management
Holt’s Model

Ft+1 = at+bt
at is the level which represents the smoothed
value to and including the last data
The slope of the line is given by bt
The forecast for the next period Ft+1 =at+bt
The values of at and bt are updated using
at = αDt + (1-α) (at-1 + bt-1) and
bt =β (at – at-1) +(1-β) bt-1
Operations and Supply Chain Management
Example

Data 26, 28, 29, 31, 32, 35


α = 0.2 and β =0.3
a1 = D1 = 26 and b1 as the approximately slope of the
line joining the points D1 and D6,
Therefore
b1 = (D6 – D1)/5 = 1.8
Therefore F2 = a1 +b1 =27.8
a2 = α D2 + (1- α) (a1 + b1) =0.2 * 28 + 0.8 *27.8 =27.84
b2 = β (a2 + a1) + (1-β) b1 = 0.3 * 1.84 +0.7 * 1.8 =
1.812
F3 = a2 + b2 = 29.652
Operations and Supply Chain Management
Example

at bt Ft
Period t Dt

1 26 26 1.8
2 28 27.84 1.812 27.8
3 29 29.5216 1.773 29.652
4 31 31.2352 1.756 31.294
5 32 32.792 1.696 32.99
6 35 34.592 1.7272 34.49
7 36.32
Operations and Supply Chain Management
Seasonality- Basic Model

Data Year 1 2 3 4

Q1 53 58 62 ?
Q2 22 25 27 ?
Q3 37 40 44 ?
Q4 45 50 56 ?
157 173 189 ?

Y=141 + 16 t

T=4, y=205
Operations and Supply Chain Management

Compute the seasonality Index

Year 1 2 3 Avg F

Q1 0.34 0.34 0.33 0.337


Q2 0.14 0.14 0.14 0.14
Q3 0.24 0.23 0.23 0.233
Q4 0.29 0.29 0.30 0.293
Operations and Supply Chain Management

Year 1 2 3 Avg F

Q1 0.34 0.34 0.33 0.337 69.08


Q2 0.14 0.14 0.14 0.14 28.7
Q3 0.24 0.23 0.23 0.233 47.77
Q4 0.29 0.29 0.30 0.293 60.06
Operations and Supply Chain Management

Winters Model

at+1 = α (Dt+1/Ct+1) + (1-α) (at + bt) level

bt+1 = β (at+1 – at) + (1-β) bt trend (slope)

Ct+p+1 = ϒ (Dt+1/at+1) + (1-ϒ) ct+1 seasonality

Ft+1 = (at + bt) *ct+1


Operations
Practice problem and Supply Chain Management

Year 1 2 3 4

Q1 53 58 62 ?
Q2 22 25 27 ?
Q3 37 40 44 ?
Q4 45 50 56 ?
157 173 189 ?

α= 0.2 β= 0.3 ϒ= 0.25


Operations and Supply Chain Management
Goodness of a forecast

1. Simple Average
Level or Constant
2. Moving Average Model
3. Exponential Smoothing

1. Linear Regression
Level + Trend
2. Holts Model

1. Basic Model
Level+ Trend +
2. Winter Seasonality
Measuring Accuracy
 We need a way to compare different time series techniques for a given data set.
 Four common techniques are the:

 Mean Absolute Deviation,


n 
Yi  Y
 Mean Absolute Percent Error, MAD = 
i 1 n
i

100 n Yi  Ŷi
 Mean Square Error, MAPE = 
n i 1 Yi
 Root Mean Square Error.
MSE = 
n 
Yi  Yi  2

i 1 n
RMSE  MSE
• We will focus on MSE.
Operations and Supply Chain Management
Given the data 91, 90, 96, 92, 96, 93, 98, 97,

find the forecast for the eighth period using a simple average 94.12

find the forecast for the eighth period using the weighted average (weight of 1
for the first four periods and 2 for the remaining four). 94.75

find the forecast for the ninth period using a 3-period moving average? 96

Given the data 90, 91, 92, 96, 93, 98, 97,
Find the forecast for the eighth period using simple exponential smoothing.
(Use α
= 0.3 and initial forecast using simple average)
94.435
Given the data 61, 62, 66, 65, 69, 68, 71, 66
Find the forecast for the ninth period using a simple average
Find the forecast for the ninth period using 4 period moving average.
Operations and Supply Chain Management

Given the data 60, 61, 63, 65, 67, 68, 70, 71
Find the forecast for the ninth period using simple exponential smoothing. Use α
= 0.2 and initial forecast using simple average. Answer------

Given the data 60, 61, 63, 65, 67, 68, 70, 71 find the forecast for the ninth period using
linear regression.

Given the data 63, 64, 66, 67, 67, 68, 71, 72. Use Holt’s model. Use α=β=0.2
.
The initial slope is -------

The forecast for the ninth period is ---------

You might also like