Demand Forecasting - an estimate of an event which will happen in the future S. Ajit
Nov 18, 2014
Demand Forecasting
- an estimate of an event which will happen in the future
S. Ajit
Need for forecasting
Basis for most planning decisions Scheduling Inventory Production Facility layout Work force Distribution Purchasing Sales
Sources of data for forecasting
Company Records Published records Journals Market Surveys News papers
Forecasting Model
Types of Forecasting Models
Types of Forecasts Qualitative --- based on experience, judgement, knowledge; Quantitative --- based on data, statistics;
Methods of Forecasting� time series models (e.g. exponential smoothing) – trend,
seasonal, cyclical patterns
� causal models (e.g. regression) – based on relationship between variable to be forecasted and an independent variable
Production Resource Forecasts
Long range Medium range Short range
Years Months Weeks
Factory Capacities
Capital funds
Plant location
Product Planning
Department capacities,
Purchased Material
Aggregate planning,
capacity planning,
sales forecasts,
Demand forecasting,
staffing levels (labor),
inventory levels,
Qualitative Quantitative, Quantitative
Forecasting Horizons
Forecasting Techniques
Correction needed
Forecasting Techniques
Quantitative Qualitative
•Delphi•Opinion Survey
•Regression•Time Series
Historical Time Series
Trend Pattern
Cyclical Pattern
Seasonal Pattern
Types of Forecasting Models
Types of Forecasts Qualitative --- based on experience, judgement, knowledge; Quantitative --- based on data, statistics;
Methods of Forecasting� time series models (e.g. exponential smoothing);
� causal models (e.g. regression) – based on relationship between variable to be forecasted and an independent variable
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.
Simple Moving Average Forecast Ft is average of n previous observations or
actuals Dt :
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.
t
ntiit
ntttt
Dn
F
DDDn
F
11
111
1
)(1
Simple Moving Average
Include n most recent observations Weight equally Ignore older observations Applied to forecast for only one period into the future
weight
today123...n
1/n
Moving Average – Example 1
Determine the forecast for the 11th month, for n = 3.
Moving Average – Example 1 - Solution
Moving Average – Example 1 - Solution
Moving Average – Example 1 - Solution
Moving Average – Example 1 - Solution
Moving Average Forecasting for the 11th months is 96
Moving Average – Example 1 - Solution
Weighted Moving Average
Include n most recent observations More weight is assigned to the recent demand values Ignore older observations Applied to forecast for only one period into the future
weight
today123...n
1/n
∑ Wi Di
Weight = -------------- i = 1 to n ∑ Wi
Weighted Moving Average – Example 2
Determine the forecast for the 9th month, for n = 3.
Weighted Moving Average Example 2 - Solution
Weighted Moving Average Example 2 - Solution
Weighted Moving Average Example 2 - Solution
Weightd Moving Average Example 2 - Solution
Moving Average Forecasting for the 9th months is 81.5
Weighted Moving Average Example 2 - Solution
Exponential Smoothing I
Include all past observations Weight recent observations much more heavily than
very old observations Most popular
F t - Forecast for the time period ‘t’
F t-1 - Forecast for the time period ‘t-1’
D t-1 - Demand for the time period ‘t-1’
α - Smoothing constant (0 to 1)
Exponential Smoothing I
Include all past observations Weight recent observations much more heavily
than very old observations:
weight
today
Decreasing weight given to older observations
Exponential Smoothing I
Include all past observations Weight recent observations much more heavily
than very old observations:
weight
today
Decreasing weight given to older observations
0 1
Exponential Smoothing I
Include all past observations Weight recent observations much more heavily
than very old observations:
weight
today
Decreasing weight given to older observations
0 1
( )1
Exponential Smoothing I
Include all past observations Weight recent observations much more heavily
than very old observations:
weight
today
Decreasing weight given to older observations
0 1
( )
( )
1
1 2
Exponential Smoothing: Math
Exponential Smoothing: Math
Exponential Smoothing: Math
Exponential Smoothing: Math
F t = α * D t-1 + (1 – α) * F t-1
Exponential Smoothing: Math
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 Rule of thumb: < 0.5 Typically, = 0.2 or = 0.3 work well
1
22
1
)1(
)1()1(
ttt
tttt
FaaDF
DaaDaaaDF
Exponential Smoothing – Example 3
A firm uses simple exponential smoothing with α = 0.2 to forecast demand. The actual demand for January to July were 450, 460, 465, 434, 420, 498 and 462 Nos. The forecast for Jan was 400 nos. Forecast the demand for the period Feb to July
Month Actual Demand
Old Forecast
New Forecast
Forecast Error
Jan 450
Feb 460
Mar 465
Apr 434
May 420
Jun 498
Jul 462
Exponential Smoothing – Example 3Month Actual
DemandOld Forecast
New Forecast
Forecast Error
Jan 450 400
Feb 460
Mar 465
Apr 434
May 420
Jun 498
Jul 462
F t = α * D t-1 + (1 – α) * F t-1
α = 0.2
Exponential Smoothing – Example 3Month Actual
DemandOld Forecast
New Forecast
Forecast Error
Jan 450 400
Feb 460 410
Mar 465
Apr 434
May 420
Jun 498
Jul 462
F t = α * D t-1 + (1 – α) * F t-1
F Feb = 0.2 * 450 + (1 – 0.2) * 400 = 410
Exponential Smoothing – Example 3Month Actual
DemandOld Forecast
New Forecast
Forecast Error
Jan 450 400
Feb 460 410 410
Mar 465
Apr 434
May 420
Jun 498
Jul 462
F t = α * D t-1 + (1 – α) * F t-1
F Mar = 0.2 * 460 + (1 – 0.2) * 410 = 420
Exponential Smoothing – Example 3Month Actual
DemandOld Forecast
New Forecast
Forecast Error
Jan 450 400
Feb 460 410 410
Mar 465 420
Apr 434
May 420
Jun 498
Jul 462
F t = α * D t-1 + (1 – α) * F t-1
F Mar = 0.2 * 460 + (1 – 0.2) * 410 = 420
Exponential Smoothing – Example 3Month Actual
DemandOld Forecast
New Forecast
Forecast Error
Jan 450 400 - + 50
Feb 460 410 410 + 50
Mar 465 420 420 + 45
Apr 434 429 429 + 5
May 420 430 430 -10
Jun 498 428 428 + 70
Jul 462 442 442 + 20
F t = α * D t-1 + (1 – α) * F t-1
F Apr = 0.2 * 465 + (1 – 0.2) * 420 = 429
Holt’s Method:Double Exponential Smoothing
orExponential Smoothing with Trend
or Adjusted Exponential Smoothing
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
Smooth the trend forecast Tt
Forecast k periods into future Ft+k with base and trend
B t = α * D t-1 + (1 – α) *( B t-1 + T t-1)
T t = β * (B t – B t-1) + (1 – β) * T t-1
F t+1 = B t + T t
Exponential Smoothing with Trend – Example 4
Compute the adjusted exponential forecast for the 1st week of March for a firm with the following data. Assume the forecast for the first week of January (F0) as 600 & corresponding initial trend (TO) as 0. Let = 0.1 and β = 0.2
Week Demand Week Demand
Jan 1 650 Feb 1 625
2 600 2 675
3 550 3 700
4 650 4 710
Exponential Smoothing with Trend – Example 4
Let = 0.1 and β = 0.2 Week Demand Week Demand
Jan 1 650 Feb 1 625
2 600 2 675
3 550 3 700
4 650 4 710
B t = α * D t-1 + (1 – α) *( B t-1 + T t-1)
T t = β * (B t – B t-1) + (1 – β) * T t-1
F t+1 = B t + T t
F0 = 600
T0 = 0
Exponential Smoothing with Trend – Example 4
Let = 0.1 and β = 0.2
B t = α * D t-1 + (1 – α) *( B t-1 + T t-1)
T t = β * (B t – B t-1) + (1 – β) * T t-1
F t+1 = B t + T t
= 0.1 * 650 + 0.9 (600 + 0) = 605
F0 = 600
T0 = 0
B t-1 D t-1 B t T t F t+1
Week
Pre
Avg
Act
Demand
Smooth
Avg
Smooth
TrendNext
Projection
Jan 1 600 650 605
2 600
3 550
4 650
Feb 1 625
2 675
3 700
4 710
Exponential Smoothing with Trend – Example 4
Let = 0.1 and β = 0.2
B t = α * D t-1 + (1 – α) *( B t-1 + T t-1)
T t = β * (B t – B t-1) + (1 – β) * T t-1
F t+1 = B t + T t
= 0.1 * 650 + 0.9 (600 + 0) = 605
F0 = 600
T0 = 0
= 0.2 * (605 – 600) + 0.8 * (0) = 1.00
B t-1 D t-1 B t T t F t+1
Week
Pre
Avg
Act
Demand
Smooth
Avg
Smooth
TrendNext
Projection
Jan 1 600 650 605 1.0
2 600
3 550
4 650
Feb 1 625
2 675
3 700
4 710
Exponential Smoothing with Trend – Example 4
Let = 0.1 and β = 0.2
B t = α * D t-1 + (1 – α) *( B t-1 + T t-1)
T t = β * (B t – B t-1) + (1 – β) * T t-1
F t+1 = B t + T t
= 0.1 * 600 + 0.9 (605 + 1) = 605.4
F0 = 600
T0 = 0
= 0.2 * (605.4 – 605) + 0.8 * (1) = 0.88
= 605 + 1 = 606
B t-1 D t-1 B t T t F t+1
Week
Pre
Avg
Act
Demand
Smooth
Avg
Smooth
TrendNext
Projection
Jan 1 600 650 605 1.0 606
2 605 600
3 550
4 650
Feb 1 625
2 675
3 700
4 710
Exponential Smoothing with Trend – Example 4
Let = 0.1 and β = 0.2
B t = α * D t-1 + (1 – α) *( B t-1 + T t-1)
T t = β * (B t – B t-1) + (1 – β) * T t-1
F t+1 = B t + T t
= 0.1 * 600 + 0.9 (605 + 1) = 605.4
F0 = 600
T0 = 0
B t-1 D t-1 B t T t F t+1
Week
Pre
Avg
Act
Demand
Smooth
Avg
Smooth
TrendNext
Projection
Jan 1 600 650 605 1.0 606
2 605 600 605.4
3 550
4 650
Feb 1 625
2 675
3 700
4 710
Exponential Smoothing with Trend – Example 4
Let = 0.1 and β = 0.2
B t = α * D t-1 + (1 – α) *( B t-1 + T t-1)
T t = β * (B t – B t-1) + (1 – β) * T t-1
F t+1 = B t + T t
= 0.1 * 600 + 0.9 (605 + 1) = 605.4
F0 = 600
T0 = 0
= 0.2 * (605.4 – 605) + 0.8 * (1) = 0.88
B t-1 D t-1 B t T t F t+1
Week
Pre
Avg
Act
Demand
Smooth
Avg
Smooth
TrendNext
Projection
Jan 1 600 650 605 1.0 606
2 605 600 605.4 0.88
3 550
4 650
Feb 1 625
2 675
3 700
4 710
Exponential Smoothing with Trend – Example 4
Let = 0.1 and β = 0.2
B t = α * D t-1 + (1 – α) *( B t-1 + T t-1)
T t = β * (B t – B t-1) + (1 – β) * T t-1
F t+1 = B t + T t
= 0.1 * 600 + 0.9 (605 + 1) = 605.4
F0 = 600
T0 = 0
= 0.2 * (605.4 – 605) + 0.8 * (1) = 0.88
= 605.4 + 0.88 = 606.38
W
e
e
k
B t-1 D t-1 B t T t F t+1
Pre
Avg
Act
Demand
Smooth
Avg
Smooth
TrendNext
Projection
Jan 1 600 650 605 1.0 606
2 605 600 605.4 0.88 606.38
3 550
4 650
Feb 1 625
2 675
3 700
4 710
Exponential Smoothing with Trend – Example 4
Let = 0.1 and β = 0.2
B t = α * D t-1 + (1 – α) *( B t-1 + T t-1)
T t = β * (B t – B t-1) + (1 – β) * T t-1
F t+1 = B t + T t
F0 = 600
T0 = 0
W
e
e
k
B t-1 D t-1 B t T t F t+1
Pre
Avg
Act
Demand
Smooth
Avg
Smooth
TrendNext
Projec
tion
Jan 1 600 650 605 1.0 606
2 605 600 605.4 0.88 606.38
3 605.4 550 600.65 -0.246 600.40
4 600.65 650 605.36 0.742 606.10
Feb 1 605.36 625 607.99 1.120 609.11
2 607.99 675 615.70 2.44 618.14
3 615.70 700 626.33 4.08 630.4
4 626.33 710 738.37 5.67 644.04
Forecasting Performance
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
How good is the forecast?
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 Forecast Error (MFE or Bias)
)(1
1t
n
tt FD
nMFE
Mean Absolute Deviation (MAD)
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
n
ttt FD
nMAD
1
1
Mean Absolute Percentage Error (MAPE)
Same as MAD, except ... Measures deviation as a percentage of actual data
n
t t
tt
D
FD
nMAPE
1
100
Mean Squared Error (MSE)
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
2
1
)(1
t
n
tt FD
nMSE
Simple Regression / Linear Regression
Simple Linear Regression Equation
The following equation describes how the mean value of y is related to x.
Y = a + b X
a is the intersection with y axis, b is the slope.
Dependent Dependent (Response) (Response) VariableVariable(e.g., income)(e.g., income)
Independent Independent (Explanatory) (Explanatory) Variable Variable (e.g., education)(e.g., education)
Population Population Y-InterceptY-Intercept
Population Population SlopeSlope
Simple Linear Regression Equation
b > 0 b < 0 b = 0
Example
For example, advertising could be the independent variable and sales to be the dependent variable.
We first implement available data to develop a relationship between sales and advertising.
Sales = a + b (Advertising)
After estimating a and b , then we implement this relationship to forecast sales given a specific level of advertising.
How much sales we will have if we spent a specific amount on advertising.
To find the value of a, b use the formulae below
∑Y = n * a + b ∑X
∑XY = n ∑X + b ∑X2
∑ X2 * ∑Y - ∑X * ∑XY
a = -------------------------n * ∑ X2 – (∑X)2
∑XY - ∑X * ∑Y
b = --------------------n * ∑ X2 – (∑X)2
Find ∑X, ∑Y, ∑XY, ∑ X2
Reed Auto periodically has a special week-long sale. As part of the advertising campaign Reed runs one or more television commercials during the weekend preceding the sale. Data from a sample of 5 previous sales showing the number of TV ads run and the number of cars sold in each sale are shown below.
Number of TV Ads Number of Cars Sold
1 14
3 24
2 18
1 17
3 27
No. of TV ads – Independent Variable – X
No of cars sold – Dependent Variable - Y
Example : ABC Auto Sales
Example : ABC Auto Sales
X
0
5
10
15
20
25
30
0 0.5 1 1.5 2 2.5 3 3.5
X
Example : ABC Auto Sales
Y X14 124 318 217 127 3
Y X XY X214 1 14 124 3 72 918 2 36 417 1 17 127 3 81 9
Example : ABC Auto Sales
Y X XY X214 1 14 124 3 72 918 2 36 417 1 17 127 3 81 9
Sum 100 10 220 24
Slope for the Estimated Regression Equation
b = ?
y -Intercept for the Estimated Regression Equation
a = ? Estimated Regression Equation
Y = ?
Example : ABC Auto Sales
Fortunately, there is software...