You are on page 1of 28

2

UNIT 1: FORECASTING

Moving Average, Exponential Smoothing


Exponential Smoothing with a Trend
Winters Method for Seasonal Series
3

1.1. INTRODUCTION TO FORECASTING


4

INTRODUCTION

Forecasting is an estimation of the demand for the goods and services of a firm. It
drives the production systems, their capacity and planning, and serves as input for
the finance, marketing and human resources planning.

• Human resources: Hiring, training and firing workers will depend on estimated

demand.

• Capacity: Insufficient capacity may translate into failure to fulfill delivery orders,

losing customers, and market share.

• Supply chain: Trustworthy relations with suppliers and price discounts for

components and raw materials depend on the accuracy of forecasting.


5

INTRODUCTION

STEPS IN A FORECASTING SYSTEM

1. Select the goods whose demand is going to be estimated.

2. Define the time horizon for the forecasting.

3. Choose the proper forecasting method.

4. Gather together any data that may be necessary for the forecasting.

5. Carry out the forecasting.

6. Validate the fitness of the model and use the results.


6

INTRODUCTION

• Forecasting build the foundations of any production planning. Furthermore, the

success of virtually any firm decision will depend on the estimations of future
events.

• Forecasting methods are classified into qualitative and quantitative techniques.

Qualitative methods build likely scenarios based on experts’ opinion. For


instance, Delphi Method: experts are asked a list questions about a future event.
Their answers are tabulated and experts are consulted again, until an agreement
is reached.
7

INTRODUCTION

• Quantitative methods accept that future can be predicted from historical

numerical data.
• Causal models: they estimate a future value according to other factors. For instance,

regression analysis, where a dependent variable depends upon predictors or


independent terms.

• Time series: they estimate the future value of a variable based on past data of the same

variable.

• Qualitative methods are usually implemented for long-term forecasting, whereas

quantitative techniques work better for short-term time horizons.


8

INTRODUCTION

Three forecasting laws:

1. Forecast are always wrong.

2. Aggregate estimations are better than detailed ones (variability pooling).

3. The further into the future, the less reliable the forecast.

40%
20%
+10%
-10%
Start
of 16 weeks
season
26 weeks
9

1.2. TIME SERIES APPROACH


10

TIME SERIES
Historical Data Forecast

A(i), i = 1, … ,t Time series model f(t+), i = 1, 2, …

• Notation: A(i )  observation in period i , i  1,..., t


t  current period
f (t   )  forecast for period t  
F (t )  smoothed estimate as of period t
T (t )  smoothed trend as of period t
11

MOVING AVERAGE

• We assume that there is no trend: T(t) = 0

• The latest m observations are equally weighted (we will always average the m

more recent data).


t
i  t  m 1
A(i )
F (t ) 
m

f (t   )  F (t ),   1, 2, ...
12

MOVING AVERAGE
Month Demand Forecast (m =3) Forecast (m =5) • We should wait m periods of
t A (t ) f (t ) f (t )
1 10 - - time before conducting the first
2 12 - -
3 12 - -
4 11 11.33 -
estimation.
5 15 11.67 -
6 14 12.67 12.0 • The greater the value of m, the
7 18 13.33 12.8
8 22 15.67 14.0 more stable the forecasting,
9 18 18.00 16.0
10 28 19.33 17.4 but the slower the reaction
11 33 22.67 20.0
12 31 26.33 23.8
13 31 30.67 26.4
time.
14 37 31.67 28.2
15 40 33.00 32.0
16 33 36.00 34.4
17 50 36.67 34.4
18 45 41.00 38.2
19 55 42.67 41.0
20 60 50.00 44.6
13

MOVING AVERAGE
70 • If there is a positive

60 trend, moving average

50 underestimate the

40
estimation. Otherwise,
Demand

A(t)
m=3
m=5
the method will yield
30

values greater than the


20

real ones. In any case,


10
it will always react
0
0 5 10 15 20 25 slowly to changes.
Period (t)
14

EXPONENTIAL SMOOTHING

• We assume that there is no trend: T(t) = 0

• We average the current observation, A(t), together with the most recent smoothed

estimate, F(t-1).

• The relevance of former observations decreases in an exponential way:

F (t )  A(t )  (1   ) F (t  1)

f (t   )  F (t ),   1, 2, ...
15

EXPONENTIAL SMOOTHING
Month Demand Forecast ( =0.2) Forecast ( =0.6)
t A (t ) f (t ) f (t ) • α takes values between 0 and 1.
1 10 - -
2 12 10,00 10,00 • The easiest way to start is to set
3 12 10,40 11,20
4 11 10,72 11,68 F(1) = A(1) = 10. An estimation for
5 15 10,78 11,27
6 14 11,62 13,51 the first period could be
7 18 12,10 13,80
8 22 13,28 16,32 conducted iff previous data are
9 18 15,02 19,73
10 28 15,62 18,69 available.
11 33 18,09 24,28
12 31 21,08 29,51
13 31 23,06 30,40
• The forecast for period 3: f(3), is
14 37 24,65 30,76
15 40 27,12 34,50 equal to the smoothing estimate
16 33 29,69 37,80
17 50 30,36 34,92 calculated from period 2: F(2).
18 45 34,28 43,97
19 55 36,43 44,59
20 60 40,14 50,83
16

EXPONENTIAL SMOOTHING
• The lower the value of α, the

more stable the forecast, but


the slower the reaction time.

• Anyway, if there is a trend,

the technique will not behave


properly.
17

EXPONENTIAL SMOOTHING WITH A TREND

• It is assumed that a linear trend takes place. The smoothed trend is added to the

smoothed estimate: f(t+τ) = F(t) + τ T(t).

• The significance of former observations and smoothed trends decreases in an

exponential way:

F (t )  A(t )  (1   )( F (t  1)  T (t  1))

T (t )   ( F (t )  F (t  1))  (1   )T (t  1)

f (t   )  F (t )  T (t )   1, 2, ...
18

EXPONENTIAL SMOOTHING WITH A TREND

• When computing the smoothing estimate F(t), we take the previous forecast,

which is equal to F(t-1)+T(t-1), because of the trend.

• Concerning the smoothed trend T(t), we choose the difference between the

current and the previous smoothing estimates, i.e. F(t) – F(t-1).

• Both α and β take values between 0 and 1.


19

EXPONENTIAL SMOOTHING WITH A TREND


Month Demand Smoothed Estimate Smoothed Trend Forecast
t A (t ) F (t ) T (t ) f (t )
• In this example, α=0.2 and
1 10 10,00 0,00 -
2 12 10,40 0,20 10,00 β=0.5.
3 12 10,88 0,34 10,60
4 11 11,18 0,32 11,22 • The easiest way to start is to set
5 15 12,20 0,67 11,49
6 14 13,09 0,78 12,86 F(1) = A(1) and T(1) = 0.
7 18 14,70 1,19 13,87
8 22 17,11 1,81 15,89
9 18 18,74 1,71 18,92 • The forecast for period 3: f(3), is
10 28 21,96 2,47 20,45
11 33 26,14 3,33 24,43 equal to the smoothed estimate
12 31 29,77 3,48 29,47
13 31 32,80 3,25 33,25 as of period 2 F(2), plus the
14 37 36,25 3,35 36,06
15 40 39,67 3,39 39,59 smoothed trend as of period
16 33 41,05 2,38 43,06
17 50 44,75 3,04 43,43
18 45 47,23 2,76 47,79
T(2).
19 55 50,99 3,26 49,99
20 60 55,40 3,84 54,25
20

EXPONENTIAL SMOOTHING WITH A TREND


70

60

50 • This method allows to

40
improve the tracking to a
Demand

increasing or decreasing
30

demand pattern.
20
A(t)
10 f(t)

0
0 4 8 12 16 20
Period (t)
21

WINTERS METHOD

• Many items show a seasonal demand, because of the peaks and troughs of the

demand pattern depending on the period of the year. Hence seasonal factors c(t)
are added to prevent peaks and troughs from distorting the prediction. A year will
be composed of N periods of time (usually N = 12).

• Smoothed estimate: F (t )   ( A(t ) / c(t  N ))  (1 )(F (t 1)  T (t 1))

• Smoothed trend: T (t )   (F (t )  F (t 1))  (1  )T (t 1)

• Factors: c(t )   ( A(t ) / F (t ))  (1   )c(t  N )

• Forecasting: f (t   )  (F (t )  T (t ))c(t    N ), t    N 1,...,2N


22

WINTERS METHOD

• When computing the smoothed estimate F(t), the observation A(t) is divided by the

corresponding factor c(t-N), so that we can get a standardized value, i.e. without
seasonality.

• To update the component c(t), we use the quotient between the true demand and

the smoothed estimated, A(t)/F(t), as an estimate for the current value of the
factor.

• In order to compute the forecast f(t+τ), the resulting prediction from an exponential

smoothing with a trend is multiplied by its corresponding factor.

• α , β and γ take values between 0 and 1.


23

WINTERS METHOD
• Historical data of the previous year should be available in order to conduct the

calculation of the forecasting. The smoothed estimate F(t) is initialized as the


average of the demand from the 12 previous months. The initial trend is supposed
to be equal to 0 (T(12)=0).

• Factors c(t) point out the proportion in which the demand of a period exceed or fall

behind the annual average.

• Therefore, factors c(t) are computed as the ratio between the monthly demand and
12

the average.  A(t )


t 1 4  2  4
F (12)    8.33
12 12
A(1) 4
c(1)    0.480
F (12) 8.33
24

WINTERS METHOD
T im e A c tu a l B ase Seasonal P r e d ic te d
Year M o n th P e r io d Dem and Level T re n d F a c to r D em and
1997 Jan 1 4 --- --- 0 .4 8 0
Feb 2 2 --- --- 0 .2 4 0
M ar 3 5 --- --- 0 .6 0 0
Apr 4 8 --- --- 0 .9 6 0
M ay 5 11 --- --- 1 .3 2 0
Jun 6 13 --- --- 1 .5 6 0 F (13)   ( A(13) / c(13  12)  (1   )( F (12)  T (12))
Jul 7 18 --- --- 2 .1 6 0
Aug 8 15 --- --- 1 .8 0 0  0.1(5 / 0.480)  (1  0.1)(8.33  0)  8.54
Sep 9 9 --- --- 1 .0 8 0
O ct 10 6 --- --- 0 .7 2 0
N ov 11 5 --- --- 0 .6 0 0 T (13)   ( F (13)  F (12))  (1   )T (12)
D ec 12 4 8 .3 3 0 .0 0 0 .4 8 0
1998 Jan 13 5 8 .5 4 0 .0 2 0 .4 9 1 4 .0 0
 0.1(8.54  8.33)  (1  0.1)(0)  0.02
Feb 14 4 9 .3 7 0 .1 0 0 .2 5 9 2 .0 6
M ar
Apr
15
16
7
7
9 .6 9
9 .5 7
0 .1 2
0 .1 0
0 .6 1 2
0 .9 3 7
5 .6 8
9 .4 3
c(13)   ( A(13) / F (13))  (1   )c(1)
M ay 17 15 9 .8 3 0 .1 2 1 .3 4 1 1 2 .7 6  0.1((5 / 8.54)  (1  0.1)(0.48)  0.491
Jun 18 17 1 0 .0 4 0 .1 3 1 .5 7 3 1 5 .5 2
Jul 19 24 1 0 .2 6 0 .1 3 2 .1 7 8 2 1 .9 7
Aug 20 18 1 0 .3 6 0 .1 3 1 .7 9 4 1 8 .7 2
Sep 21 12 1 0 .5 5 0 .1 4 1 .0 8 6 1 1 .3 3
O ct 22 7 1 0 .5 9 0 .1 3 0 .7 1 4 7 .6 9
N ov 23 8 1 0 .9 8 0 .1 5 0 .6 1 3 6 .4 3
D ec 24 6 1 1 .2 7 0 .1 7 0 .4 8 5 5 .3 4

a lp h a 0 .1 0 0 MSD 2 .3 4
b e ta l 0 .1 0 0
gam m a 0 .1 0 0
25

WINTERS METHOD

• If peaks and troughs take

place in a similar way to


the previous year, Winters
methods provides an
appropriate and realistic
estimation.
26

1.3. FORECASTING ERRORS &


PARAMETER ADJUSTMENT
27

MEASURES OF ERROR

• Quantitative methods: there are measures to quantify the

mistake that has been made in the forecasting: MAD (Mean


n
Absolute Deviation), MSD (Mean Square Deviation) y Bias. MAD   f (t )  A(t ) n
t 1
• MAD and MSD will always be positive. The greater the
n
absolute difference between the forecast and the real MSD   ( f (t )  A(t )) 2 n
t 1
observations, the greater the values of MAD and MSD.
n
• Bias will be positive if the forecast overestimate the true BIAS   ( f (t )  A(t )) n
t 1
observations and negative otherwise. A value close to 0
points out that errors are balanced.
28

PARAMETER ADJUSTMENT

• To establish the best value for the parameters, e.g. α , β , etc., of the time-series models,

we can make a comparison of the error measures for several combinations of parameters
over an historical dataset.

• We will obtain the values of α , β and γ that yield the best (minimum) measures of error

according to the historical data.

• Another option is to set out a (no linear) optimization model, whose solution provides the

values of the parameters that minimize the measures MAD, MSD, or the Bias.
29

PARAMETER ADJUSTMENT
• The combination  = 0.3,  = 0.5 works well to reduce MAD and MSD, whereas the combination  = 0.6, 

= 0.6 makes Bias closer to 0.

  MAD MSD BIAS   MAD MSD BIAS


0.1 0.1 10.23 146.94 -10.23 0.4 0.1 4.3 30.14 -3.45
0.1 0.2 8.27 95.31 -8.27 0.4 0.2 3.89 23.78 -2.34
0.1 0.3 6.83 64.91 -6.69 0.4 0.3 3.77 22.25 -1.77
0.1 0.4 5.83 47.17 -5.43 0.4 0.4 3.75 22.11 -1.46
0.1 0.5 5.16 36.88 -4.42 0.4 0.5 3.76 22.36 -1.29
0.1 0.6 4.69 30.91 -3.62 0.4 0.6 3.79 22.67 -1.18
0.2 0.1 6.48 60.55 -6.29 0.5 0.1 4.13 27.4 -2.84
0.2 0.2 5.04 37.04 -4.49 0.5 0.2 3.91 23.61 -1.94
0.2 0.3 4.26 27.56 -3.29 0.5 0.3 3.88 23.02 -1.49
0.2 0.4 3.9 23.75 -2.51 0.5 0.4 3.9 23.26 -1.25
0.2 0.5 3.73 22.32 -2.02 0.5 0.5 3.94 23.73 -1.1
0.2 0.6 3.65 21.94 -1.71 0.5 0.6 3.97 24.27 -1
0.3 0.1 4.98 37.81 -4.45 0.6 0.1 4.12 26.85 -2.42
0.3 0.2 4.11 26.3 -3.03 0.6 0.2 4.03 24.63 -1.66
0.3 0.3 3.82 22.74 -2.23 0.6 0.3 4.04 24.69 -1.29
0.3 0.4 3.66 21.81 -1.77 0.6 0.4 4.09 25.35 -1.08
0.3 0.5 3.65 21.78 -1.52 0.6 0.5 4.14 26.25 -0.95
0.3 0.6 3.68 22.06 -1.38 0.6 0.6 4.21 27.29 -0.84

You might also like