Sei sulla pagina 1di 93

FORECASTING

ED CRUZ
SCHOOL OF APPLIED ECONOMICS
UNIVERSITY OF SOUTHEASTERN PHILIPPINES
FORECASTING
Definitions:

a. To project or estimate future needs.


b. The process of making statements
about events whose actual outcomes
(typically) have not yet been observed.
DATA

QUANTITATIVE
SOFTWARE
METHODS

FORECASTING SYSTEM
USES OF FORECASTING
1. “Closing the gap”
2. Policy & advocacy
3. Marketing and Budgeting
4. Procurement and Pipeline
Planning
5. Quality Assurance
6. Preventing supply imbalance
TYPES OF FORECASTING METHODS

A. Qualitative methods

• Based on judgments or opinions


• Subjective
• Don’t rely on mathematical computations.
QUALITATIVE FORECASTING METHODS
TYPES OF FORECASTING METHODS

B. Quantitative methods
• Based on quantitative models
• Objective in nature
• Rely on mathematical
computations.
QUANTITATIVE FORECASTING METHODS
CHARACTERISTICS OF FORECASTING

(1) Based on Causal Relationship

If what happens is purely random and does not


depend on anything, you cannot predict what will
happen.
CHARACTERISTICS OF FORECASTING

(2) Requires more than one number


some idea about its probability distribution is
necessary.

(3) Long horizon means large errors. So many


things can happen.
CHARACTERISTICS OF FORECASTING

(4) Use different approaches


You gain confidence in your forecast if you can
find it by different ways.

(5) Aggregate is better


CHARACTERISTICS OF FORECASTING

(6) Use any other known information


You cannot estimate the future demand
accurately if you do not take into account facts
which influence the demand.
Examples:
- an advertising or promotion campaign has been
launched;
- a new product which replaces the old one is
now available.
FORECASTING
METHODOLOGIES
PATTERNS THAT MAY BE PRESENT IN A TIME
SERIES

Level or horizontal: Data are relatively constant over


time, with no growth or decline.
Trend: Data exhibit a steady growth or decline over
time.
Seasonality: Data exhibit upward and downward swings
in a short to intermediate time frame
Cycles: Data exhibit upward and downward swings in
over a very long time frame.
Random: Erratic and unpredictable variation
TIME SERIES ANALYSIS

Concept: The evolution in the past will continue into


the future.
Types :
(a)Stationary They differ by
the shape of the
(b)Trend-based line which best
fits the observed
(c)Seasonal data.
TIME SERIES ANALYSIS

Methods of Time Series Analysis

(a) Linear Regressions They differ by the


importance they
(b) Moving Average give to the data
and by their
(c) Exponential Smoothing complexity.
4 STAGES OF ECONOMIC AND BUSINESS RESEARCH

1. Model Specification (Selecting the model)

What variables to include? What is the functional


form of the model? Is it reasonable to assume a
constant, an increasing, a decreasing or a seasonal
demand?
2. Parameterize the model – Model
Estimation
Question:
How to find values for the parameters: a, b,
... ?
Answer:
Use a method which tunes the parameters
in order to fit the curve with the
observations
3. EVALUATION OF ESTIMATES
a. Theory
Do they make sense in terms of economic
criteria?

b. Statistics
Are they reliable?
Criteria- t test, F test, R2, variances
4. Prediction and evaluation of the forecast
and evaluation of prediction errors
Forecast = model extrapolated in the future
Question:
How confident are we in this forecast ?
Answer:
If the errors made with this model in the
past are small, the error we will make will
be small too.
FORECASTING STATIONARY TIME SERIES
TIME SERIES MODELS
Model Description

Naïve Uses last period’s actual value as a forecast

Uses an average of a specified number of the most


Simple Moving Average recent observations, with each observation
receiving the same emphasis (weight)
Uses an average of a specified number of the most
Weighted Moving Average recent observations, with each observation
receiving a different emphasis (weight)

A weighted average procedure with weights


Exponential Smoothing
declining exponentially as data become older

An exponential smoothing model with a


Trend Adjusted Exponential Smoothing mechanism for making adjustments when strong
trend patterns are inherent in the data
A mechanism for adjusting the forecast to
Seasonal Indexes accommodate any seasonal patterns inherent in
the data

Technique that uses the least squares method to


Linear Trend Line
fit a straight line to the data
Yea Total Annual
Quarter 1 Quarter 2 Quarter 3 Quarter 4
r Demand

1 20 28 34 18 100

2 58 86 104 52 300

3 40 54 72 34 200

4 104 140 174 82 500

5 116 170 210 104 600

6 136 198 246 120 700


Naïve method
The forecast for next period (period t+1) will be equal to this period's actual
demand (At). We assume that each year (beginning with year 2) we made a
forecast, then waited to see what demand unfolded during the year. A forecast
is then made for the subsequent year, and so on right through to the forecast for
year 7.
Actual
Demand (At) Forecast
Year (Ft) Notes
There was no prior demand data on
1 100 --
which to base a forecast for period 1
From this point forward, these forecasts
2 300 100
were made on a year-by-year basis.
3 200 300

4 500 200

5 600 500

6 700 600
EXERCISE
Quarter Sales
1 50147
2 49325
3 57048
4 76781
5 48617
6 50898
7 58517
8 77691
9 50862
10 53028
11 58849
12 79660
13 51640
14 54119
15 65681
16 85175
17 56405
18 60031
19 71486
20 92183
21 60800
22 64900
23 76997
24 103337
MOVING AVERAGE

The moving average is moving because we look each


time at the last N values. All these values have the
same importance. For example, D(t-N) and D(t-1) have
equal importance in the computation of the moving
average
a. mean method
b. simple weighted average.
Mean (simple average) method: The forecast for next period
(period t+1) will be equal to the average of all past historical
demands.
Actual
Demand (At) Forecast
Year (Ft) Notes
There was no prior demand data on
1 100 --
which to base a forecast for period 1
From this point forward, these forecasts
2 300 100
were made on a year-by-year basis.
3 200 200

4 500 200

5 600 275

6 700 340

7 400
Simple moving average method: The forecast for next period
(period t+1) will be equal to the average of a specified number of
the most recent observations, with each observation receiving
the same emphasis (weight).
Actual
Demand (At) Forecast
Year (Ft) Notes
This forecast was a guess at the
1 100 200
beginning.
This forecast was made using a naïve
2 300 100
approach.
From this point forward, these forecasts
3 200 200
were made on a year-by-year basis.
4 500 250

5 600 350

6 700 550

7 650
4
WEIGHTED MOVING AVERAGE

We could find the earlier methods (average and simple


weighted average) inappropriate and want to give
higher weights to more recent data – weighted
average.
METHODS FOR STATIONARY TIME SERIES
(WEIGHTED MOVING AVERAGE)

EXAMPLE (A):

The weights should sum up to one


Weighted moving average method: The forecast for next period (period t+1) will be
equal to a weighted average of a specified number of the most recent observations.

After the third year, the weights that were used are as follows: Most recent year, .5;
year prior to that, .3; year prior to that, .2
Actual
Demand Weight Forecast
Year (At) (Ft) Notes
This forecast was a guess at the
1 100 0.2 200
beginning.
This forecast was made using a
2 300 0.3 100
naïve approach.
This forecast was made using a
3 200 0.5 300
naïve approach.
From this point forward, these
4 500 210 forecasts were made on a year-by-
year basis.
5 600 370
EXPONENTIAL SMOOTHING

Exponential smoothing assumes that the past


data is given a decreasing weights.
This set of forecasts was made using an α value of .1

Actual
Demand (At) Forecast
Year (Ft) Notes
This was a guess, since there was no
1 100 200
prior demand data.
From this point forward, these forecasts
2 300 190
were made on a year-by-year basis.

3 200 201

4 500 200.9

5 600 230.81

6 700 267.729

7 310.9561
When we made the forecast for last period (Ft), it
was made in the following fashion:

Ft = αAt-1 + (1- α)Ft-1 (equation 2)

F2 = 0.1(100) + (0.9)(200) = 10 + 180 = 190

If we substitute equation 2 into equation 1 we get the


following:

Ft+1 = αAt + (1- α)[αAt-1 + (1- α)Ft-1]

Which can be cleaned up to the following:

Ft+1 = αAt + α(1- α)At-1 + (1- α)2Ft-1 (equation 3)


METHODS FOR STATIONARY TIME SERIES
(EXPONENTIAL SMOOTHING)
COMPARISON BETWEEN MOVING AVERAGE AND
EXPONENTIAL SMOOTHING

Similarities
1. assume stationary process;
2. single method parameter (N for the MA and α for
the exponential smoothing); and
3. lag behind trend
If there is a general trend, both approach will follow
but with some delay
COMPARISON BETWEEN MOVING AVERAGE AND
EXPONENTIAL SMOOTHING

Differences
By their definition, the two approaches do not
incorporate the same amount of data.
1. number of data taken into account
(Although ES takes all the data into account, its
recursive formulation allows the new forecast
to be determined on the basis of the last forecast
and last observation only).
2. computation and memory
COMPARISON BETWEEN MOVING AVERAGE AND
EXPONENTIAL SMOOTHING
Variables
for the MA: choose N
A large value for N will characterize a stable forecast.
This is a quality if the process is stable,
it isn't if the process undergoes some changes.
for the ES: choose a
A small value for a will characterize a stable forecast (we
give very little importance to the new
observation D(t)). Again, this is appropriate if the process
is stable and it isn't if the process
undergoes some changes.
EXERCISES
173 104 220

163 156 154

188 172 139

131 156 175

171 151 210

148 177 134

182 155 193

111 143 179

109 152 152

177 148 158


TREND-BASED TIME SERIES

We assume that the underlying model shows a linear


trend.

This is again an assumption. In reality we do not


know whether the demand roughly follows a line or
not. The problem here is to determine the constants
a and b.
TREND-BASED TIME SERIES

Linear
Regression :

Y(t) = a + bt

The regression
analysis aims
at fitting a
straight line in
the set of points
METHODS FOR TREND-BASED TIME
SERIES

(a) Linear Regression- Technique that uses the least


squares method to fit a straight line to the data

(a) Double Exponential Smoothing (Holt)- An


exponential smoothing model with a mechanism for
making adjustments when strong trend patterns are
inherent in the data
METHODS FOR TREND-BASED TIME
SERIES (LINEAR REGRESSION)
Numerically, we obtain the following equations:

a= -10.500 b + 1.501;
b= 0.133 - 0.0732 a;

which can be solved to give a = 0.43 and b=0.10.

Note that similarly to the moving average method, the


linear regression analysis implicitly gives the same
weights to all the data.
METHODS FOR TREND-BASED TIME
SERIES (LINEAR REGRESSION)

Y= 0.43 + 0.10t
METHODS FOR TREND-BASED TIME SERIES (DOUBLE
EXP. SMOOTHING (HOLT))
An exponential smoothing algorithm that allows for local
linear trend in a time series
Current level of TS + Current slope or in level of TS
- To anticipate the upward or downward movement.

Lt=  Xt + (1- ) (Lt-1 + Tt-1) 0<  < 1


Lt=  (Lt – Lt-1) + (1 - ) Tt-1 0<  < 1
Where:
Lt - Estimate of level
Tt – Estimates of slope at time t
 and - smoothing constant 0< <1
Xt(h) = Lt + hT h= 1, 2, 3
METHODS FOR TREND-BASED TIME SERIES (DOUBLE
EXP. SMOOTHING (HOLT))

The goal here is also to determine the


model parameters a and b where a is the
intercept at time 0 and b the slope. Here
however, we will use the parameters a(t-1)
and b(t-1) where a(t-1) is the intercept at
time (t-1) and b(t-1) is the estimated slope
for the interval [t-1,t]. Note (but
incidentally) that both model parameters
are computed at time (t-1)
METHODS FOR TREND-BASED TIME SERIES (DOUBLE
EXP. SMOOTHING (HOLT))

Since a(t-1) is the intercept at time (t-1), the


slope has to be multiplied by 1 in order to
obtain the forecast for time t.
METHODS FOR TREND-BASED TIME SERIES (DOUBLE
EXP. SMOOTHING (HOLT))
Here we show how a new forecast is derived on the basis of the previous forecast and of
the observed data. On the basis of a(t-1) and of b(t-1), the forecast F(t) has been computed
at time (t-1). Now we are at time t. We observed D(t) and we must compute a(t) and b(t) so
that
a new forecast F(t+1) can be determined.
METHODS FOR TREND-BASED TIME SERIES (DOUBLE
EXP. SMOOTHING (HOLT))
We choose to set a(t) between the previous forecast F(t) and the observed data D(t). That
is, a(t) is a compromise between D(t) and F(t)=a(t-1)+b(t-1).

For the slope, we choose a value between the previous slope, b(t-1), and the slope of the
line passing by a(t-1) and a(t). That is, b(t) is a compromise between b(t-1) and (a(t)-a(t-1)).
Both compromises are ruled by smoothing factors:  and .
METHODS FOR TREND-BASED TIME SERIES (DOUBLE
EXP. SMOOTHING (HOLT))

With these values, we obtained b(0)=0; b(10)=0.050; b(20)=0.091 while the model used to
generate the data had a slope equal to 0.1. Here below you see the values of the model
parameters a and b as the forecasts evolved.
METHODS FOR TREND-BASED TIME SERIES (DOUBLE
EXP. SMOOTHING (HOLT))
\
METHODS FOR TREND-BASED TIME SERIES (DOUBLE
EXP. SMOOTHING (HOLT))

The following values were observed: b(0)=0.2; b(10)=0.141 and b(20)=0.102 for a model using a
slope equal to 0.1. To avoid this initialization problem, a solution consists in using a linear
regression on the first data to initialize the model parameters a and b.
METHODS FOR TREND-BASED TIME SERIES (DOUBLE
EXP. SMOOTHING (HOLT))

Making forecasts :
Assume the forecasts are along the line
For example, with the LR, the forecast
F(t,t+x) is given by the curve Y(t+x). With
the double exponential smoothing, the
forecast is F(t,t+x)= a(t) + b(t)x.
METHODS FOR TREND-BASED TIME SERIES (LINEAR
REGRESSION VS. HOLTS METHOD)
Similarity :
adequate for series with trends
Differences :
LR: - lots of work
- equal weight for all the data
- (a weighted version is possible)
Double ES (Holt):
- easy to compute
- decreasing (possibly dynamic) weights
- difficult to initialize
SEASONAL TIME SERIES
Additive vs Multiplicative Models

For monthly data, an additive model assumes that


the difference between the January and July
values is approximately the same each year. In
other words, the amplitude of the seasonal effect
is the same each year. The residuals are roughly
the same size throughout the series
Multiplicative Models
In many time series involving quantities (e.g. money, wheat
production, ...), the absolute differences in the values are of less
interest and importance than the percentage changes.

For example, in seasonal data, it might be more useful to model


that the July value is the same proportion higher than the January
value in each year, rather than assuming that their difference is
constant. Assuming that the seasonal and other effects act
proportionally on the series is equivalent to a multiplicative
model,
Fortunately, multiplicative models are equally easy to fit
to data as additive models! The trick to fitting a
multiplicative model is to take logarithms of both sides
of the model,

After taking logarithms (either natural logarithms or to


base 10), the four components of the time series again
act additively.
METHODS FOR SEASONAL TIME
SERIES

(a) Centered Moving Average


(CMA Method)
(b) Triple exponential smoothing
(Winters’ Method)-
CMA METHOD

centered moving average. In


reality this method provides the
seasonal coefficients only.
6 steps of CMA Method
1. examine data and determine cycle length (T)
2. determine the seasonal coefficients
3. extract seasonal coefficients from data
(deseasonalize)
4. determine the trends (by another method)
5. make (deseasonalized) forecasts
6. introduce seasonal coefficients
DESEASONALIZATION
SLIDES
METHODS FOR SEASONAL TIME
SERIES (WINTERS’ METHOD)
The method here consists in a triple exponential
smoothing by which all the model parameters
(a, b and the c's) are updated when a new observation is
obtained. We also assume that the cycle length has
been previously determined. The model parameters "a"
and "b" are updated as with the double exponential
smoothing, except that the observation is first
deseasonalized. The third equation updates the
corresponding seasonal coefficient. There again, a
compromise is made between the previous value of the
seasonal coefficient and the observed coefficient.
METHODS FOR SEASONAL TIME
SERIES (WINTERS’ METHOD)

The forecast is determined as usually.


METHODS FOR SEASONAL TIME
SERIES (WINTERS’ METHOD)
First, the trends is used to determine the deseasonalized forecast (a + b t).
Then, the adequate seasonal coefficient is introduced.
Here below is a plot of the forecast made daily using the Winter's method. We
can observe that the trend is adequate but that the seasonal coefficients
are not yet adequate.
5. EVALUATION OF FORECAST
Here we try to determine whether the forecast is good,
that is accurate and not biased. There are two usual
ways of measuring the accuracy of the forecasts.
EVALUATION OF FORECAST
The following result is extremely useful since it allows to
determine the variation of the error process from the
measure of the MAD.

For example, if we measure an MAD value of 8 units, we


could derive that the error process has a standard
deviation s equal to 10 units. The probability that the
demand exceeds the forecast by 20 units is then 0.023.
EXAMPLE: Ft = 120 Units
MAD = 8 Units
 = 10 Units
EVALUATION OF FORECAST
We can thus argue that the forecast is correct (equal to
120) up to an error term which is distributed as a normal
with mean 0 and standard deviation s. We can then
derive the probability that the demand falls within some
confidence interval.
Prob[Ft - 2 s < Dt < Ft - 2  ] = 0.95
95 percent confidence interval = [100 - 140]
Valid method if the errors and the
previsions are made in the same way
This means that if the errors are measured by comparing the
real demand and the forecasts made two days before, then
we can build a confidence interval for a forecast made today
for the demand in two days.
EVALUATION OF FORECAST
Note that the MAD is sometimes computed by
using an exponential smoothing process.
Tracking Signal

If your forecasting method is correct you should


overestimate and underestimate the demand
rather regularly. If your method is biased, then
you will repetitively under (or over-) estimate the
demand. The tracking signal aims at checking
whether there is some bias or not.
EVALUATION OF FORECAST

It simply consists in summing the error over time.


Theoretically, if there is no bias, this sum should remain
close to zero. The division by the MAD aims at measuring
the distance from the mean (here, 0) in terms of MAD.
We can plot the tracking signal over time for checking
purpose. We could also decide the limits it should not
exceed. Typical values are a few standard deviations.
WHICH METHOD TO USE?
Depends on: Observation
If you have few observations, it will be difficult to
define a detailed model. A linear regression for
computing the trends requires at least 10
observations to be valid. If you have some seasonal
variation, 3 or 4 cycles of observations are necessary
for your model to start being effective.

Depends on: Complexity


Finally, the amount of energy to spend for the
forecasting process plays also a role too.
WHICH METHOD TO USE?
Depends on: Time Horizon
The time horizon is also important. Do you want to
make a forecast for tomorrow, next month, next year or
the next 5 years ? How does the demand process vary
with respect to your time horizon ? Linear regressions
(and causal relationship methods) seem for example
more robust for long term forecast. In any case, the
observations on which you base your forecast is a
direct indicator of the horizon range for which your
forecast is valid.
EXERCISES
WHICH METHOD TO USE?
Depends on: The MAD Observed

If sufficient data are available, you could use the 3


fourths of your observations to set the parameters of
your model and then, use the last fourth of
observations to compare the forecasts of your model
with what really happened. Comparing the errors (the
MAD) made by different methods (and/or by different
models) provides an immediate selection criterion.
THANK YOU!