Académique Documents
Professionnel Documents
Culture Documents
(Demand) Forecasting
Topics
Forecasting
The process of predicting the values of a certain quantity,
Q, over a certain time horizon, T, based on past trends
and/or a number of relevant factors.
Some forecasted quantities in manufacturing
demand
equipment and employee availability
technological forecasts
economic forecasts (e.g., inflation rates, exchange rates, housing
starts, etc.)
market data
strategic plans of the company
technology trends
social/economic/political factors
environmental factors
etc
Demand Patterns
The observed demand is the cumulative result of:
systematic variation, due to a number of identified factors, and
a random component, incorporating all the remaining unaccounted
effects.
Forecasting Methods
Qualitative (Subjective): Incorporate factors like
the forecasters intuition, emotions, personal
experience, and value system.
These methods include:
Update Model
Parameters
Yes
Model
Valid?
No
- Determine
functional form
- Estimate parameters
- Validate
D(i), i 1,...,t
Historical
Data
Time Series
Model
D (t ), 1,2,...
Forecasts
12.00
10.00
8.00
Series1
6.00
4.00
2.00
0.00
1
9 10 11 12 13 14 15 16 17 18 19 20
The above data points have been sampled from a normal distribution with a
mean value equal to 10.0 and a variance equal to 4.0.
D(t ) D e(t )
where
D (t )
N
N 1
D(t i)
i 0
(t 1) D (t ) D(t 1)
N
N 1
D(t i) D(t 1)
i 0
Also
1 N 1
1
E[ (t 1)] E[ D(t i )] E[ D(t 1)] ( ND ) D 0
N i 0
N
1 N 1
1
1 2
2
2
Var[ (t 1)] 2 Var[ D(t i )] Var[ D(t 1)] 2 N (1 )
N i 0
N
N
(t ) D
D
t N i N 1
t
2
ii) MSD (t ) 1
(
(
t
))
t N i N 1
t
iii)
1
(t )
MAPE(t )
t N i N 1 D(t )
20.00
15.00
Series1
Series2
Series3
10.00
5.00
40
37
34
31
28
25
22
19
16
13
10
0.00
blue series: the original data series, distributed according to N(10,4) for the first 20
points, and N(20,4) for the last 20 points.
magenta series: the predictions of the MA(5) forecasting model.
yellow series: the predictions of the MA(10) forecasting model.
Remark: the MA(5) model adjusts faster to the experienced jump of the data mean
value, but the mean estimates that it provides under stationary operation are less accurate
than those provided by the MA(10) model.
D(t ) D e(t )
where D is an unknown constant and e(t ) is normally distributed
with zero mean and an unknown variance 2 .
The forecast D (t ) , at the end of period t:
(t 2)
aD(t) a(1 a)D(t 1) (1 a) 2 D
.................................................................................................
t 1
a (1 a) i D(t i ) (1 a ) t D (0)
i 0
Implications
1. The model considers all the past observations and the
The impact of and of D (0) on
20.00
15.00
Series1
Series2
Series3
Series4
10.00
5.00
40
37
34
31
28
25
22
19
16
13
10
0.00
dark blue series: the original data series, distributed according to N(10,4) for the first 20
points, and N(20,4) for the last 20 points.
magenta series: the predictions of the ES(0.2) model initialized at the value of 10.0.
yellow series: the predictions of the ES(0.2) model initialized as 0.0.
light blue series: the predictions of the ES(0.8) model initialized at 10.0.
Remark: the ES(0.8) model adjusts faster to the jump of the series mean value, but the
estimates that it provides under stationary operation are less accurate than those provided by
the ES(0.2) model. Also, notice that the effect of the initial value is only transient.
SES(0.5)
SES(1.0)
4
2
0
1
10
blue series: a deterministic data series increasing linearly with a slope of 1.0.
magenta series: the predictions obtained from the SES(0.5) model initialized at
the exact value of 1.0.
yellow series: the predictions obtained from the SES(1.0) model initialized at
the exact value of 1.0.
Remark: Both models under-estimate the actual values, with the most inert
model SES(0.5) under-estimating the most. This should be expected since both of
these models (as well as any MA model) essentially average the past
observations. Therefore, neither the MA nor the SES model are appropriate for
forecasting a data series with a linear trend in it.
D(t ) I T t e(t )
where
I is the model intercept, i.e., the unknown mean value for t=0,
T is the model trend, i.e., the mean increase per unit of time, and
D (t ) I(t ) T (t )
with the quantities I(t ) and T (t ) obtained through the following
recursions:
DES Example
12
10
8
Dt
6
DES(T0=1)
DES(T0=0)
4
2
0
1
9 10
blue series: a deterministic data series increasing linearly with a slope of 1.0.
magenta series: the predictions obtained from the DES(0.5;0.2) model initialized
at the exact value of 1.0.
yellow series: the predictions obtained from the DES(0.5;0.2) model initialized
at the value of 0.0.
Remark: In the absence of variability in the original data, the first model is
completely accurate (the blue and the magenta series overlap completely), while
the second model overcomes the deficiency of the wrong initial estimate and
eventually converges to the correct values.
Spring
Summer
Fall
Winter
Total
Year 1
90
180
70
60
400
Year 2
115
230
85
70
500
Year 3
120
290
105
100
615
Seasonal Indices
Plotting the demand data:
350
300
250
200
Series1
150
100
50
0
0
10
12
14
Remarks:
At each cycle, the demand of a particular season is a fairly stable percentage of
the total demand over the cycle.
Hence, the ratio of a seasonal demand to the average seasonal demand of the
corresponding cycle will be fairly constant.
This ratio is characterized as the corresponding seasonal index.
A forecasting methodology
Forecasts for the seasonal demand for subsequent years can be obtained by:
i. estimating the seasonal indices corresponding to the various seasons in the
cycle;
ii. estimating the average seasonal demand for the considered cycle (using, for
instance, a forecasting model for a series with constant mean or linear trend,
depending on the situation);
iii. adjusting the average seasonal demand by multiplying it with the
corresponding seasonal index.
Example (cont.):
Spring
Summer
Fall
Winter
Total
Average
Year 1
90
180
70
60
400
100
Year 2
115
230
85
70
500
125
Year 3
120
290
105
100
615
153.75
SI(1)
0.9
1.8
0.7
0.6
4
SI(2)
0.92
1.84
0.68
0.56
4
SI(3)
0.78
1.88
0.68
0.65
4
SI
0.87
1.84
0.69
0.6
4
e(t) is normally distributed with zero mean and some unknown variance
I(t ) : a
D(t )
(1 a )[ I(t 1) T (t 1)]
c( t 1) m odN 1 (t 1)
D(t )
c(t 1) m odN 1 (t ) : g
(1 g ) c(t 1) m odN 1 (t 1)
I (t )
ci (t ) : ci (t 1), i (t 1) mod N 1
The parameters ,b,gtake values in the interval (0,1) and are the model smoothing
constants, while I(0), T (0) and ci (0), i 1,..., N , are the initializing values.
Causal Models:
Multiple Linear Regression
The basic model:
D b0 b1 X 1 ... bk X k e
where
Xi, i=1,,k, are the model independent variables (otherwise known as the
explanatory variables);
bi, i=0,,k, are unknown model parameters;
e is the a random variable following a normal distribution with zero mean and
some unknown variance 2.
2
D follows a normal distribution N ( D , ) where
D b0 b1 X 1 ... bk X k
We need to estimate <b0,b1,,bk> and 2from a set of n observations
{ D j ; X 1 j , X 2 j ,..., X kj , j 1,..., n}
D1 1 X 11
D 1 X
12
2
... ... ...
Dn 1 X 1n
... X k1 b0 e1
... X k 2 b1 e2
d X b e
e d X b
denotes the difference between the actual observations and the corresponding
mean values, and therefore, b is selected such that it minimizes the Euclidean
norm of the resulting vector e d X b .
The minimizing value for b is equal to b ( X T X ) 1 X T d
The necessary and sufficient condition for the existence of ( X T X ) 1 is that the
columns of matrix X are linearly independent.
SSE
MSE
n k 1
where
SSE eT e (d X b)T (d X b)
D ( x0 )is given by
D ( x0 ) b0 b1 x10 ... bk xk 0
T
This estimator is normally distributed with mean D ( x0 ) and variance 2 x0 ( X T X )1 x0
The random variable D ( x0 ) can function also as an estimator for any single
observation D(x0). The resulting error D ( x0 ) D( x0 ) will have zero mean and
T
variance 2[1 x0 ( X T X )1 x0 ]
SSR
R
SYY
2
where
SSR bT ( X T d ) nd 2 ( D j d ) 2
n
and
1
d Dj
n j 1
j 1
Confidence Intervals
Given a random variable X and p(0,1), a p100% confidence
P(a X b) p
Confidence intervals are used in:
T
[ D ( x0 ) D( x0 )] 1 x0 ( X T X ) 1 x0
SSE
n k 1
2
D ( x0 ) D( x0 )
MSE [1 x0 ( X T X ) 1 x0 ]
T
( x ) y) p
P( D( x0 ) D
0
P(
D( x0 ) D ( x0 )
1
MSE[1 x0 ( X X ) x0 ]
T
y
1
MSE[1 x0 ( X X ) x0 ]
T
y
MSE[1 x0 ( X T X ) 1 x0 ]
T
) p
t p ,nk 1
y t p ,nk 1 MSE[1 x0 ( X T X ) 1 x0 ]
T
Remark: The two-sided confidence interval that is necessary for monitoring the
model performance can be obtained through a straightforward modification of the
above reasoning.