Sei sulla pagina 1di 18

Time Series Lecture Notes, 1

MSc in Operational Research


Lecture 1

CLASSICAL TIME SERIES DECOMPOSITION
Introduction
We mentioned in lecture 1 that after we calculated the trend, everything else that remained
(according to that calculation approach) was called the residuals. We also stated that there are other
methods that give particular importance to these residuals'. These methods treat this remainder as
a valuable component of the time series, and the basis for using these methods is to find the
components that make up the series. Let us develop further our initial formula according to which:
Time series = Pattern + Residuals
If we give a name to the pattern and call it a trend, then the residuals could be called variations
around the trend. The variations could be of a different nature and we can differentiate the following
variations:
Cyclical variations
Seasonal variations
Irregular variations
In the past, when this method was developed for census purposes, trend was called a `secular
variation' or a `secular tendency'. Almost a hundred years ago, statisticians developed a method
that we, call today a classical decomposition method, and the basic assumption of this method
was that each time series consisted of the following components:
T = trend
C = cyclical component,
S = seasonal component,
I = irregular variations
Decomposition techniques are among the oldest of the forecasting methods. Economists have used
these techniques since the beginning of the century to identify the business cycle. Decomposition
methods are among the easiest to understand and use, especially for short-term forecasting. In
addition, unfortunately, the decomposition method is basically intuitive and there are number of
theoretical weaknesses in its approach. However, these do not prevent the positive results obtained
in the practical application of the method.

Additive and Multiplicative Models
Time-series models can basically be classified into two types: additive model and multiplicative
models. For an additive model, we assume that the data is the sum of the time-series components,
that is,
1. e I S C T X + + + + =
2. e I S C T X + =
If the data does not contain one of the components, the value for that component is equal to zero.
In an additive model the seasonal or cyclical component is independent of the trend, and thus the
magnitude of the seasonal swing (movement) is constant over the time, as illustrated in Fig. 1(a).

Figure 1(a): additive model-the magnitude of the seasonal swing is constant over time.
Time Series Lecture Notes, 2

Figure 1(b) multiplicative model the magnitude of the seasonal swing is proportional to the
trend.
In a multiplicative model, the data is the product of the various components, that is,
t t t t
e C S T X =
,
If trend, seasonal variation, or cycle is missing, then its value is assumed to be 1. As shown in Fig.
1b, the seasonal (or cyclical) factor of a multiplicative model is proportional (a ratio) to the trend,
and thus the magnitude of the seasonal swing increases or decreases according to the behavior of
the trend.
Although most data that possess seasonal (cyclical) variations cannot be precisely classified as
additive or multiplicative in nature, we usually look at the forecasts obtained using both models and
choose the model that yields the smallest SSE and that seems appropriate for the data in question.
The Seasonal and Cyclical Components
Data that is reported quarterly, monthly, weekly, etc. and that demonstrates a yearly periodic
pattern is said to contain a seasonal component or factor. A seasonal series may be trended or
untrended. It may or may not possess a cyclical component. However, in most cases seasonality is
easier to model than trend or cycle because it has a clearly repetitive 12-month or 4-quarter
pattern. Trend may be linear or curvilinear, cycles can be any length and may repeat at irregular
intervals, but seasonality is usually well defined. In the decomposition method, the seasonal
component is the first component that is modeled in the time series.
Additive Decomposition
The additive decomposition method is appropriate for modeling time-series data containing trend,
seasonal, and error components, if we can assume the following: We have an additive model
(
t t t t
e C S T X + + + = ), the error terms are random, and the seasonal component for any one season
is the same in each year.
Steps in the Decomposition Method

Figure 2 Quarterly sales figures for the years 1985 through 1988

Figure 2 displays quarterly sales figures for the years 1985 through 1988. Clearly, sales of the
company is seasonal. There is a definable drop in sales during the first quarter and a rise to a
peak during the third quarter. There also appears to be an upward trend in the data. We assume
that we have an additive model and use this data to explain and demonstrate the following
steps in the additive decomposition method.
To accomplish this, centered moving averages (two-period moving averages of the initial moving
averages) are computed:
Time Series Lecture Notes, 3
centered moving average (CMA,) = trend + cycle,

Table1 Obtaining the estimates for seasonality and in an additive decomposition model of
construction sales X
t
(1985-1988)
Year Quarter T
t
X
Moving
Ave;
CMA
t t
C T +
t t
e S +
t
S
d
t
1985



1986



1987



1988
1
2
3
4
1
2
3
4
1
2
3
4
1
2
3
4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
416
446.8
461.9
465.7
445.9
471.3
486.6
484.2
449.2
483.2
489.6
484.3
476.5
507
516.3
510.8


447.6
455.08
461.2
467.38
472
472.82
475.8
476.88
483.4
489.35
496.02
502.65




451.34
458.14
464.29
469.69
472.42
474.32
476.56
479.99
486.38
492.68
499.34


10.56
7.56
-18.39
1.61
14.19
9.89
-26.97
6.64
9.61
-2.07
-16.19
7.66
-20.86
4.96
11.11
4.79
-20.86
4.96
11.11
4.79
-20.86
4.96
11.11
4.79
-20.86
4.96
11.11
4.79
436.8
441.84
450.79
460.91
46.79
466.34
475.49
479.41
470.06
478.24
478.49
479.51
497.36
502.04
50519
506.01

As shown in the Table 1,
1. first moving average = 6 . 447 4 / ) 7 . 465 9 . 461 8 . 446 416 ( = + + +
second moving average = 08 . 455 4 / ) 9 . 445 7 . 465 9 . 461 8 . 446 ( = + + +
third moving average = 2 . 461 4 / ) 3 . 471 9 . 445 7 . 465 9 . 461 ( = + + + etc.
Thus,
34 . 451 2 / ) 08 . 455 6 . 447 ( CMA
3
= + =
14 . 458 2 / ) 2 . 461 08 . 455 ( CMA
4
= + =
29 . 464 2 / ) 38 . 467 2 . 461 ( CMA
5
= + =
2. Subtract the ) C T ( CMA
t t t
+ from the data. The difference is equal to
t t
e S +
In the example,
56 . 10 34 . 451 9 . 461 e S
3 3
= = +
56 . 7 14 . 458 7 . 465 e S
4 4
= = +
39 . 18 29 . 464 9 . 445 e S
5 5
= = + etc.
3. Remove the error (
t
e ) component from
t t
e S + by computing the average for each of the
seasons.
That is,
Table 2 Seasonal values of data series is given in the Table 3.1
Quarter1 Quarter1 Quarter1 Quarter1
-18.39
-26.97
-16.19
1.61
6.64
7.66
10.56
14.19
9.61
7.56
9.89
-2.07
-61.55 15.91 34.36 15.38
1
S =-20.52
2
S =5.30
3
S =11.45
4
S =5.13
These are the four estimates for the seasonal components.
4. These averaged seasonal estimates should add up to zero. If they do not, we must adjust
them (normalize them) so that they will be final adjustment (normalization) consists of
subtracting a constant ) L / S (
n
from each estimate.
Using the data from Table 1,
34 . 0 4 / ) 13 . 5 45 . 11 30 . 5 52 . 20 ( ) L / S (
n
= + + + =


the final seasonal estimates are
86 . 20 34 . 0 52 . 20 S
1
= = 96 . 4 34 . 0 30 . 5 S
2
= =
Time Series Lecture Notes, 4
11 . 11 34 . 0 45 . 11 S
3
= = 79 . 4 34 . 0 13 . 5 S
4
= = .
5. Deseasonlize the data by subtracting from it their proper seasonal estimates:
n i i
S x d =
For example,
86 . 436 ) 86 . 20 ( 416 d
1
= =
84 . 441 ) 96 . 4 ( 8 . 446 d
2
= =
79 . 450 ) 11 . 11 ( 9 . 461 d
3
= =
91 . 460 ) 79 . 4 ( 7 . 465 d
4
= =


01 . 506 ) 79 . 4 ( 8 . 510 d
16
= =
6. Perform the proper regression analysis on the deseasonlized data to obtain the appropriate
model for the trend.
The appropriate model for the data in Table 1 is a linear model ( t- test for the slope = 13.42).
The equation to the model the trend is t 267 . 4 436 . 438 T
t
+ =
An estimate or forecast for any time period can be found by adding together the estimates for the
various components. For our example, the forecast for the seventh time period would be
7 7 7 t
C S T X

+ + = ,
T
7
= 438.436 + 4.267 (7) = 468.305 11 . 11 S S
3 7
= =
C
7
= 0 (we are assuming there is no cycle)
t
X

= 468.305 + 11.11 + 0 = 479.415



Figure 3 Graph of actual and estimated values of data in the Table 1.

3.3.2 Forecast and Confidence Intervals
we discussed the methods of forecasting time series data an additive model. The procedure was
to add the appropriate estimates for the various components together. Thus, the forecast
contructing for the first quarter of 1989 should be

17 17 17
S T X

+ =
T
17
= 438.436 + 4.267(17) = 510.975
S
17
= S
1
= -20.86
X
17
= 510.975 + (-20.86) = 490.115
Since the decomposition method is basically intuitive, without any sound statistical theory behind it,
there is no "statistically correct" confidence interval for x
t
. However, there is an intuitive method for
constructing confidence intervals for decomposition forecasts. The method is simply to use the
interval error for the trend model as the measure of the interval error for x
t
. This can be computed
from the results of the regression analysis on the deseasonalized data. Therefore, the confidence
interval for
t
x , is computed as
) factor correction ( S t X

e 2 / t



where
e
S = the standard error of estimate ( MSE ) from the appropriate trend regression analysis,
and where correction factor =

+ +
n
) t (
t
) t t (
n
1
1
2
2
2
p
where t
p
is the pth point.
which is obtained from the results of the regression analysis of the deseasonalized data.
Time Series Lecture Notes, 5
In our example, the trend standard error for the deseasonalized data is equal to 5.864, and the
correction factor for the linear model is equal to 1.129. Thus, an approximate 95 percent confidence
interval for X
17
is
490.115 2.145 x (5.864) x(1.129), or (475.91 to 504.32)
We should stress that this technique yields only an approximate (although fairly accurate)
confidence interval and does not have a sound theoretical basis.

Multiplicative Decomposition
The multiplicative decomposition method (sometimes called the ratio to trend or the ratio to moving
average) is very similar to that of the additive decomposition method. For a multiplicative
decomposition model, we assume the following:
t
X , is a product of the various components,
including error (
t t t t t
e C S T X = ) terms are random and the seasonal factor for any one season is
the same for each year.

Steps in the Decomposition Method
To illustrate the techniques used in the multiplicative decomposition method, we will use U.S.
quarterly retail sales data for the years 1984-1987. As seen in Fig. 4, and the data is in the Table
3, there is a regular seasonal pattern in the series. Pronounced peaks during the fourth quarter
and through during the first quarter of each year are apparent. There also appears to be an upward
trend in the data. Thus, we proceed to isolate these components by applying the following steps
to the data:

Acvual values of U.S retail sales(1984-1987)
2800
3000
3200
3400
3600
3800
4000
4200
4400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Qurter
S
a
l
e
s
(
m
i
l
l
i
o
n
s

o
f

d
o
l
l
a
r
s
)

Figure 4: Actual values are shown in the Table 3 for U.S retail sales (1984-1987)

1. For the actual time series, compute (as in the additive model) a centered moving average of
length L. The moving average and centered moving average for the first three quarters of the retail
sales data (Table 3) are Quarterly data (in millions of dollars) was obtained by summing
monthly data. 100 for computational convenience divided the new series.
Linear regression results a = 3085.017 b = 48.79 t test for slope = 17.97, 979 . 0 r
2
= computed
in the following manner:
first moving average = (2,881 + 3,249 + 3,180 + 3,505)/4 = 3,203.75
second moving average = (3,249 + 3,180 + 3,505 + 3,020)/4 = 3,238.5
third moving average = (3,180 + 3,505 + 3,020 + 3,449)/4 = 3,288.5
etc.
and
CMA
3
= (3,203.75 + 3,238.5)/2 = 3,221.125
CMA
4
= (3,238.5 + 3,288.5)/2 = 3,263.5
CMA
5
= (3,288.55 + 3,361.5) /2 = 3,325 (see Table 3.3)
etc.








Time Series Lecture Notes, 6
Table 3: Obtaining the estimates for seasonality and trend in a multiplicative decomposition model of
retail sales in (1994-1997)
Year Quarter T
t
x
Sales
Moving
Ave;
CMA
t t
C T
t t
e S
t
S
t
d
1985



1986



1987



1988
1
2
3
4
1
2
3
4
1
2
3
4
1
2
3
4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2881
3249
3180
3505
3020
3449
3472
3715
3184
3576
3657
3941
3319
3850
2883
4159


3203.75
3238.75
3288.6
3361.5
3414
3455
3486.75
3533
3589.5
3623.75
3691.75
3748.25
3802.75



3221.125
3263.5
3325
3387.75
3434.5
3470.875
3509.875
3561.25
3606.375
3657.55
3720
2755.5.


0.987232
1.07400
0.908270
1.018079
1.010918
1.070335
0.907154
1.004141
1.014037
1.077511
0.892204
1.019732
0.9037
1.0154
1.0054
1.0754
0.9038
1.0154
1.0054
1.0754
0.9038
1.0154
1.0054
1.0754
0.9038
1.0159
1.0054
1.0754.
3187.73
3199.82
3162.81
3259.2
3341.53
3396.79
3453.23
3454.47
3522.99
3521.87
3637.23
3664.62
3672.37
3791.72
3862.01
3867.34.

2. Divide the CMA, ( C T
t
) into the data. The quotient is equal to
t n
e S :
t t t t t
e C S T X =
t t t t t t t t
e S ) C T ( ) e C S T ( =
In our example
987 . 0 125 . 3221 3180 e S
3 3
= =
074 . 1 5 . 3263 3505 e S
4 4
= =
908 . 0 3325 3020 e S
5 5
= =
etc:

3. Remove the error (
t
e ) component from
t n
e S by computing the average for each of the seasons:
Table 4 Seasonal values of data series is given in the Table 3
Quarter1 Quarter2 Quarter3 Quarter4
0.908
0.907
0.892
1.018
1.004
1.020
0.987
1.011
1.014
1.074
1.070
1.077
2.707 3.042 3.012 3.221
1
S =0.9025
2
S =1.014
3
S =1.004
4
S =1.074
These are the four estimates for the seasonal components.
4. These averaged seasonal estimates should, for a multiplicative model, add up L (the number of
seasons in a year). If they do not, we must normalize them so that they will. The final normalization
consists of multiplying each estimate by the constant ) S ( L
n

. Using the data fin the Table 3,


0015 . 1 ) 074 . 1 004 . 1 014 . 1 9025 . 0 /( 4 ) S ( L
n
= + + + =


The final seasonal estimates are
914 . 0 0015 . 1 902 . 0 S
1
= = 015 . 1 0015 . 1 014 . 1 S
2
= =
005 . 1 0015 . 1 004 . 1 S
3
= = 075 . 1 0015 . 1 074 . 1 S
4
= =
5. Deseasonalize the data by dividing it by the proper seasonal estimates:
t t t
S X d = ,
For example,
d
1
, = 2,881/ 0.904 = 3,186.947
d
2
= 3,249 / 1.015 = 3,200.985
d
3
= 3,180 / 1.005 = 3,164.79
d
4
= 3,505 / 1.075 = 3,260.46
.
.
d
16
= 4,159 / 1.075 = 3,868.84
Time Series Lecture Notes, 7
6. Perform the proper regression analysis on the deseasonalized data to obtain the appropriate
trend model (linear, quadratic, exponential, etc.). The appropriate trend model for the
deseasonalized data in our example is a linear regression model. The F-test for the coefficient of
determination (0.979) and the t-test for the slope are both significant at the 0.05 level (see
Table 3). The equation to model the trend is
T
t
= 3085.017 + 48.79 t
An estimate of forecast for any time period t consists of the product of the individual
component estimates at t:
t t t t t
e C S T X = ,
Thus, the forecast for the data in the Table 3 sales in the fourth quarter of the second year (t
=8) i s
8 8 8 8
C S T X =
T
7
= 3,085.017 + 48.79 x8 = 3475.34, S
8
= S
4
= 1.075
C
8
= I (we are assuming there is no cycle)
X
8
= 3475.34 x 1.075 x 1 = 3735.99

Figure 4: Graph of actual and estimated values of sales in Table 3

Forecasts and Confidence Intervals
The estimates for trend, seasonal variation, and cycle obtained by the multiplicative decomposition
method are used to describe the time series or to forecast future values of the data. As
discussed in an earlier section, the forecast for time t in a multiplicative model is the product of the
individual estimates for time period t.
Using our example as shown in Table 3.3, sales, we can obtain the point estimate for the second
quarter in 1988 by the following method:
18 18 18 18
C S T X =

T
18
= 3085.017 + 48.79 x (18) = 3963.24
S
18
=S
2
=1.015
C
18
= 1 (we are assuming there is no cycle)
X
18
= 4022.69
As in the additive decomposition method, there is no "statistically correct" way to compute a
confidence interval for the point estimate. This method uses the interval error for the trend
component as the measure of the interval error of X
t
. Thus, the formula for the confidence interval
can be written as
) factor correction ( S t x
e 2 / t



where
e
S
= the standard error of estimate ( MSE ) from the appropriate trend regression analysis,
and where
correction factor =

+ +
n
) t (
t
) t t (
n
1
1
2
2
2
p
where
p
t is the pth time point which we concern for
confidence interval, which is obtained from the results of the regression analysis of the deseasonal-
ized data. In our example, the trend standard error for the deseasonalized retail sales is 35.56 and
the correction factor for the 18th time period is 1.129. An approximate 95 percent confidence
interval for
18
x would be
4022.69 2.145(35.56)(1.129), or (3936.57 to 4108.80)
We can be 95 percent confident that the retail sales for the second quarter of 1998 will be
somewhere between 3936.57 and 4108.80 (in thousands).

Time Series Lecture Notes, 8
Test For Seasonality
In the preceding examples, we have confirmed the presence of a seasonal component (before
isolating it) by inspecting the graph of the data and by prior knowledge of the behavior of the series.
There are times, however, when the presence of a significant seasonal component is questionable.
In these instances, something more than a visual inspection of the graph is needed. One such
method is to apply the Kruskal-Wallis one-way analysis of variance test to the outcomes that were
obtained by subtracting or dividing the CMAs into the data. These outcomes supposed to be
contained just the seasonal and error components. If there is no specific seasonal component, the
outcomes should consist of nothing but random error and thus their distribution should be the
same for all seasons. This means that if these outcomes are ranked and the ranks are grouped by
seasons, then the average rank for each season should be statistically equal to the average rank of
any other season.
The Kruskal-Wallis test, a nonparametric test analogous to the parametric one-way analysis of
variance test, will determine whether or not the sums of the rankings (and thus the means) are
different (or the same) between the various groups (seasons).
Table 5: Testing for seasonality: computation of the Kruskal-Wallis
Statistic for the data in the Table 3
T Quarter
t t
e S
Rank Sum of ranks by
quarter
1 2 3 4
3
4
5
6
7
8
9
10
11
12
13
14
3
4
1
2
3
4
1
2
3
4
1
2
0.987232
1.07400
0.908270
1.018079
1.010918
1.070335
0.907154
1.004141
1.014037
1.077511
0.892204
1.019732
4
11
3
8
6
10
2
5
7
12
1
9
3 8 4 11
2 5 6 10
1 9 7 12
6 22 17 33
Hypotheses:
1 S S S S : H
4 3 2 1 0
= = = = (there is no seasonality)
1 S : H
n a
for some seasons (there is a seasonality in the data)
05 . 0 =
This can be accomplished by computing the statistic
) 1 N ( 3
n
R
) 1 N ( N
12
H
i
2
i
+
+
=


where N = the total number of rankings
R
i
= the sum of the rankings in a specific season n
i
= the number of rankings in a specific season.
In the multiplicative decomposition example, four seasonal factors (0.904, 1.015, 1.005, and 1.075)
were first isolated and then used to deseasonalize the data. However, if these four seasonal factors
were statistically equal to 1, these procedures would not be necessary. By ranking the
t t
e S , values
and applying the Kruskal-Wallis test to the sums of the seasonal ranks, the presence of the seasonal
factors can be statistically confirmed. As seen in Table 5 when the ranks for each quarter are
summed and the H statistic is calculated, the computed value (9.67) is greater than the tabled
(critical) value ( 81 . 7
2
= , df = 3). This result would lead us to conclude that there is seasonality in
the retail sales data in the Table 3.

Tabled (critical) value,
2


with df = L - 1: 814 . 7
2
= , df = 3
Computed value:
) 1 N ( 3
n
R
) 1 N ( N
12
H
i
2
i
+
+
=

67 . 9 ) 13 ( 3
3
33
3
17
3
22
3
6
) 13 ( 12
12
H
2 2 2 2
=

+ + + =
Time Series Lecture Notes, 9
Decision rule: 9.67 > 7.841, therefore reject H
o
.
Note, the procedures are the same for testing for seasonality in the additive model-
0 S S S S : H
4 3 2 1 0
= = = = . For further discussion of the Kruskal-Wallis test and other tests for
seasonality.

Advantages and Disadvantages of the Decomposition Method
The main advantages of the decomposition method are the relative simplicity of the procedure (it
can be accomplished with a hand calculator) and the minimal start-up time. The disadvantages
include not having sound statistical theory behind the method, the entire procedure must be
repeated each time a new data point is acquired, and, as in some other time-series techniques, no
outside variables are considered. However, the decomposition method is widely used with much
success and accuracy, especially for short-term forecasting.

Moving Averages Forecasting
If we then eliminate the first data point from this interval and add the fourth one, their moving
average is again a forecast for the fifth period. As the mathematicians would say:
N
x .... x x x
M
1 N t 2 t 1 t t
t
+
+ + + +
=
where
t
M , is a moving average at the point t, x, is a data point in the time series, and N is the
number of data in the period for which the moving average is calculated. Therefore, the forecast for
the future period could be expressed as:
N
x .... x x x
F
1 N t 2 t 1 t t
1 t
+
+
+ + + +
=
If we agree that this is a very easy and elegant way of forecasting the future, we have to say also
that there are quite a few limitations to this forecasting method. In the first place this method
cannot forecast the non-stationary series a well enough. Imagine that we have constantly increasing
numbers in the series. Now, having described the trend, we can use moving averages to construct
an equation that will simulate our upwards or downwards series. This could be, of course, a simple
straight-line equation that would handle the non stationary time series. What has been mentioned
above about every data point consisting of single and double moving averages, could be converted
into an intercept (or parameter a) of our projected straight line. Therefore:
t
a
t t
M M 2 =
where
t
M is a single moving average and
t
M is a double moving average.
To find the parameter b we have to use the following formula:
) M M (
1 N
2
b
t t t

=
We can now say that every data on our time series could be approximated by:
t t 1 t
b a F + =
+

It is very simple to calculate the forecasts of our time series by saying that:
t t m t
mb a F + =
+
Where m is a number of periods ahead, which we are forecasting.
By using the example from Table 6, we can see the mechanics of calculating forecasts. If we
compare single and double moving average forecasts, then graphically they appear as shown in Fig.
5. We can see that double moving average forecasts are following the pattern of the original time
series in a not lively fashion, which is exactly what we wanted to achieve in the case of the non-
stationary series.
Time Series Lecture Notes, 10
Original, Single and Double Moving Average Forecsat
12
13
14
15
16
17
18
19
20
1 3 5 7 9 11 13 15 17 19
Period
V
a
l
u
e

Figure 5 Single and double moving average forecasts

Table 6 Single moving averages and double moving average models
Period Series t
M
t
M
t
a
t
b
t
M Forecast =
t t
b a +
1 12.00
2 13.00
3 11.00 12.00 12
4 14.00 12.67 12.67
5 14.00 13.0012.5613.44 0.44 12.56 13.89
6 13.00 13.6713.1114.22 0.56 13.11 14.78
7 15.00 14.0013.5614.44 0.44 13.56 14.89
8 13.00 13.6713.7813.56
-
0.11 13.78 13.44
9 16.00 14.6714.1115.22 0.56 14.11 15.78
10 17.00 15.3314.5616.11 0.78 14.56 16.89
11 16.00 16.3315.4417.22 0.89 15.44 18.11
12 14.00 15.6715.7815.56
-
0.11 15.78 15.44
13 15.00 15.0015.6714.33
-
0.67 15.67 13.67
14 13.00 14.0014.8913.11
-
0.89 14.89 12.22
15 18.00 15.3314.7815.89 0.56 14.78 16.44
16 17.00 16.0015.1116.89 0.89 15.11 17.78
17 16.00 17.0016.1117.89 0.89 16.11 18.78
18 19.00 17.3316.7817.89 0.56 16.78 18.44
19 16.00 17.0017.1116.89
-
0.11 17.11 16.78
20 15.00 16.6717.0016.33
-
0.33 17.00 16.00







Time Series Lecture Notes, 11

Case Study Question 1
1. (a) Is it possible to apply the decomposition method to Quarterly electricity demand in Sri Lanka
data? If so suggest a methodology.
(b) Using the multiplicative method, generate the forecast for the data as in the Table 7.
Table 7: Quarterly electricity demand in Sri Lanka for the period of 1977/Q1 to 1997/Q4
1977/1 259.1 433.2 537.1 789.9
260.7 429.4 571.5 1993/1 741.6
260.3 423.9 1988/1 602.9 794
260.9 1983/1 436.1 604.2 837.9
1978/1 291.2 455.6 607.4 842.3
290.9 448.5 537.6 1994/1 860.2
289.3 441.2 1989/1 563 895.6
290.6 1984/1 442.7 615.2 896.7
1979/1 326.6 460.4 532.3 912.3
320.6 481.2 620.4 1995/1 979.5
324.9 480.6 1990/1 661.4 975.6
325.9 1985/1 494.5 654.2 957.4
1980/1 344.2 508 618.1 974.5
350.1 522.5 674.6 1996/1 986.7
349.4 525.5 1991/1 667.8 995.8
348.4 1986/1 533.9 694.8 1013.5
1981/1 364.6 557.4 678.9 974.4
381.6 561.1 720.9 1997/1 971.5
379.7 568.9 1992/1 713.6 960.1
376.9 1987/1 557.5 661.6 1042.7
1982/1 399.5 568 742.3 1064.9



Solution: Table 8 for Calculated Trend and Seasonal Values under Multiplicative Model
Year
&Qtr
Observe
r
Demand
Trend
Values
Seasonal
Values
Year
&Qtr
Observer
Demand
Trend
Values
Seasonal
Values
1977/1 259.1 246.7 105.0 537.1 560.5 95.8
260.7 255.6 102.0 571.5 568.7 100.5
260.3 264.4 98.5 1988/1 602.9 576.9 104.5
260.9 273.0 95.6 604.2 585.3 103.2
1978/1 291.2 281.4 103.5 607.4 593.9 102.3
290.9 289.7 100.4 537.6 602.6 89.2
289.3 297.8 97.1 1989/1 563.0 611.5 92.1
290.6 305.9 95.0 615.2 620.5 99.1
1979/1 326.6 313.8 104.1 532.3 629.8 84.5
320.6 321.6 99.7 620.4 639.2 97.1
324.9 329.2 98.7 1990/1 661.4 648.8 101.9
325.9 336.8 96.8 654.2 658.6 99.3
1980/1 344.2 344.3 100.0 618.1 668.6 92.4
350.1 351.7 99.5 674.6 678.9 99.4
349.4 359.0 97.3 1991/1 667.8 689.3 96.9
348.4 366.2 95.1 694.8 700.0 99.3
1981/1 364.6 373.4 97.6 678.9 710.9 95.5
381.6 380.5 100.3 720.9 722.1 99.8
379.7 387.6 98.0 1992/1 713.6 733.5 97.3
376.9 394.6 95.5 661.6 745.2 88.8
1982/1 399.5 401.6 99.5 742.3 757.1 98.0
Time Series Lecture Notes, 12
433.2 408.6 106.0 789.9 769.3 102.7
429.4 415.5 103.3 1993/1 741.6 781.8 94.9
423.9 422.4 100.4 794.0 794.6 99.9
1983/1 436.1 429.3 101.6 837.9 807.7 103.7
455.6 436.2 104.4 842.3 821.1 102.6
448.5 443.1 101.2 1994/1 860.2 834.7 103.0
441.2 450.1 98.0 895.6 848.7 105.5
1984/1 442.7 457.0 96.9 896.7 863.1 103.9
460.4 464.0 99.2 912.3 877.7 103.9
481.2 471.0 102.2 1995/1 979.5 892.7 109.7
480.6 478.1 100.5 975.6 908.1 107.4
1985/1 494.5 485.2 101.9 957.4 923.7 103.6
508.0 492.3 103.2 974.5 939.8 103.7
522.5 499.6 104.6 1996/1 986.7 956.2 103.2
525.5 506.9 103.7 995.8 973.0 102.3
1986/1 533.9 514.2 103.8 1013.5 990.2 102.4
557.4 521.7 106.8 974.4 1007.7 96.7
561.1 529.3 106.0 1997/1 971.5 1025.7 94.7
568.9 536.9 106.0 960.1 1044.0 92.0
1987/1 557.5 544.7 102.4 1042.7 1062.8 98.1
1987/2 568.0 552.5 102.8 1064.9 1082.0 98.4

Actual and trend curve of the electricity demand
in Sri Lanka
0
200
400
600
800
1000
1200
18
1
5
2
2
2
9
3
6
4
3
5
0
5
7
6
4
7
1
7
8
Quarter
d
e
m
a
n
d
(
M
n

w
a
t
t
s
)

Figure 6 Actual and trend values of electricity demand data , 1977-1997

Table 9 Calculated Seasonal Indices for electricity demand data
Year Q1 Q2 Q3 Q4
1977 105 102 98.5 95.6
1978 103.5 100.4 97.1 95
1979 104.1 99.7 98.7 96.8
1980 100 99.5 97.3 95.1
1981 97.6 100.3 98 95.5
1982 99.5 106 103.3 100.3
1983 101.6 104.4 101.2 98
1984 96.9 99.2 102.1 100.5
1985 101.9 103.2 104.6 103.7
1986 103.8 106.8 106 105.9
1987 102.3 102.8 95.8 100.5
1988 104.5 103.2 102.2 89.2
1989 92 99.1 84.5 97
1990 101.9 99.3 92.4 99.3
1991 96.8 99.2 95.4 99.8
1992 97.2 88.7 98 102.6
1993 94.8 99.8 103.6 102.5
1994 102.9 105.4 103.8 103.8
1995 109.6 107.3 103.5 103.6
Time Series Lecture Notes, 13
1996 103.1 102.2 102.2 96.6
1997 04.6 91.8 98 98.3
Total 2113.5 2120.4 2086.2 2079.5
S-Indices 100.6 101 99.3 99

Regression Analysis

The regression equation is
2
t
t 0629 . 0 t 93 . 3 256 T + + =

Predictor Coef StDev T P
Constant 275.86 11.24 24.55 0.000
t 3.9330 0.6101 6.45 0.000
t
2
0.062947 0.006954 9.05 0.000


Act ual values versus forecast values of
elect ricit y demand dat a
200
400
600
800
1000
1200
1 8 15 22 29 36 43 50 57 64 71 78
Quart er
E
l
e
c
t
r
i
c
i
t
y

d
e
m
a
n
d

(
M
n

W
a
t
t
s
)

Figure 7 Actual and estimated values of electricity demand in Sri Lanka
Forecasts
The estimates for trend, seasonal variation, and cycle obtained by the multiplicative decomposition
method are used to describe the time series or to forecast future values of the data. As
discussed in an earlier section, the forecast for time t in a multiplicative model is the product of the
individual estimates for time period t.

Using our example as shown in Table 8 and 9, electricity demand in Sri Lanka, we can obtain the
point estimate for the second quarter in 1998 by the following method:
85 85 85 85
C S T X =

T
85
= 276 + 3.93x(85)+0.0629x(85
2
) = 1064.50
S
85
=S
1
=1.006
C
85
= 1 (we are assuming there is no cycle)
Forecast electricity demand at 1998/Q1 is X
85
= 1070.88
Similarly,
86 86 86 86
C S T X =

T
86
= 276 + 3.93x(86)+0.0629x(86
2
) = 1079.18
S
86
=S
2
=1.01
C
86
= 1 (we are assuming there is no cycle)
Forecast electricity demand at 1998/Q2 is X
85
= 1089.98









Time Series Lecture Notes, 14

Case study Question 2
Table 10, shows monthly empirical data set having seasonality. Use appropriate method to find
adjusted seasonal indices.
(a) Use multiplicative decomposing method to generate forecasts.
(b) Explain interesting features in the analysis.

Table 10 Monthly data series for the period of three years
Month Value Month Value Month Value Month Value
Y
1
/Jan
Feb
March
Apr
May
June
July
Aug
Sep
Oct
Nov
Dec
56
53
61
95
118
153
253
289
240
136
92
92
Y
2
/Jan
Feb
March
Apr
May
June
July
Aug
Sep
Oct
Nov
Dec
59
65
94
147
194
315
422
469
428
222
145
101
Y
3
/Jan
Feb
March
Apr
May
June
July
Aug
Sep
Oct
Nov
Dec
97
112
123
247
327
414
572
624
542
304
154
127
Y
4
/Jan
Feb
March
Apr
May
June
July
Aug
Sep
Oct
Nov
Dec
157
102
202
309
353
560
741
842
689
445
182
187

Emprical monthy(original) data series
0
100
200
300
400
500
600
700
800
900
1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 Month
V
a
l
u
e

Figure8 Original data Series as in the Table 10
Regression Analysis:
The regression equation is t 72 . 7 6 . 75 T
t
+ =

Predictor Coef StDev T P
Constant 75.55 50.14 1.51 0.139
C2 7.725 1.782 4.34 0.000

We have used a time series that has monthly values, and that is four years long. As in the
previous example with the cyclical component, we have found the trend value of the time series.
If we make a graphic presentation of what we have done so far, then it will appear as shown in
Fig. 8.








Time Series Lecture Notes, 15
Table11 Computation of seasonal index, by using the multiplicative decomposition model of
monthly data series in Table 3.10
Month
t
X
T
t
Inde
x
t t
e S
t
S
e
t
Month
t
X
T
t
Index
t t
e S
t
S
e
t
Y
1
/Jan
Feb
March
Apr
May
June
July
Aug
Sep
Oct
Nov
Dec
Y
2
/Jan
Feb
March
Apr
May
June
July
Aug
Sep
Oct
Nov
Dec
55
53
61
95
118
153
253
289
240
136
92
92
59
65
94
147
194
315
422
469
428
222
145
101
83
91
99
106
114
122
130
137
145
153
160
168
176
184
191
199
207
214
222
230
238
245
253
261
66
58
62
89
103
126
195
211
166
89
57
55
34
35
49
74
94
147
190
204
180
90
57
39
45
40
52
82
99
137
187
203
168
93
50
43
45
40
52
82
99
137
187
203
168
93
50
43
1.65
1.49
1.19
1.06
1.03
0.90
1.03
1.02
0.99
0.98
1.12
1.33
0.84
0.91
0.95
0.88
0.94
1.06
1.01
0.99
1.08
0.99
1.12
0.94
Y
3
Jan
Feb
March
Apr
May
June
July
Aug
Sep
Oct
Nov
Dec
Y
4
/Jan
Feb
March
Apr
May
June
July
Aug
Sep
Oct
Nov
Dec
97
112
123
247
327
414
572
624
542
304
154
127
157
102
202
309
353
560
741
842
689
445
182
187
268
276
284
292
299
307
315
323
330
338
346
353
361
369
377
384
392
400
407
415
423
431
438
446
36
41
43
85
109
135
182
193
164
90
45
36
43
28
54
80
90
140
182
203
163
103
42
42
45
40
52
82
99
137
187
203
168
93
50
43
45
40
52
82
99
137
187
203
168
93
50
43
0.90
1.04
0.83
1.01
1.09
0.97
0.96
0.94
0.98
0.99
0.87
0.88
1.09
0.71
1.03
0.96
0.90
1.01
0.96
0.98
0.98
1.14
0.81
1.02

Table 12 Seasonal Indices of data in table 11
Month Year1 Year2 Year3 Year4
Adjusted monthly
indices
Jan 66 34 36 43 45
Feb 58 35 41 28 40
Mar 62 49 43 54 52
Apr 89 74 85 80 82
May 103 94 109 90 99
June 126 147 135 140 137
July 195 190 182 182 187
Aug 211 204 193 203 203
Sep 166 180 164 163 168
Oct 89 90 90 103 93
Nov 57 57 45 42 50
Dec 55 39 36 42 43
Sum 1200

Time Series Lecture Notes, 16
Detrended data series as shown in Table 10
0
50
100
150
200
250
1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46
Month
V
a
l
u
e
s

Figure 9 Detrended values of data in the Table 10

Deseasonalised data series of data in Table 10
0
100
200
300
400
500
600
1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46
Month
V
a
l
u
e

Figure10 Deseasonalised values of data in the Table 10
Residual Series of data in the Table 10
0
50
100
150
200
1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46
Month
V
a
l
u
e

Figure11 Residuals(or Irregularaties) of data in the Table 10
Seasonal Indices of the data in the Table 9
0
50
100
150
200
250
1 2 3 4 5 6 7 8 9 10 11 12
Month
S
e
a
s
o
n
a
l

I
n
d
e
x

Figure12 Monthly Indices of data in the Table 10
For the sake of this exercise, if we now divide each actual value with a responding typical seasonal
index value (see Table 10), we can how the time series would look if there were no seasonal
influences at all. 1t is now just a deseasonalized value with some irregular components present it
(Fig. 10). If we eliminate the irregular component by dividing the deasonalized values of the series
with the trend, what we are left with is a measure of other influences or an index of irregular
fluctuations (see Table 10). Each value is telling us how much a particular month is affected to the
other influences, and not only seasonal fluctuations. Graphically it appears as shown in Fig. 11.
The adjusted seasonal indices as in the Table 12 with the future linear trend values are used to
Time Series Lecture Notes, 17
estimate forecast for next year. This recomposed series, which represents our forecast, is
presented in the form of a graph (Fig. 13).
Actual and Forecasted values of data in the Table .9
0
200
400
600
800
1000
1 5 9 13 17 21 25 29 33 37 41 45 49 53 57
Month
v
a
l
u
e
s

Figure 13 Actual and forecasted values of the data in the Table 10
Obviously, there are several ways of doing what we have just described. This might automatically
imply that the method of classical decomposition is not particularly accurate. Fortunately, this is not
true. It is a fairly accurate method, but the problem with it is that it is very arbitrary, as the results
can vary depending on who is doing the forecasting. From the classical decomposition method were
developed several new modifications during the 1960s and 1970s, note that they are just
modernized and computerized versions of the good old classical decomposition method.

Exercises
1. Consider the time series data in Table 13.Sales of a particular company, for the period of 1976-
1979 (tons)
Year Q1 Q2 Q3 Q4
1976 672 636 680 704
1977 744 700 756 784
1978 828 800 840 880
1979 936 860 944 972
Table 13.Sales of a particular company
(a) Draw a graph of x(t) against t and comment upon whether or data appears stationary.
(b) Calculate a single and double moving average forecast of length 3 superimpose both forecasts
on to your graph.
(c) Calculate the forecast for quarter 1, 1980 using the double moving and compare this result with
your result from decomposition method.

2.
Year Q1 Q2 Q3 Q4
1976 320 185 215 395
1977 345 200 230 420
1978 365 210 240 440
Table 14 Sales of heating oil.
(a) Draw a graph of x(t) against t and comment upon whether or not the data is stationary.
(b) Superimpose on to the above graph a moving average forecast of suitable length. Give reasons
for your model choice.
(c) Use this moving average to provide a forecast for the first quarter of year 4.

3. Table 15 gives the index of average earnings of insurance, banking and finance employees
(base: 1976 = 100).

Year March June Sep: Dec:
1979 134 142 154
170
1980 190 214 242
274
1981 310 350 394
442
1982 494 550 610
Time Series Lecture Notes, 18
674
1983 742 814 890
970
1983 1054 1142 1234
1330

(a) Draw a graph of x(t) against t and superimpose on the graph moving averages of length 3 in
order to show the general trend.
(b) Provide an index forecast for the four quarters of 1984.
4.
Year Q1 Q2 Q3 Q4
1985 9.8 11.5 13.0 10.9
1986 11.0 12.1 12.9 11.9
1987 11.1 13.6 14.4 12.6
Table 16: Number of cans (in 100000s) of lager sold manufacturer in each quarter of three
successive years.
(a) Draw a graph of x(t) against t and comment upon whether or not the data is stationary.
(b) Superimpose onto the above graph a moving average forecast of suitable length. Give reasons
for your model choice.
(c) Use this moving average to provide a forecast for the first quarter of 1988.



5. Table 17 shows the number of cans (in 100000s) of lager sold by a manufacturer in each quarter
of three successive years.
Table 16
Year Q1 Q2 Q3 Q4
1985 9.8 11.5 13.0
10.9
1986 11.0 12.1 12.9
11.9
1987 11.1 13.6 14.4
12.6

(a) Draw a graph of x(t) against t.
(b) Compute the trend equation using linear regression analysis.
(c) What are the differences between an `additive' and `multiplicative models when calculating the
seasonal components?
(d) Estimate the number of cans sold in each quarter of 1988 using both the multiplicative (A= T x
S) and `additive' (A = T + S) models.

6. Use the data in the table 3.14, relate to the sales of heating oil.
(a) Draw a graph of x(t) against t.
(b) Compute the trend equation using linear regression analysis.
(c) Use the Multiplicative model, A = T x S, to provide a forecast for the first quarter of year 4.
7. Table 18 below gives the index of average earnings (GB) of insurance, banking and finance
employees (base: 1976 = 100).
Table 18
Year Q1 Q2 Q3
Q4
1 141.8 138.3 150.8
169.8
2 183.9 199.3 182.9
204.1
3 212.9 213.3 206.4
230.5
4 242.8
(a) Draw a graph of x(t) against t. `
(b) Compute the trend equation using linear regression analysis.
(c) Provide an index forecast for Q2, Q3 and Q4 in the year 4. Give reasons for your model
choice.

Potrebbero piacerti anche