Beruflich Dokumente
Kultur Dokumente
CHAPTER 5
The word univariate is a unification of two words, uni which means one and variate which is another word for variable. Hence, univariate models belong to a class of models which require only one variable to be formulated. As a forecasting tool it is simple, less costly and easier to understand.
7/19/2010
Forecasting Scenario
Historical periods: Modelling part Future: Forecast part
ERROR MEASURES
The criterion used to differentiate between a poor forecast model and a good forecast model is called error measure. The usual measurement being error measure that has the smallest value. There is no particular error measure has been found to be best under all situations and for all model types.
2.5 2 1.5 yt
Two-step-ahead Three-step-ahead
time (t)
t+1
t+2
t+3
t+4
A truly good model will be identified when the most number of error measures employed in the evaluation process give similar favorable results to the model.
MSE =
e
t
2 t
n ) for which e t = y t y t
7/19/2010
Nave Models
Naive forecast Nave with trend forecast
MAPE =
t =1
(e
/ y t ) 100 n
Methods of Averages
Average forecast Average change model Average percent change model
(e
7/19/2010
Nave forecast
This model strongly believes that what happens today will happen again tomorrow or any other time in the future. Let the variable be y t and the corresponding , , , , , to be values at time t=1,2,3,4,.,t
This model works best when the actual historical data series contains no discernible pattern. It performs well in series which exhibits a slow change in the fluctuations. Sudden change in the current data would severely affect the accuracy of the forecast values.
y1 , y 2 , y 3 , y 4, ......, y t
Hence, mathematically the model can be represented as,
F t +m = yt
7/19/2010
7/19/2010
10
Naive with trend model BENCH MARK model usually pitted against more complex models. The decision on the superiority of a particular model over another is decided based on the values of the error measures of the benchmark and the competing models.
7/19/2010 NURUL NISA' KHAIROL AZMI 11
The nave model is modified to take into account of the trend component. it can be used even with fairly short time series. overcoming the common problem of insufficient data which is a common phenomenon in many organisations. The one-step-ahead forecast is represented as, y Ft+1 = yt t yt1
7/19/2010
12
7/19/2010
Hence, if y t is greater than y t 1 then the trend is and conversely upward If y t is less than y t 1 then the trend is downward.
7/19/2010
13
7/19/2010
14
Method of averages
120.0 100.0
In d ic e s
y refers to the arithmetic mean of the actual historical time series and is defined as
y=
,
Year
Indices Fitted
y
t =1
t =n
7/19/2010
Method of averages
The method assumes that the forecast value equals to the average value of the data series over the historical time period the data were collected. This method necessitates the forecast value to be recalculated whenever a new observation is obtained and added to the existing series. The method performs most satisfactorily when the historical time series contains no discernible pattern, significant drop or growth.
7/19/2010 NURUL NISA' KHAIROL AZMI 17 7/19/2010
Method of averages
For series that fluctuate randomly around a constant value, the mean of the data set provides a good estimate of the forecast value. However, the existence of extreme values may significantly influence the outcome of the forecast.
18
7/19/2010
Is widely used by organisations because of its stability and practicability. It is based on the premise that the forecast value is equal to the actual value in the current period plus the average of the absolute changes experienced up to that point in time.
I n d ic e s
Ft +m = y t + Average of Changes
Year
Indices Fitted
7/19/2010
( yt yt 1 ) + ( yt 1 yt 2 )
7/19/2010 NURUL NISA' KHAIROL AZMI 21 7/19/2010 NURUL NISA' KHAIROL AZMI 22
F98 = y97 +
(y97 y96) + (y96 y95 ) 2 ( 109 .9 107 .0) + (107 .0 103 .4) = 109 .9 + 2 = 131 .1
Indices
Year
Indices
Fitted
7/19/2010
23
7/19/2010
24
7/19/2010
May be unsuitable for forecasting beyond one or two months period since the compounding effect will, over time, produces very high forecasts. Assigns equal weight to all historical time periods.
F98 ( y 97 y 96 ) ( y 96 y 95 ) + y 96 y 95 y 97 = y 97 + 2 109.9 107.0 107.0 103.4 + 107.7 103.4 109.9 = 109.9 + 2 = 113.3
NURUL NISA' KHAIROL AZMI 27
Row No.
1 2 3 4 5 6 -
7/19/2010
7/19/2010
28
Year 1960 1961 1962 1963 1964 1965 1966 1967 1975 1976 1977 1978
Indices 31.3 31.3 31.3 32.2 32.1 32.9 33.4 34.8 49.7 51.1 53.5 55.9
Fitted 31.3 32.7 32.5 33.3 34.1 53.9 55.1 53.0 55.5 Forecast
Year 1979 1980 1981 1982 1983 1984 1985 1986 1994 1995 1996 1997 1998
Indices 57.8 61.8 67.8 71.7 74.4 77.0 77.3 77.8 100.0 103.4 107.0 109.9
Fitted 58.5 60.1 65.0 73.4 77.2 77.9 79.8 78.8 100.4 103.6 107.1 110.7 113.3
120.0 100.0
In d ic e s
80.0 60.0
Year
Indices
Fitted
7/19/2010
29
7/19/2010
30
7/19/2010
7/19/2010
31
7/19/2010
32
7/19/2010
34
Ft +m = y t + (1 )Ft
is the unknown smoothing constant to be determined with value lying between 0 and 1, 1 i.e.
0 1
7/19/2010
35
7/19/2010
36
7/19/2010
can be determined:
An important point to note is that, the values of these coefficients lose their significance as we move further and further into the past.
The first procedure relies heavily on ones personal knowledge and past experience of the variable involved. (Note: The value of approaches one when there is rapid changes in the data set).
37 7/19/2010 NURUL NISA' KHAIROL AZMI 38
7/19/2010
The objective method requires the application of certain measurement criterion that can be used to determine the best value of Here, best is taken to mean that by applying a particular value then a certain measurement criterion is minimised. Common name g given to such measurement criterion is error measure. Some well known error measures are Mean Squared Error (MSE), Root Mean Squared Error (RMSE) and Mean Absolute Percent Error (MAPE).
7/19/2010
39
7/19/2010
40
The objective is to choose the alpha value that minimises the errors i.e. an alpha that results in the smallest error measure. Let the error measure be the Mean Squared Error (MSE). Hence, the process of fitting the model is such that when the basically the search for n 2 i used, is d th then th the et MSE = t =1 (calculated over n
et = yt Ft
yt
t=1 we have,
7/19/2010 NURUL NISA' KHAIROL AZMI 41
7/19/2010
42
7/19/2010
need the values of to generate the value of F1 there is no values for y 0 as initial or start-up values.
y0
and
F0
Note: Fitting the exponential smoothing model does not require any testing of significance of the parameter because the errors generated are biased. The check on the goodness of fit basically depends on locating the value of that minimises the errors.
7/19/2010 NURUL NISA' KHAIROL AZMI 43
44
A
( 1960 1961 1962 1963 1964 . .
C
) (
D
) =B2-C2 =B3-C3 =B4-C4 =B5-C5 =B6-C6 . . Total
The Excel instructions used to generate the one step ahead forecasts are given in the one-step-ahead following table. In this example, the value of smoothing constant used is 0.9.
1 2 3 4 5 6 -
yt
31.3 31.3 31.3 32.2 32.1 . .
Ft
31.3
=sum(E2:E39)
7/19/2010
45
7/19/2010
46
produce different
7/19/2010
47
7/19/2010
48
7/19/2010
Insert Constraints
7/19/2010
49
7/19/2010
50
7/19/2010
51
7/19/2010
52
7/19/2010
53
7/19/2010
54
7/19/2010
Using SPSS to generate the forecast values The results obtained Setting the SPSS instructions
7/19/2010
55
7/19/2010
56
The results
7/19/2010
57
7/19/2010
58
Double Exponential Smoothing Also known as Browns method. Is useful for series that exhibits a linear trend characteristic. Let,
St
S t'
be the exponentially smoothed value of yt at time t be the double exponentially smoothed value of yt at time t
a t = 2 S t S t'
bt =
( S t S t' )
7/19/2010
59
7/19/2010
60
10
7/19/2010
Ft +1 = a t + bt 1
Main advantage: (over single exponential) is its ability to generate multiple-aheadforecasts, i e the equation is able to generate i.e. the one, two, three and so forth ahead-forecast values.
7/19/2010
61
7/19/2010
62
Thus, the CPI value for the year 1960 is 31.3. A Assume also l = 0.6 0 6 th then, th the estimate ti t f for 1961 is calculated as follows,
S 61 = 0.6 ( y 61 ) + (1 0.6) S 60
7/19/2010
64
Fitting Double Exponential Model using Excel Software (Excel Instructions to fit Double Exponential Smoothing)
yt
31 3 31.3 31.3 31.3 32.2 -
St
31 3 31.3 =(0.6*B3)+( 0.4*C2) =(0.6*B4)+( 0.4*C3) =(0.6*B5)+( 0.4*C4) -
S t'
31 3 31.3 =(0.6*C3)+( 0.4*D2) =(0.6*C4)+( 0.4*D3) =(0.6*C5)+( 0.4*D4) -
at
31 3 31.3 =2*C3-D3 =2*C4-D4 =2*C5-D5 -
bt
0 =(0.6/0.4) *(C3-D3) =(0.6/0.4) *(C4-D4) =(0.6/0.4) *(C5-D5) -
Ft
31 3 31.3 31.3 =E3+F3*1 =E4+F4*1 -
F 62 = a 61 + b61 1
=31.3+0x1
yt
=31.3
yt
6 7
7/19/2010
65
7/19/2010
66
11
7/19/2010
Actual and Fitted Values (Double Exponential Fitted Values using Double Exponential Smoothing
Row No . 1 2 3 4 5 6 A B C D E F G
Smoothings)
yt
31.3 31.3 31.3 32.2 32.1 103.4 107.0 109.9
St
31.3 31.3 31.3 31.8 32.0 101.1 104.6 107.8
S t'
31.3 31.3 31.3 31.6 31.8 98.8 102.3 105.6
at
31.3 31.3 31.3 32.1 32.1 103.4 107.0 110.0
bt
0 0.0 0.0 0.3 0.2
Ft
31.3 31.3 31.3 31.3 32.4 120.0 100.0 80.0 60.0 40.0 20.0 0.0
Year
Indices
Fit ted
37 38 39 40
7/19/2010
67
7/19/2010
68
Holts method
is called Holts two parameter method. Frequently used to handle data with linear trend, it not only smoothes the trend and the slope directly by using different smoothing constants but also provides more flexibility in selecting the rates at which the trend and slopes are tracked.
7/19/2010 NURUL NISA' KHAIROL AZMI 69
Three equations:
1) Exponential smoothed 2) Trend estimation 3) Forecast
St = yt + (1 )( St 1 + Tt 1 )
Tt = ( S t S t 1 ) + (1 )Tt 1
Ft + m = St + Tt m
The values of range from 0 to1.
7/19/2010 NURUL NISA' KHAIROL AZMI 70
and
Let the values of and be set priori at 0.6 and 0.2, respectively. The estimated values are generated based on the one-step-ahead procedure. The value of MSE for =0.6 and =0.2 is 2.512.
7/19/2010
71
7/19/2010
72
12
7/19/2010
Row No. 1 2 3 4 5
Year A Year 1960 1961 1962 1963 B C D E 1960 1961 0 =0.2*(C3C2)+(0.8*D2) =0.2*(C4C3)+(0.8*D3) =0.2*(C5C4)+(0.8*D4) 31.3 1962 31.3 31.3 32.2 =(0.6*B3)+(0.4)*(C2+D2) =(0.6*B4)+(0.4)*(C3+D3) =(0.6*B5)+(0.4)*(C4+D4) 31.3 =C3+ D3*1 1963 1977 1978
yt
31.3 31.3 31.3 32.2 53.5 55.9
St
31.3 31.3 31.3 31.8 53.4 55.8
Tt
0.0 0.0 0.0 0.1 2.3 2.3
Ft
31.3 31.3 31.3 31.3 53.2 55.7
yt
57.8 61.8 67.8 71.7 107.0 109.9
St
57.9 61.2 66.1 70.7 106.6 109.9 Forecast
Tt
2.3 2.5 3.0 3.3 3.2 3.2
Ft
58.1 60.2 63.7 69.1 106.0 109.8 113.1
yt
31.3
St
31.3
Tt
Ft
7/19/2010
73
7/19/2010
74
Adaptive Response Rate Exponential Smoothing (ARRES) Usually, the value of alpha parameter used is assumed constant for all time periods. However, over time events may take place that affect the subsequent data behaviour. As an example, people may change their desire to buy a certain product or there is the change in the level of output as a result of technological change or innovation.
75 7/19/2010 NURUL NISA' KHAIROL AZMI 76
Year
Indices
Fitted
7/19/2010
Adaptive Response Rate Exponential Smoothing (ARRES) The change could either be permanent or it may effect temporarily and the data movements revert to its normal self after a certain period. In these situations, to maintain the same value for alpha for all time periods may not be a realistic decision. Thus, the ARRES technique was developed.
7/19/2010 NURUL NISA' KHAIROL AZMI 77
where,
0< <1
et = y t F t
Et = et + (1 ) E t 1
AEt = et + (1 ) AEt 1
Et
78
13
7/19/2010
In the application of the ARRES model one does not require to find for the best alpha, . This Thi is i because b th there i no single is i l best b t value l which happens to vary over time. For this reason the appropriate symbol used is
yt
yt
1960 1961 1962 1963 1964 1965 1966 1967 31.3 31.3 31.3 32.2 32.1 32.9 33.4 34.8 7/19/2010
t
31.3 =G2*B2+(1G2)*C2 =G3*B3+(1G3)*C3 G3) C3 =G4*B4+(1G4)*C4 =G5*B5+(1G5)*C5 =G6*B6+(1G6)*C6 -
et
0 =B3-C3 =B4-C4 =B5-C5 =B6-C6 =B7-C7 -
Et
0 =0.2*D3+(0. 8)*E2 =0.2*D4+(0. 8)*E3 8) E3 =0.2*D5+(0. 8)*E4 =0.2*D6+(0. 8)*E5 =0.2*D7+(0. 8)*E6 NURUL NISA' KHAIROL AZMI
AE t
0 =0.2*ABS(D3) +(0.8)*F2 =0.2*ABS(D4) +(0 8)*F3 +(0.8) F3 =0.2*ABS(D5) +(0.8)*F4 =0.2*ABS(D6) +(0.8)*F5 =0.2*ABS(D7) +(0.8)*F6 -
Ft
0.2 0.2 0.2 =ABS(E5/F5) =ABS(E6/F6) =ABS(E7/F7) 80
2 3 4 5 6 7 8 9 -
7/19/2010
79
The Fitted Values Using Adaptive Response Rate Exponential Smoothing (ARRES)
yt
yt
31.3 31.3 31 3 31.3 103.4 107.0 109.9
Ft
31 31 31 100.0 103.0 107.0 110.0
et
0.0 0.0 00 0.0 3.4 3.6 2.9
Et
0.00 0.00 0 00 0.00 3.09 3.19 3.13
AE t
0.00 0.00 0 00 0.00 3.09 3.19 3.13
t
0.200 0.200 0 200 0.200 1.000 1.000 1.000
19 60
19 64 19 68
19 72 19 76
19 80 19 84
19 88
Year
Indices
7/19/2010
81
7/19/2010
19 92 19 96
Fitted
82
Holt-Winters Trend and Seasonality When seasonality exists, then the Holt-Winters Trend and Seasonality is most suitable. Two assumptions can be made with regard to the relationship of these components; i. the multiplicative effect and ii. the additive effect. Consist of three basic component: i. Level ii. Trend iii. Seasonality
7/19/2010 NURUL NISA' KHAIROL AZMI 83
Ft + m = ( Lt + bt m) S t s + m
7/19/2010
84
14
7/19/2010
where,
Lt
yt
- the level component of the series, comprising of the smoothed values but does not include the seasonality component, - the actual values which include seasonality, - the smoothing constant for level (0<
<1)
< 1)
m
Ft + m
- the length of seasonality (e.g. number of quarters or months in a year which are 4 and 12, respectively),
7/19/2010
85
7/19/2010
86
Determining the Initial Values Let us set priori the values of = 0.7 = 0.2 and
= 0.0 . To determine the initial value for
The initial values for the first component of the trend, , is calculated as the mean of the trend over one season, i.e.
L0
7/19/2010
87
7/19/2010
88
Hence,
b4 =
S1 =
S2 =
= -2460.87
.
The initial values of the seasonal components of the first 4 quarters are calculated by using the ratio of the actual values to the mean of the first 4 values as represented by L , in which,
0
7/19/2010 NURUL NISA' KHAIROL AZMI 89
S3 =
S4 =
7/19/2010
90
15
7/19/2010
7/19/2010
91
16