Chapter 3 Forecasting
Chapter 3 Forecasting
Hari Dhakal
What is Forecasting?
Predicted
demand
looking
Time back six
Jan Feb Mar Apr May Jun Jul Aug months
Actual demand (past sales)
Predicted demand
Past Data Current Data
Forecast Forecast
Generation Control
Managerial
Judgement
&
Experience
Modified
Forecast
Forecasting System
Forecasting
Objective
Scientific
Free from ‘BIAS’
Reproducible
Error Analysis Possible
Prediction
Subjective
Intuitive
Individual BIAS
Non - Reproducible
Error Analysis Limited
Issues in Forecasting
• Long-range forecast
– > 3 years
Design
• New product planning
of system
Qualitative
Methods
Forecasting
stability of eliminate
runs Increase capacity process items not
High production Shift toward Long production returning good
costs product focus runs margin
Limited models Enhance Product Reduce
Attention to distribution improvement and capacity
quality cost cutting
Types of Forecasting methods
Coordinator Expert 2
Expert n
A Statistical
• Mean summary
•Median can be given
1990 1995 2000 2005 2010 •Std. deviation at end of
year each round
Example:
Analyzing the petroleum export of Nepal in certain years, and
forecasting the best forecast by experts opinion.
DELPHI (Contd.)
Round
1
Moving
Towards
Consensus Round
2
Round
3
DELPHI (Contd.)
Round
1
Moving
Towards
Divergent
View Points Round
2
Round
3
Quantitative Approaches
Used when situation is ‘stable’ and
historical data exist
Existing products
Current technology
Involves mathematical techniques
Quantitative Methods
1. Naive approach
2. Moving averages
time-series
3. Exponential models
smoothing
4. Trend projection
associative
5. Linear regression model
Seasonal peaks
Actual demand
line
Average demand
over 4 years
Random variation
| | | |
1 2 3 4
Time (years)
Product Demand charted over 4 years with a Growth Trend and
Seasonality Indicated (Eg: Nokia cell phones)
Trend Component
Persistent, overall
upward or
Linear
downward pattern Trend
Changes due to
population, D
technology, age,
culture, etc.
Typically several t
years duration
Seasonal Component
Regular pattern of up and down
fluctuations
Due to weather, customs, etc.
Occurs within a single year
D Seasonal
Pattern with
Growth
t
Cyclical Component
Repeating up and down movements
Affected by business cycle, political, and
economic factors
Multiple years duration
0 5 10 15 20
Random Component
Erratic, unsystematic, ‘residual’ fluctuations
Due to random variation or unforeseen events
Short duration
and nonrepeating
M T W T
F
Naive Approach
Assumes demand in next period is the same
as demand in most recent period.
e.g., If January sales were 68, then February sales
will be 68 for a Product.
Sometimes cost effective and efficient.
Can be good starting point.
Moving Average Method
Actual 3-Month
Month Sparkplug Sales Moving Average
January 10
February 12
March 13
(10+ 12 + 13)/3 = 11 2/3
April 16
(12 + 13 + 16)/3 = 13 2/3
May 19
(13 + 16 + 19)/3 = 16
June 23
(16 + 19 + 23)/3 = 19 1/3
July 26
Graph of Moving Average
Moving
Average
30 – Forecast
28 –
Actual Sales
26 –
24 –
Shed Sales
22 –
20 –
18 –
16 –
14 –
12 –
10 –
| | | | | | | | | | | |
J F M A M J J A S O N D
Characteristics Of Moving
Averages
Dt Dt
t t
Actual Demand
∑ weights
Weighted Moving Average
Ramesh Automotive workshop wants a 3 months weighted moving
average forecast, for Yamaha sparkplug sales in his workshop.
Weights Applied Period
3 Last month
2 Two months ago
1 Three months ago
6 Sum of weights
January 10
February 12
March 13
April 16 [(3 x 13) + (2 x 12) + (10)]/6 = 121/6
May 19 [(3 x 16) + (2 x 13) + (12)]/6 = 141/3
June 23 [(3 x 19) + (2 x 16) + (13)]/6 = 17
July 26 [(3 x 23) + (2 x 19) + (16)]/6 = 201/2
Moving Average And
Weighted Moving Average
Weighted
30 – moving
average
25 –
Sales demand
20 – Actual
sales
15 –
Moving
10 – average
5 –
| | | | | | | | | | | |
J F M A M J J A S O N D
Moving Average
Advantage:
Easy to compute and easy to understand.
Disadvantage:
All values in the average are weighted
equally. That’s why lag in trend, flattening peaks happen
in demands.
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 only.
Therefore, we should give more weight to the more recent time
periods when forecasting.
Alpha = smoothing constant = percentage of the forecast error.
Exponential Smoothing
New forecast = Last period’s forecast
+ (Last period’s actual demand
– Last period’s forecast)
Ft Ft 1 ( At 1 Ft 1 )
Where Ft = new forecast
Ft – 1 = previous forecasted demand
At – 1= previous actual demand
= smoothing (or weighting)
constant (0 ≤ ≤ 1)
Ft = At-1 +(1 - ) Ft-1
= At-1 +(1 - ) [ At-2 +(1 - )2 Ft-2 ]
=……..
= [At-1 +(1 - ) At-2 +(1 - )2 At-3 + …..
+ (1 - )t-1 At + (1 - )t F0]
(1- )
(1- )2
t-2 t-1 t
Ft Ft 1 ( At 1 Ft 1 )
New forecast Ft = 142 + .2(153 – 142)
= 142 + 2.2
= 144.2 ≈ 144 cars
Impact of Different
Choose high values of when underlying
average is likely to change
Choose low values of when underlying
average is stable
225 –
Actual = .5
demand
200 –
Demand
175 –
= .1
150 – | | | | | | | | |
1 2 3 4 5 6 7 8 9
Quarter
Choosing
The objective is to obtain the most
accurate forecast no matter the
technique.
We generally do this by selecting the
model that gives us the lowest forecast
error.
Forecast error = Actual demand - Forecast value
= At - Ft
Common Measures of Error
MAD is computed by taking the sum of the absolute values of the
individual errors and dividing it by the number of periods of
Data(n).
Mean Absolute Deviation (MAD)
∑ |Actual - Forecast|
MAD = n
∑ (Forecast Errors)2
MSE = n
Common Measures of Error
A problem with both MAD and MSE values depend on
the magnitude of the forecast.
If the forecast items are measured in thousands then
simultaneously the values become large.
To avoid that issue, MAPE is computed as the average of
the absolute differences between the forecasted and
actual values, expressed as a percentage of the actual
values.
Mean Absolute Percent Error (MAPE)
n
∑100(|Actuali - Forecasti|/Actuali)
MAPE = i=1
n
Example
During the past 8 quarters, the Inventory
Store of Jagadamba steels has unloaded large
quantities of Iron ore from India as given in
the table. The Operations Manager wants to
test the forecasting method exponential
smoothing to see how well this method
works in predicting tonnage unloaded.
He guesses that the forecast of Iron ore
unloaded in the first quarter was 175
tons.Two values of are to be examined =
.10 and = .50.
a. Determine MAD, recommend the best.
b. Compute MSE for = .10.
c. Calculate MAPE when = .10.
Comparison of Forecast Error
Rounded Absolute Rounded Absolute
Actual Forecast Deviation Forecast Deviation
Tonnage with for with for
Quarter Unloaded = .10 = .10 = .50 = .50
1 180 175 5.00 175 5.00
2 168 175.5 7.50 177.50 9.50
3 159 174.75 15.75 172.75 13.75
4 175 173.18 1.82 165.88 9.12
5 190 173.36 16.64 170.44 19.56
6 205 175.02 29.98 180.22 24.78
7 180 178.02 1.98 192.61 12.61
8 182 178.22 3.78 186.30 4.30
82.45 98.62
Apply, Ft Ft 1 ( At 1 Ft 1 )
175.5 = 175 + .10 (180- 175)
Comparison of Forecast Error
∑ |deviations|
Rounded Absolute Rounded Absolute
MADActual
= Forecast Deviation Forecast Deviation
Tonnage n
with for with for
Quarter Unloaded a = .10 a = .10 = .50 = .50
1
For 180
= .10 175 5.00 175 5.00
2 168 = 82.45/8
175.5 = 10.31
7.50 177.50 9.50
3 159 174.75 15.75 172.75 13.75
4 For 175
= .50 173.18 1.82 165.88 9.12
5 190 173.36 16.64 170.44 19.56
6 205 = 98.62/8
175.02 = 12.33
29.98 180.22 24.78
7 180 178.02 1.98 192.61 12.61
8 182 178.22 3.78 186.30 4.30
82.45 98.62
Comparison of Forecast Error
∑ (forecast errors)2
Rounded Absolute Rounded Absolute
MSE = Actual
Tonnage
n
Forecast
with
Deviation
for
Forecast
with
Deviation
for
Quarter Unloaded a = .10 a = .10 = .50 = .50
1
For = .10
180 175 5.00 175 5.00
2 = 1,526.54/8
168 175.5 = 190.82
7.50 177.50 9.50
3 159 174.75 15.75 172.75 13.75
4 For 175
= .50 173.18 1.82 165.88 9.12
5 190 173.36 16.64 170.44 19.56
6 = 1,561.91/8
205 175.02 = 195.24
29.98 180.22 24.78
7 180 178.02 1.98 192.61 12.61
8 182 178.22 3.78 186.30 4.30
82.45 98.62
MAD 10.31 12.33
Step 1: Compute Ft
Step 2: Compute Tt
Step 3: Calculate the forecast FITt = Ft + Tt
Example
25 –
20 –
15 –
0 – | | | | | | | | |
1 2 3 4 5 6 7 8 9
Time (month)
Trend Projections
The last time series forecasting method.
This technique fits a trend line to historical data
points to project into the medium to long-range
forecasts.
Linear trends can be found using the least
squares technique.
y^ = a + bx
where ^y = computed value of the variable to be
predicted (dependent variable)
a = y-axis intercept
b = slope of the regression line(or the rate of
change in y for a given changes in x)
x = the independent variable
Least Squares Method
Actual observation
Values of Dependent Variable
Deviation7
(y-value)
Deviation5 Deviation6
Deviation3
Deviation4
Deviation1
(error) Deviation2
Trend line, y ^= a + bx
Time period
Least Squares Method
Actual observation
Values of Dependent Variable
Deviation7
(y-value)
Deviation5 Deviation6
Deviation3
Least squares method minimizes the sum
of the squared errors (deviations) of the
vertical differences
Deviation4
Deviation1
(error) Deviation2
Trend line, y ^= a + bx
Time period
Least Squares Method
Equations to calculate the regression variables
^
y = a + bx
Sxy - nxy
b=
Sx2 - nx2
a = y - bx
Where,
b = slope of regression line
S Summation sign
x = known values of the independent variable
y = known values of the dependent variable
x = average of the x- values
y = average of the y- values
n = number of data points or observations
Least Squares Example
A demand for electric power in Dhulikhel over the period 2011
to 2017 is shown in the following table, in megawatts. Nepal
Electricity Authority wants to forecast 2018 2019 demand by fitting a
straight line trend to these data.
Electrical Power
Year Demand (megawatt)
2011 74
2012 79
2013 80
2014 90
2015 105
2016 142
2017 122
Time Electrical Power
Year Period (x) Demand (megawatt)(y) x2 xy
2011 1 74
2012 2 79
2013 3 80
2014 4 90
2015 5 105
2016 6 142
2017 7 122
∑x = 28 ∑y = 692 ∑x2 = ∑xy =
n=7 x=4 y = 98.86
∑xy - nxy
b= =
∑x2 - nx2
a = y - bx =
Time Electrical Power
Year Period (x) Demand (megawatt)(y) x2 xy
2011 1 74 1 74
2012 2 79 4 158
2013 3 80 9 240
2014 4 90 16 360
2015 5 105 25 525
2016 6 142 36 852
2017 7 122 49 854
∑x = 28 ∑y = 692 ∑x2 = 140 ∑xy = 3,063
x=4 y = 98.86
130 –
120 –
110 –
100 –
90 –
80 –
70 –
60 –
50 –
| | | | | | | | |
2011 2012 2013 2014 2015 2016 2017 2018 2019
Year
Least Squares Requirements
We always plot the data to insure a linear
relationship.
We do not predict time periods far beyond
the database.
Deviations around the least squares line
are assumed to be random and normally
distributed.
Seasonal Variations In Data
Steps in the process:
1. Find average historical demand for each season
2. Compute the average demand over all seasons
3. Compute a seasonal index for each season
4. Estimate next year’s total demand
5. Divide this estimate of total demand by the number of
seasons, then multiply it by the seasonal index for that
season
Seasonal Index Example
Chaudhary Group- Electronics wants to develop monthly indices
for sales of LG Air Conditioners. Data from 2010 -2012 , by
months are available. Give decisions as Operations manager, and
calculate how the demand would be in different seasons.
Demand
Month 2010 2011 2012
Jan 80 85 105
Feb 70 85 85
Mar 80 93 82
Apr 90 95 115
May 113 125 131
Jun 110 115 120
Jul 100 102 113
Aug 88 102 110
Sept 85 90 95
Oct 77 78 85
Nov 75 72 83
Dec 82 78 80
Chaudhary Group- Electronics division wants to develop monthly indices for
sales of LG Air Conditioners. Data from 2010 -2012 , by months are available.
Calculate and Give decisions as Operations manager for how the demand would
be in different seasons.
Demand Average Average Seasonal
Month 2010 2011 2012 2010-2012 Monthly Index
Jan 80 85 105
Feb 70 85 85
Mar 80 93 82
Apr 90 95 115
May 113 125 131
Jun 110 115 120
Jul 100 102 113
Aug 88 102 110
Sept 85 90 95
Oct 77 78 85
Nov 75 72 83
Dec 82 78 80
Total Average annual demand = 1,128
Average monthly demand = 1,128/12 months = 94
Chaudhary Group- Electronics division wants to develop monthly indices for
sales of LG Air Conditioners. Data from 2010 -2012 , by months are available.
Calculate and Give decisions as Operations manager for how the demand would
be in different seasons.
Demand Average Average Seasonal
Month 2010 2011 2012 2010-2012 Monthly Index
Jan 80 85 105 90 94
Feb 70 85 85 80 94
Mar 80 93 82 85 94
Apr 90 95 115 100 94
May 113 125 131 123 94
Jun 110 115 120 115 94
Jul 100 102 113 105 94
Aug 88 102 110 100 94
Sept 85 90 95 90 94
Oct 77 78 85 80 94
Nov 75 72 83 80 94
Dec 82 78 80 80 94
Total Average annual demand = 1,128
Average monthly demand = 1,128/12 months = 94
Average 2010-2012 monthly demand
Seasonal index =
Average monthly demand
= 90/94 = .957
Demand Average Average Seasonal
Month 2010 2011 2012 2010-2012 Monthly Index
Jan 80 85 105 90 94 0.957
Feb 70 85 85 80 94
Mar 80 93 82 85 94
Apr 90 95 115 100 94
May 113 125 131 123 94
Jun 110 115 120 115 94
Jul 100 102 113 105 94
Aug 88 102 110 100 94
Sept 85 90 95 90 94
Oct 77 78 85 80 94
Nov 75 72 83 80 94
Dec 82 78 80 80 94
Demand Average Average Seasonal
Month 2010 2011 2012 2010-2012 Monthly Index
Jan 80 85 105 90 94 0.957
Feb 70 85 85 80 94 0.851
Mar 80 93 82 85 94 0.904
Apr 90 95 115 100 94 1.064
May 113 125 131 123 94 1.309
Jun 110 115 120 115 94 1.223
Jul 100 102 113 105 94 1.117
Aug 88 102 110 100 94 1.064
Sept 85 90 95 90 94 0.957
Oct 77 78 85 80 94 0.851
Nov 75 72 83 80 94 0.851
Dec 82 78 80 80 94 0.851
If we expect the 2013 annual demand for LG Air Conditioners to be
1,200 units, We would use these seasonal indices to forecast the
monthly demand.
Demand Average Average Seasonal Seasonal
Month 2010 2011 2012 2010-2012 Demand
2013
Monthly Index
Jan 80 85 105 90 94 0.957 96
Feb 70 85 85 Forecast
80 for 2013 94 0.851 85
Mar 80 93 82 85 94 0.904 90
Apr 90 95 Expected
115 Annual Demand
100 = 1,200 94 1.064 106
May 113 125 131 123 94 1.309 131
Jun 110 115 120 1,200 115 94 1.223 122
Jul 100 102 Jan113 12 105x .957 = 96 94 1.117 112
Aug 88 102 110 100 94 1.064 106
Sept 85 90 Feb 95 1,200 90
x .851 = 85 94 0.957 96
Oct 77 78 85 12 80 94 0.851 85
Nov 75 72 83 80 94 0.851 85
Dec 82 78 80 80 94 0.851 85
Seasonal Index Example
2013 Forecast
140 – 2012 Demand
130 – 2011 Demand
2010 Demand
120 –
Demand
110 –
100 –
90 –
80 –
70 –
| | | | | | | | | | | |
J F M A M J J A S O N D
Time
Associative Forecasting
Used when changes in one or more independent
variables can be used to predict the changes in
the dependent variable.
Sales ($ millions), y
2.0 1
3.0 3 3.0 –
2.5 4
2.0 2 2.0 –
2.0 1
3.5 7 1.0 –
| | | | | | |
0 1 2 3 4 5 6 7
Area payroll
Associative Forecasting Example
Sales, y Payroll, x x2 xy
2.0 1 1 2.0
3.0 3 9 9.0
2.5 4 16 10.0
2.0 2 4 4.0
2.0 1 1 2.0
3.5 7 49 24.5
∑y = 15.0 ∑x = 18 ∑x2 = 80 ∑xy = 51.5
probability 2.0 –
distribution.
1.0 –
| | | | | | |
0 1 2 3 4 5 6 7
Area payroll
Correlation Coefficient
Another way to evaluate relationship of variables,
which measures the degree or strength of the
linear relationship.
How strong is the linear relationship between the
variables?
Correlation does not necessarily imply causality!
Coefficient of correlation, r, measures degree of
association
Values range from -1 to +1
nSxy - SxSy
r=
[nSx2 - (Sx)2][nSy2 - (Sy)2]
Correlation Coefficient
y y
y y
∑(Actual demand in
period i -
Forecast demand
Tracking in period i)
signal =
(∑|Actual - Forecast|/n)
Tracking Signal
0 MADs Acceptable
range
–
Lower control limit
Time
Tracking Signal Example
Sipradi Automobiles , Kathmandu wants to evaluate performance
of its Tata Marcopolo forecast, use the forecast and demand data
for the last 6 quarters for Tata Marcopolo sales as given below.
Develop a tracking signal for the forecast and see it stays within
acceptable limit, and the defined limit is ±4 MADs.
Actual Forecast
Qtr Demand Demand
1 90 100
2 95 100
3 115 100
4 100 110
5 125 110
6 140 110
Tracking Signal Example
Cumulative
Absolute Absolute
Actual Forecast Cumm Forecast Forecast
Qtr Demand Demand Error Error Error Error MAD
1 90 100 -10 -10 10 10 10.0
2 95 100 -5 -15 5 15 7.5
3 115 100 +15 0 15 30 10.0
4 100 110 -10 -10 10 40 10.0
5 125 110 +15 +5 15 55 11.0
6 140 110 +30 +35 30 85 14.2
Conclusion ;
The variation of the tracking signal between -2.0 and +2.5 is within
acceptable limits
A Company’s Rule for Changing the
Smoothing Constant (α )
0 - 2.4 *
2.5 - 2.9 *
3.0 - 3.9 *
Over 4 *