Академический Документы
Профессиональный Документы
Культура Документы
STATISTICS 2
ITESM Campus Guadalajara
Prof: Ing. Maria Luisa Olascoaga
DEFINITION OF
FORECASTING
Is predicting what will happen in
the future.
Is an estimate of the future level
of some variable
Why do we forecast?
DEFINITION OF
FORECASTING
Most companies forecast in order
to help the firm in strategic
planning activities such as:
inventory purchasing,
capacity planning,
labor planning,
etc.
NAIVE FORECASTING
TECHNIQUES
Naive forecasts: a folk
forecasting technique
In every day life situations we
forecast using very simple
technique
This technique is close to linear
trend model
NAIVE FORECASTS
The value tomorow will be the same as
today. Example: Number of visitors today
was 120. Forecast NF1 for tomorow: 120.
The value tomorow will be less (greater)
by 10%. Example: Average
temperature this month is 20 degrees.
Forecast for the next month: Temperature
will be 25 degrees (increase of 25%).
CURRENT SITUATION IN
FORECASTING
There exist a well defined set of
forecasting methods
There exists computer software
that may be quite simply
applied in forecasting
Excel program allows to solve
simple forecasting tasks
LAWS OF FORECASTING
1. Forecasts are Always Wrong: No forecasting
approach or model can predict the exact level of
the future variable. deal with the risks
2. Forecasts for the near-term tend to be more
accurate: Predicting tomorrows gas price will
likely be more accurate than predicting gas price
6 weeks from now.
3. Forecasts for groups of products or services
tend to be more accurate
4. Forecasts are no substitute for calculated
values
BASIC STEPS OF A
FORECASTING TASK
1.
2.
3.
4.
5.
6.
FORECASTING
METHODS
STATISTICS 2
ITESM Campus Guadalajara
Prof: Ing. Maria Luisa Olascoaga
FORECASTING
Qualitative
FORECASTING
FORECASTING
Past Sales
Future
Sales
Past Sales + Marketing Budget
Past Grades
Future
Past Grades + Practice Time Grades
PATTERNS IN A TIME
SERIES
A time series is a sequence of
observations of a variable that are
measured during a regular period
of time (every hour, day, month or
year)
They must be mesasured with
equal intervals.
EXAMPLE OF TIME-SERIES
DATA
Number of visitors
Year
1998
Number 420
1999 2000
2001
2002
2003
450
460
470
465
440
EXAMPLE OF TIME-SERIES
DATA
PATTERNS IN A TIME
SERIES
The pattern of the data helps
us to understand the behaviour
(trend) of the information.
A graph shows
the relation
between time
and the value
of the variable
$
time
PATTERNS IN A TIME
SERIES
The pattern of the data helps
us to undersdtand the
behaviour of the information.
A graph shows
the relation
between time
and the value
of the variable
PATTERNS IN A TIME
SERIES
When trying to analyze a time series
(be it sales, promotions etc) it's good
to remember that there are four
basic patterns:
1. Horizontal (random, irregular
variation)
2. Trend (linear)
3. Periodical (cyclical, seasonal)
4. Complex (a combination of part or all
listed above
HORIZONTAL PATTERN
When the values of the time series fluctuate
around a constant mean. Stationery time
series are very easy to forecast.
Retail or Stock market?
TREND PATTERN
Consists of a long-term increase or
decrease of the values of the time series
(close to the linear growth). Trend patterns
are easy to forecast and are very profitable
when found by stock traders!
PERIODICAL PATTERN
The values of these time series are
influenced by seasonal factors. A time
series with seasonal patterns are more
difficult to forecast but not too difficult.
COMPLEX PATTERN
Are a mixture of the others.
Which patterns can you find?.
FORECASTING
METHOD
Centered
Non-centered
Moving Averages
Horizontal
Pattern
Smoothing
Method
Exponential Smoothing
Exponential Smoothing with
Adaptive Response
Linear Moving Averages
Trend
Pattern
1 Param: Brown M.
2 Param: Holt M.
Exponential Smoothing
squared (Brown Method)
Seasonal
Pattern
Winters Method
Multiplicative Seasonality
FORECASTING
ACCURACY
What is the accuracy of a particular
forecast?
How to measure the suitability of a
particular forecasting method for a
given data set?
MEASURES TO ESTIMATE
ERRORS
To preliminary evaluate a forecast and suitability
of a method, various statistical measures may
be used.
Key concepts:
Error (e)
Mean (average) error (ME)
Mean absolute error (MAE)
Mean squared error (MSE)
Percentage error (PE)
Mean absolute percentage error (MAPE)
FORECAST ERROR
Error (e) of a forecast is measured as
a difference between the actual (A)
and forecasted values (F), that is,
e=AF
(+) undervalued: forecast under real
(-) overvalued: forecast over real
MEASURES TO ESTIMATE
ERRORS
Mean (average) error (ME)
e
ME
n
n number of
forecasted values
MEASURES TO ESTIMATE
ERRORS
Mean absolute error (MAE)
e
MAE
n
n number of
forecasted values
MEASURES TO ESTIMATE
ERRORS
Mean squared error (MSE)
MSE
n number of
forecasted values
MEASURES TO ESTIMATE
ERRORS
Percentage error (PE)
e
PE
100
Value
MEASURES TO ESTIMATE
ERRORS
Mean absolute percentage error (MAPE)
e
100
PE
value
MAPE
n
n
n number of forecasted values
MEASURES TO ESTIMATE
ERRORS
MEASURES TO ESTIMATE
ERRORS
STATISTICAL MEASURES
OF GOODNESS OF FIT
In trend analysis the following measures will be
used:
1. The Correlation Coefficient (R):
Measures the strength and direction of linear relationships between two
variables. It has a value between 1 and +1. A correlation near zero
indicates little linear relationship, and a correlation near one indicates a
strong linear relationship between the two variables
MOVING
AVERAGE
FORECASTING
METHOD
STATISTICS 2
ITESM Campus Guadalajara
Prof: Ing. Maria Luisa Olascoaga
SMOOTHING
Smoothing the data variation: a graphical presentation
Data
Moore smoothed data
Smoothed data
PREREQUISITE DATA
PATTERN
Moving average method is
commonly used when:
the pattern in the data does not
have periodical (seasonal or cyclic)
characteristics
is neither growing nor declining
rapidly.
FORMULA
If forecast for t period is denoted by Ft,
and the actual value of the time-series
was Yt-1 during period t-1, Yt-2 during
period t-2, etc., then k period simple
moving average is expressed as:
k most recent values Yt Yt1 ... Ytk1
Ft1
k
k
CHOOSING THE
AVERAGING PERIOD
The averaging period (value of n) must
be determined by the decision-maker.
It is important to try to select the best
period to use for the moving average.
As a general rule, the number of
periods used should relate to the
amount of random variability in
the data.
Specifically, the bigger the moving
average period, the greater the
random elements are smoothed.
EXAMPLE
Month
Number Moving
of
average
clients
(2)
January
February
March
April
May
(forecast
)
50
30
20
30
40
25
25
CALCULATION OF ERRORS:
EXAMPLE
Month
Number
of
clients
Moving
average
(2)
Error
Percentag
e error
(MAPE)
January
50
February
30
March
20
40
-20
100
April
30
25
17
7.5
58.5
May
(forecast)
25
Mean
error
EVALUATION OF MA
Advantage:
Very simple method.
Shortcomings:
Not applicable when trend exists,
No strict rule of choosing its
parameter,
The new and the old data are
treated in the same way (while, in
fact, the old data should be treated
as being less signifficant).
EXAMPLE
Certain barbecue restaurant offers an
entre of lamb on Friday. This rare dish
has been ordered by 75, 64, 68 and 70
clients during the past four weeks.
Prepare a demand forecast for the next
week using a moving average of four
periods.
Respuesta: 69.25
EXAMPLE
Ejercicio 2.
4.27
4.21
3.94
4.21
4.08
8
9
10
11
4.67
4.95
4.54
4.15
Respuesta : 4.348
EXPONENTIAL
SMOOTHING
FORECASTING
METHOD
STATISTICS 2
ITESM Campus Guadalajara
Prof: Ing. Maria Luisa Olascoaga
EVALUATION OF ES
Advantage:
Rather simple method; More recent data are
considered as being more influential.
Requires only two data values to smooth the
future: the most recent observation, and the
most recent estimate, also requires a default
value for alpha ().
Short term - inventories
Shortcomings:
No definite rule of choosing its parameters
The value of should be determined by trial
and error. (Test different values of to find
the lowest MSE).
EVALUATION OF ES
The smoothing constant (value of ) must be
determined by the decision-maker. It is
important to try to select the one that makes
the MSE smaller.
Recomendations:
To predict long-term or smooth a series by
removal of cyclical and irregular variations, select
a small value for = 0 < <.5
high softening will occur.
FORMULA
Ft1 Yt (1 )Ft
Ft+1= forecast for the period t + 1
Yt = real value of time series in period t
Ft = forecast for period t of time series
= smoothing constant (0 1)
EXAMPLE
Month
Number of
clients
January
February
March
40
37
43
April
May
45
Forecast
(Exponenti
al
Smoothing
)
=.02
Calculation of errors:
Example
Month
Number
of clients
January
40
February
37
March
43
April
45
May
Exponentia
l
Smoothing
Forecast
=
Error
Squared
error
EXERCISES
The sales of cars in a Ford Agency are
calculated using simple exponential
smoothing. The agency believes that the
sales have no seasonal variation or trend,
thus this method works fine. However, each
month of march the agency observes that
the forecast for March is higher than that of
february by 200 units. Supose that at the
end of february of 2002, Yt = 600. During
march of 2002, 900 cars were sold. With
= 0.6, find the expected sales of cars for
April 2002.
EXERCISES
Real
Sales Forecast
Februar
y
March
600
900
800
860
1-
0.6
0.4
EXERCISES
A distributor of construction materials is
using exponential smoothing to forecast
the monthly demand (in tons) of a
material. For June the forecast demand
was of 130 ton, however the sales were of
135 ton. For July, the forecast was for
133.75, and 132 ton were sold. Find the
smoothing constant and forecast the
demand for August.
EXERCISES
The smoothing constant equals .75 and
the forecast the demand for August
equals 132.4375 tons.
Real
Sales
Forecast
June
135
130
July
132
133.75
132.437
5
August
ft+1=a(yt)
+ft(1-a
ft+1=ayt+ftaft
ft+1 - ft =a(ytft)
a= ft+1 - ft/
(yt-ft)
0.75
1- 0.25
EXERCISES
The weekly demand for car loans in the
Washington Federal Credit Union in the
last six weeks is shown in the table below.
1. Find using exponential smoothing the
Find:
Week
Deman
d of
loans
20
18
22
24
28
23
2.
3.
4.
5.
EXERCISES
The weekly demand for car loans in the
Washington Federal Credit Union in the
last six weeks is shown in the table below.
Week Dema Forec
Error
AE
ES
PE
APE
Find:
nd of
loans
20
18
22
24
28
23
ast
7
MEAN
ADAPTIVE
RESPONSE
RATE
EXPONENTIAL
SMOOTHING
STATISTICS 2
ITESM Campus Guadalajara
Prof: Ing. Maria Luisa Olascoaga
EVALUATION OF ARRES
Advantage:
automatically adjusts the smoothing parameters based
on the forecast error.
The smoothed term is replaced by t, and the later is
adaptive over time
Shortcomings:
The underlying rationale for time varying is less clear.
as a random coefficient or autoregressive form,
depending on the nature of the process.
Another drawback for this model is that there is no
explicit way to handle seasonality.
A major flaw with smoothing models is their inability to
predict cyclical reversals in the data, since forecasts
depend solely on the past.
FORMULA
Et
Mt
decision maker)
CHOOSING THE
SMOOTHING CONSTANT
The forecasting procedure for this model can be
proceeded recursively:
1. Given the values of Yt and Ft, we can estimate et from (1).
2. The et then is plugged into (2) and (3).
3. Given the estimated value of , we can obtain t by using
(4).
4. Finally, we use t, Yt and Ft to predict Ft+1 by employing the
first equation.
Example
EXERCISES
A
LINEARLY
WEIGHTED
MOVING
AVERAGE
STATISTICS 2
ITESM Campus Guadalajara
Prof: Ing. Maria Luisa Olascoaga
EVALUATION OF ARRES
Advantage:
This method is used to forecast series with a
linear trend line since this method handles it
better that the simpler one.
Designed to handle trending data. One set
of moving averages is calculated and then a
second set is calculated as a moving average
of the first set.
Weighted Moving Average - place more
weight on recent observations. Sum of the
weights needs to equal 1
FORMULA
First moving average
X t X t 1 X t 2 ... X t n 1
SMA M t
k
M t M t 1 M t 2 ... M t n 1
DMA M t
k
Difference between both moving averages
at 2 M t M t
Another adjustment constant
M t M t
bt 2
n 1
Ft p at bt p
Example
Time
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Rents
654
658
665
672
673
671
693
694
701
703
702
710
712
711
728
Example
Time
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Rents
654
658
665
672
673
671
693
694
701
703
702
710
712
711
728
SMA
659
665
670
672
679
686
696
699
702
705
708
711
717
DMA
665
669
674
679
687
694
699
702
705
708
712
675
675
684
693
705
705
705
708
711
714
722
Forecast
5
3
5
7
9
6
3
3
3
3
5
681
678
690
700
714
710
708
711
714
717
727
Error
-10
15
4
1
-11
-8
2
1
-3
11
EXERCISES
Let 198.75 be the first linear moving
average in the period 8, and 199.93 the
value of the second moving average in
that same period. Calculate the value of
the forecast for period 9, 15 and 18.
Consider n = 4.
EXERCISES
Find the equation of the line
and the forecast for 1998, using
DMA for four periods (n=3)
BROWN METHOD
OF
FORECASTING
STATISTICS 2
ITESM Campus Guadalajara
Prof: Ing. Maria Luisa Olascoaga
EVALUATION OF BROWN
Advantage:
Similar to the double moving average model.
If the trend as well as the mean is varying
slowly over time, a higher-order smoothing
model is needed to track the varying trend.
Uses two different smoothed series that
are centered at different points in time. The
forecasting formula is based on an
extrapolation of a line through the two
centers.
FORMULA
Equations
At A't Yt
At exponentially smoothed value Yt at time t
A't doubly exponentially smoothed value Yt at time t
Used for t: 2, 3.
At Yt (1 ) At 1
At' At (1 ) At'1
at 2 At At'
Yt p at bt p
'
bt
( At At ) a is the constant value in the linear equation
1
b is the slope for the linear equation
FORMULA
Equations
Yt p at bt p
where p is periods into the future
a is the constant value in the linear equation
b is the slope for the linear equation
Uses a single coefficient, alpha, for both smoothing
operations.
Calculates the difference between single and double
smoothed values as a measure of trend (at).
It then adds this value to the single smoothed value
together with an adjustment for the current trend (bt).
EXERCISES
1. Given b4 = 1.0696 and A4 = 96.064
calculate the value of the forecast for
period five. Use =.2
2. Given the first and second observation
whose values are 94 and 90,
respectively determine the forecast for
period 3. Use =.25
Example
Find the linear equation with this method and the
forecast for period 8,10 & 15. Use =.2
Period
1
2
3
4
5
6
7
8
10
15
Yt
5.4
5.3
5.3
5.6
6.9
7.2
7.2
At
At
at
bt
HOLT METHOD
STATISTICS 2
ITESM Campus Guadalajara
Prof: Ing. Maria Luisa Olascoaga
EVALUATION OF HOLT
Advantage:
FORMULA
Equations:
At Yt (1 ) At1 Tt1
Tt At At1 (1 )Tt1
Ft p At Tt p
Where:
At Level of smoothed series in period t.
Tt = Slope of the series in period t.
Yt = Observed value in period t.
a is a smoothing constant
b is a smoothing constant
FORMULA
1. Start with:
A1 Y1
T1 Y2 Y1
Ftp At Tt p
EXERCISES
The following table shows annual tax on
income (millions of U.S. Dlls.) paid to the
Government by residents of a city. Use the
method of Holt with
= 0.95 and = 0.5, to obtain the
forecasting equation and the forecast for
1998.
Example
Year
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2012
Period
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Yt
55.4
61.5
68.7
87.2
90.4
86.2
94.7
103.2
119
122.4
131.6
157.6
181
217.8
244.1
At
Tt
Ft
Example
Use the Holt method to predict the
monthly sales of DVD's in Highland
Appliance. It is known that in October
2010, At = 200 and Tt = 10. During
November 2010, 230 were sold DVD's.
Forecasts sales of DVDs for December
2010 using
= = 0.5.
Example
The method of Holt, exponential
smoothing for time trend with no
seasonal variation series, is used to
predict weekly sales of an agency Ford.
The previous to last week sales were 50
cars per week, with a trend of 6 cars per
week. 30 Cars were sold last week. After
observing the sales of the previous to last
week, predict the number of cars to be
sold during this and the next week. Use
= = 0.7. Discuss the result.
Example
The
following
table shows
the sales of
saws for the
Acme tool
Company.
These are
quarterly
sales From
2008 through
2010.
Year Quarter
2008
1
2
3
4
2009
1
2
3
4
2010
1
2
3
4
t
1
2
3
4
5
6
7
8
9
10
11
12
sales
500
350
250
400
450
350
200
300
350
200
150
400
Example
Year Quarter
1. For Holt Method
2008
1
use: = .3 and =.1
2
to predict sales for
3
2008 Q3 and 2010
4
Q2
2009
1
2. Use Brown to
2
forecast Q3 of
3
2011
4
3. Use DMA: to
forecast with a
2010
1
moving period of 4
2
Q2 2010
3
4
t
1
2
3
4
5
6
7
8
9
10
11
12
sales
500
350
250
400
450
350
200
300
350
200
150
400
QES METHOD
STATISTICS 2
ITESM Campus Guadalajara
Prof: Ing. Maria Luisa Olascoaga
EVALUATION OF QES
Advantage:
FORMULA
At Yt (1 ) At 1
At' At (1 ) At'1
At At (1 ) At1
at 3 At 3 At' At
'
bt
(
6
)
A
(
10
)
A
t
t ( 4 3 ) At
2
21
'
ct
(
A
2
A
t
t At )
2
1
1
Ft p at bt p ct p 2
2
FORMULA
1. Consider:
A1 A A1 Y1
'
1
1
2
Ftp at bt p ct p
2
EXERCISES
Calculate using = 0.1 the quadratic
equation for this model and the value for
the forecast for period 3 & 7. Having the
observed values for periods one to four:
105, 108, 111 and 103.
Example
EXERCISES
For the following exercises consider that the trend
equation is quadratic with a smoothing coefficient
: 0.3.
1.Find the equation knowing that: Y4= 9.25, A3=
8.22, A3=8.31 & A4= 8.4
WINTERS
METHOD
STATISTICS 2
ITESM Campus Guadalajara
Prof: Ing. Maria Luisa Olascoaga
FORMULA
Equations:
Yt
At
(1 ) At 1 Tt 1
St L
Tt At At 1 (1 )Tt 1
Yt
St
(1 ) S t L
At
Ft p ( At Tt p ) S t L p
Where:
FORMULA
1. Start with:
EXERCISE
Period
Sales
(Yt)
362
385
432
341
382
409
498
387
473
Level
(At)
Seasonal
Forecast
Trend (T) Index
(Ft)
(SI)
EXERCISE
Sales
(Yt)
Period
1
2
3
4
5
6
7
8
9
362
385
432
341
382
409
Seasonal
Forecast
Trend (T) Index
(Ft)
(SI)
0.953
1.013
1.137
380
9.750
0.897
398.993 10.258
0.953 371.29
404.679 10.007
1.013 414.64
471.43
381.11
414.11
Level
(At)
EXERCISE
Outdoor Furniture Swings.
Usually the customers buy more swings in the hot
months than in the cold ones, so sales change with
the seasons. Suppose that the Outdoor Furniture
swings are very good and verbal advertising
increases the number of people who buy them.
Their data that reflects seasonality and trend are
given in the following table. Calculate sales for next
year using = 0.15 ; = 0.1 y = 0.2
EXERCISE
Outdoor Furniture Swings.
EXERCISE
Outdoor Furniture Swings. (L=4)
Quart
er
1
2
3
4
Year
1
60
234
163
50
2
69
266
188
59
3
84
310
212
64
EXERCISE
Use the method of Winters for a time series with
seasonality (quarters). The values registered for
the four quarters of the first year are: 57.26 66.81,
68.39 and 77.99 respectively; Likewise known
records of the four quarters of the second year are:
65.18, 74.02, 74.12 and 82.31. Use the forecasting
method to find period 9. (= 0.3, = 0.2 and =
0.2)