You are on page 1of 21

Lesson 21

Time series Analysis

21.1 Introduction

Forecasting or predicting is an essential tool in any decision making process. Its uses vary
from determining inventory requirements for a local shoe store to estimating the annual
sales of high-tech computers. The quality of the forecasts management can make is
strongly related to the information that can be extracted and used from past data. Time
series analysis is one quantitative method we can use to determine patterns in data
collected over time. Table 21.1 presents an example of time series data.

Time series data: A time is a set of observation taken at specific times, usually at
equal intervals. Mathematically, a time series is defined by the values
Y1 , Y2 ,... of a variable Y at times t1 , t 2 ,... .

Example 21.1
Consider the data in Table 21.1 where the quarterly S&P 500 indices from 1900 to 1995
are presented in order of time. This is a proper example of a time series data. The change
and variation pattern of the data over the period and making future forecast from the
observed pattern are of simultaneous interest and studying these characteristics of the
data is termed as time series analysis. The example considers a data for a substantially
long period and this is often a requirement for valid future prediction. For simplicity of
the analysis, the quarter January 1900 can be coded as quarter 1 (or t = 1 ) and the
corresponding index value is read as Y1 , the quarter April 1900 can be coded as quarter
2 (or t = 2 ) and the corresponding index value is read as Y2 , … and so on up to the
index Y380 corresponding to the quarter October 1995. The data is given in Table A21.1.
A line diagram of the data in Table 21.1 is presented in Figure 21.1, where the fluctuation
of the S&P 500 index over the study period 1900-1995 is pronounced.

Figure 21.1: The line diagram of quarterly S&P 500 index from 1900-1995

21.1.1 The uses and utilities of Time series analysis

The analysis of time series can be helpful in economist, business people, the scientist,
social researchers and many other groups of people. The following utilities are rendered
very important:

 It helps understand the past behaviour of any physical phenomenon .


 It helps in planning the future and policy making
 It helps evaluating current achievement or accomplishment
 It helps researchers to compare change behaviour in different data.
21.2 Variations in time series

We use the term time series to refer to any group of statistical information accumulated at
regular intervals. There are four kinds of change or variation involved in time series
analysis, or in other words we can say there are four components of time series data:
 Secular trend: The smooth gradual direction of increase or decrease behavior
over long time.
 Cyclical fluctuation: The fluctuation or rise and fall of a time series over long
period of time.
 Seasonal variation: The fluctuation or ups and down over small interval of time,
usually over every year.
 Irregular variation: The random behavior of un-patterned fluctuations.

Figure 21.2, shows different variations in time series. We can see in Figure 21.2 that the
general movement persisting over the range time represented by a straight line (c). This
variation is the secular trend in the time series. A pronounced fluctuation moving up and
down every few years is also observed, this is the cyclical variation and it is represented
by (b) in Figure 21.1. Moreover if we look closely year by year, we can see the original
time series has a variation within every year, and this is known as the seasonal
fluctuation. Finally the saw-tooth irregularities in the curve of original data is the
irregular random variations.

Figure 21.2: Different types of variation of time series.


21.2.1 Time series models:

Let us denote the four components secular trend, cyclical fluctuation, seasonal variation
and the irregular variation by T , C , S and I . In traditional or classical time series
analysis it is ordinarily assumed that any particular value of the time series is the product
of these four components, i.e., Y = T × S × C × I . This is called the multiplicative model.
The other traditional time series models include
 Additive model Y = T + S + C + I
 Mixed model Y = T × S × C + I
 Mixed model Y = T × C + S + I .

Example 21.2
From the quarterly S&P 500 index from 1900-1995, show the different components of
time series.

Solution:
The S&P 500 index from 1900-1995 are presented in Figure 21.3 and the different
components of time series.
Again for Figure 21.3, the general movement persisting over the range time or the secular
trend is represented by a straight line (c). The cyclical variation is represented by (b) in
Figure 21.3, and the seasonal variation observed year by year is shown for one year in a
boa. Finally one instance of the irregular random variations is highlighted in another box.
Figure 21.3: Different types of variation for quarterly S&P 500 index from 1900-1995
21.3 The secular trend
Of the four components of a time series, secular trend represents the long term direction
of the series. One way to describe it is to fit a line visually to a set of points on a graph.
Any given graph, however, is subject to slightly different interpretations by different
individuals.

21.3.1 Reasons for studying Trends


The following three are the main reasons for studying trends:
 The historical pattern of the data can be described by studying trends.
 The future patterns of the data can be projected using the past pattern
 The trend, in many situations can be eliminated to check the trend free time series
for other components.

21.3.2 Types of trends


Trends can be linear or curvilinear. The method of linear trends, or the straight line
method is usually used for describing time series, but it might not be appropriate because
some of the time series data could have other types of trend. For example, pollution in
environment or yearly sales of an industrial product do not follow straight line pattern of
trend. The rough pictures of the trend for the examples are given in Figure 21.4.

Figure 21.4: Trends of pollution in environment and


yearly sales of an industrial product

21.3.3 Fitting the linear trend


and Least squared Estimates
The long term trend of many business series, such as sales, exports and production often
approximates a straight line. If so, the equation to describe the growth is given by the
following linear trend equation as
Yt ' = a + bt ,

where Yt is the projected value of the variable Y for a selected value of t ,


'

a is the Y intercept. It is estimated value of Y when t = 0 . Another way of interpreting


is that a is the estimated value of Y where the line crosses the Y axis, b is the slope of

the line, or an average change in Yt ' for each one unit change in t , and t is any value
of time that is selected.
The concept associated with fitting the linear trend or the linear trend equation is quite
the same as the simple linear regression with the independent variable being considered is
the time. Now using the well known results of simple linear regression, we can find the
Least squared estimators a and b using sample data on time series Y and time t as

∑ty − n (∑t )(∑ y )


1

and a = ∑ − b ∑
b= y t

∑t − n ( ∑t ) 
 2 1 2
n n
 
Example 21.3

The sales of Jenson foods, a small grocery chain, since 1997 are given in Table 21.1.
Determine the least squares trend-line equation.
Year 1997 1998 1999 2000 2001
Sales ($ million) 7 10 9 11 13
Table 21.1: Sales ($ million) of Jenson foods, since 1997
Solution:

To simplify the calculations, the years are replaced by coded values. That is, we let 1997
be 1, 1998 be 2 and so forth. Computations needed for determining the trend equation is
given in Table 21.2.
Sales
Year ($ million) t tY t2
Y
1997 7 1 7 1
1998 10 2 20 4
1999 9 3 27 9
2000 11 4 44 16
2001 13 5 65 25
50 15 163 55
Table 21.2: Computations needed for determining the
trend equation for sales data of Jenson foods

Now the linear trend equation is


Yt ' = a + bt ,

where b and a are calculated using the necessary calculations done in Table 21.3.
We now have

∑ty − n ( ∑t )( ∑ y )
1 1
(15 )( 50 )
163 − a=
∑y −b ∑t
b= = n = 1.3 and n n

∑t − n ( ∑t ) 
 1 2  1 2
55 − n (15 ) 
2 50 15
= −1.3( ) = 6.1
    5 5
The trend equation, therefore, is given by

Yt ' = a + bt = 6.1 +1.3 t

where, sales are in millions of dollars. The origin, or year 0, is 1996 and t increases by
one unit for each year. The value of 1.3 indicates sales increased at a rate of $1.3 million
per year. The value 6.1 is the estimated sales when t = 0 . That is, the estimated sales
amount for 1996 (base year) is $6.1 million. The fitted trend line is shown in the
following Figure 21.5.

Figure 21.5: The original sales and the trend line.

Example 21.4

Use the data on S&P indices for fitting the least square estimation of the trend.
Solution:

From the data on time series available in Example 21.1, a least square estimation method
can be used. The intercept and regression co-efficient are to be obtained. We used SPSS
software for computing the estimated regression parameters. The values obtained are
a = 1.10259712304 and b =-0.0001738063029993.
The fitted linear equation revealed by these values is
Yt ' = 1.10259712 304 - 0.00017380 63029993 t .

The fitted trend is shown in Figure 21.5.

Figure 21.6: The fitted linear trend along with the


original series of quarterly S&P 500 index 1995

21.3.4 Future projection using least squared estimates

If the time series data is fitted to a linear trend using least squared estimation method, the
future value of the variable Y can be projected by putting the desired value of t in the
fitted linear equation.
Example 21.5

Refer to the sales data in example 21.2. the year 1997 is coded 1 and 1998 is coded 2.
what is the sales forecast for 2004?
Solution:
The year 1999 is coded 3, 2000 is coded 4, 2001 is coded 5, 2002 is coded 6.2003 is
coded 7 and 2004 is logically coded 8. The linear trend equation for the problem is:

Yt ' = 6.1 +1.3t

Thus for the year 2004, substituting t = 8 in the equation we get


Yt ' = 6.1 +1.3t
=6.1 +1.3 ×8 =16 .5 ,

thus, based on past sales, the estimated sale for 2004 is $16.5 million.

14.3.5 Method of moving average


The method of moving average (MA) is useful in smoothing a time series so that the
trend of the series becomes more visible. The moving average method is also the base for
measuring seasonal variations. The arithmetic mean of successive data points are moved
to construct the moving average. A k -point MA is obtained by constructing the variable
which is represented by the average of k successive observations. Let Y1 , Y2 ,..., Yn
m1
be a time series data. A k -point MA, Y is obtained by using the following relations:
Y1 + Y2 + ... + Yk
Y1m1 = ,
k
Y2 + Y3 + ... + Yk +1
Y2m1 = ,
k

Yn −k + Yn −k +1 + ... + Yn
Ynm−1k =
k

The MA averages out the cyclical and irregular variation, however, caution should be
taken in using MA since if the data do not follow fairly linear trend or do not have a
definite rhythm, the computation of the MA would not be appropriate.

Example 21.6
For the sales data from 1976 to 2001, compute a seven year moving average and plot the
moving average along with the original time series.

Solution:
We construct the Table 21.3 to compute the moving average.
Sales Seven year Seven year
Year Time ($million) moving total moving Average
1976 1 1
1977 2 2
1978 3 3
1979 4 4 22 3.142857143
1980 5 5 23 3.285714286
1981 6 4 24 3.428571429
1982 7 3 25 3.571428571
1983 8 2 26 3.714285714
1984 9 3 27 3.857142857
1985 10 4 28 4
1986 11 5 29 4.142857143
1987 12 6 30 4.285714286
1988 13 5 31 4.428571429
1989 14 4 32 4.571428571
1990 15 3 33 4.714285714
1991 16 4 34 4.857142857
1992 17 5 35 5
1993 18 6 36 5.142857143
1994 19 7 37 5.285714286
1995 20 6 38 5.428571429
1996 21 5 39 5.571428571
1997 22 4 40 5.714285714
1998 23 5 41 5.857142857
1999 24 6
2000 25 7
2001 26 8
Table 21.3: Seven years moving average of the sales data

Figure 21.7: The Seven years moving average along with


the original series of sales data from 1976 to 2001
Example 21.7
From the data on time series available in Example 21.1, find a 25-pt MA and plot the MA
data along with the original series

Solution:
From the data on time series available in Example 21.1, a 25-pt MA is obtained and
presented in Table A21.5. The line diagram of the 25-pt MA is also presented along with
the original series in Figure 21.8.

Figure 21.8: The 25 pt moving average along with


the original series of of quarterly S&P 500 index 1995

21.3.6 Nonlinear Trend

A linear trend equation is used to represent the time series when it is believed that the
data are increasing (or decreasing) by equal amounts, on the average, from one period to
another. If the data increase (or decrease) by equal percents or proportions over a period
of time, a curvilinear trend will appear.
The trend equation for a time series that does approximate a curvilinear trend, may be
computed by using the logarithms of the data and the least squares method. The general
equation for the logarithmic trend equation is:

log Y ′ =log a + log b(t )


Example 21.8

Fit the general equation for the logarithmic trend equation using the sales data from 1997
to 2003 given in Example 21.5.
Year Sales
($ million)
1997 2.13
1998 0.35
1999 39.8
2000 257
2001 211
2002 290
2003 981
Table 21.4: Sales ($ million) since 1997

Solution:

An Excel run provides the following outputs


Intercept= -0.4129, Slope= 0.519676
Now we can write log a = -0.4129 and log b = 0.519676 ,
i.e. a = 0.3865 and b = 0.3088 ,
hence the non-linear equation of trend becomes
log Y ′ =log 0.3865 + log 0.3088 (t ) .
Whereas the fitted linear (secular) trend is found to be
Y ' = −272 .2614 +131 .6825 t .
The fitted linear and non-linear trends are calculated in Table 21.7 and they are plotted
along with the original data in Figure 21.9.
Sales Log of Fitted linear Fitted non-
Coded sales trend linear trend
Time
1 2.13 0.32838 -140.579 1.278716
2 0.35 -0.45593 -8.89643 4.231067
3 39.8 1.59988 122.7861 13.99993
3
4 257 2.40993 254.4686 46.32356
3
5 211 2.32428 386.1511 153.2773
2
6 290 2.46239 517.8336 507.1704
8
7 981 2.99166 649.5161 1678.146
9
Table 21.5: Fitted linear and nonlinear trend

Figure 21.9: Fitted linear and nonlinear trend

21.4 Determining Seasonal Index

Several methods have been developed to measure the typical seasonal fluctuation in a
time series. The method most commonly used to compute the typical seasonal pattern is
called the ratio-to-moving average method. It eliminates the trend, cyclical and irregular
components from the original data.

21.4.1 The steps followed in the ratio-to-moving average method


Step 1: The first step is to determine the four-quarter moving total for the first
year. This total is shown in the second column of the table and placed between the middle
of second and third quarter. The four-quarter total is moved along by adding the second,
third, forth and first quarter of the next year. This shown again in the second column and
placed between the middle of the third and fourth column of the first year. This procedure
is continued for the quarterly sales for each of the remaining years.
Step 2: Each quarterly moving total in the second column is divided by 4 to give
the four quarter moving average and placed in third column. All the moving averages are
still positioned between the quarters.
Step 3: The moving averages are then centered and placed in column 4. The
centered moving averages are positioned on particular quarters.

Step 4: The specific seasonal for each quarter is then computed by dividing the
elements in column 1 by the centered moving average in column 4. The specific seasonal
reports the ratio of the original time series value to the moving average.
Step 5: The specific seasonals are organized in a table. This table will help us
locate the specific seasonals for the corresponding quarters. This is averaged for specific
quarter over the years for which specific seasonals are obtained. Th resulting quantity is
known as a seasonal index.
Step 6: The four quarterly means should theoretically total 4.00 because the
average is set at 1.0. The total of the four quarterly means may not exactly equal 4.00 due
to rounding. A correction factor is therefore applied to each of the four means to force
them to total 4.00.
4.00
Correction factor =
Total of four means

Example 21.9

Table 21.7 shows the quarterly sales for Toys International for the years 1996 through
2001. The sales are reported in millions of dollars. Determine a quarterly seasonal index
using the ratio-to-moving average method.

Year Winter Spring Summer Fall


1996 6.7 4.6 10.0 12.7
1997 6.5 4.6 9.8 13.6
1998 6.9 5.0 10.4 14.1
1999 7.0 5.5 10.8 15.0
2000 7.1 5.7 11.1 14.5
2001 8.0 6.2 11.4 14.9
Table 21.6: Quarterly Sales of Toys International ($ millions)
Solution:

The necessary computation for the ratio-to-moving average method is shown in Table
21.8. From Table 21.8, we make the following summary Table (Table 21.10) that gives
the calculation of the seasonal indices.

Sales Four-Quarter Four-Quarter Centered Specific


Year Quarter ($ million) total MA MA Seasonal
1996 Winter 6.7

Spring 4.6
34.0 8.5
Summer 10.0 8.475 1.18
33.8 8.45
Fall 12.7 8.45 1.503
33.8 8.45
1997 Winter 6.5 8.425 0.772
33.6 8.4
Spring 4.6 8.513 0.54
34.5 8.625
Summer 9.8 8.675 1.13
34.9 8.725
Fall 13.6 8.775 1.55
35.3 8.825
1998 Winter 6.9 8.9 0.775
35.9 8.975
Spring 5.0 9.038 0.553
36.4 9.1
Summer 10.4 9.113 1.141
36.5 9.125
Fall 14.1 9.188 1.535
37.0 9.25
1999 Winter 7.0 9.3 0.753
37.4 9.35
Spring 5.5 9.463 0.581
38.3 9.575
Summer 10.8 9.588 1.126
38.4 9.6
Fall 15.0 9.625 1.558
38.6 9.65
2000 Winter 7.1 9.688 0.733
38.9 9.725
Spring 5.7 9.663 0.590
38.4 9.6
Summer 11.1 9.713 1.143
39.3 9.825
Fall 14.5 9.888 1.466
39.8 9.95

2001 Winter 8.0 9.888 0.801


40.1 10.025
Spring 6.2 10.075 0.615
40.5 10.125
Summer 11.4

Fall 14.9
Table 21.7: The computation for the ratio-to-moving average method

Quarter 1996 1997 1998 1999 2000 2001 Total Mean Seasonal
index
Winter 0.77 0.775
0.75 0.73 0.801 3.83 0.766 0.765079
2 3 3 4 8
Spring 0.540.553 0.58 0.59 0.615 2.87 0.575 0.574507
1 9 8
Summer 1.18 1.13 1.141 1.12 1.14 5.72 1.144 1.141432
6 3
Fall 1.50 1.55 1.535 1.55 1.46 7.61 1.522 1.518982
3 8 6 2 4
Table 21.8: The Seasonal index with the necessary computation for Sales of Toys Int.

21.4.2 Deseasonalizing data

A set of typical indices can be used for adjusting the seasonal fluctuation in a time series.
Once the seasonal fluctuation is eliminated from a time series the resulting series is called
a deseasonalized series or seasonally adjusted time series. The other component of time
series can be advantageously studied from a deseasonalized time series. The original
value of the time series at each quarter (or month, week etc.) is divided by the
corresponding seasonal index to obtain the deseasonalized time series. Mathematically,

Original value T ×C × S × I
Deseasonal ized value = = = T ×C × S
Seasonal index S
Example 21.10
Consider the sales for Toys International for the years 1996 through 2001 reported in
millions of dollars given in Example 21.8. Determine the deseasonalized sales.
Solution:
The calculation of the deseasonalization is shown in Table 21.10 and the graph of the
deseasonalized data along with the original data are shown in Figure 21.10.

Figure 21.10: The deseasonalized data for Sales of Toys Int.

Year Origi- Seas- De- 0


nal onal season- Spring 5.7 0.57 9.92
time index alized
series series Summer 11.1 1.14 9.72
199 Winter 6.7 0.77 8.76 Fall 14.5 1.52 9.55
6 200 Winter 8 0.77 10.46
Spring 4.6 0.57 8.01 1
Summer 10 1.14 8.76 Spring 6.2 0.57 10.79
Fall 12.7 1.52 8.36 Summer 11.4 1.14 9.99
199 Winter 6.5 0.77 8.50 Fall 14.9 1.52 9.81
7
Spring 4.6 0.57 8.01
Summer 9.8 1.14 8.59
Fall 13.6 1.52 8.95
199 Winter 6.9 0.77 9.02
8
Spring 5 0.57 8.70
Summer 10.4 1.14 9.11
Fall 14.1 1.52 9.28

Year Origi- Seas- De-


nal onal season-
time index alized
series series
199 Winter 7 0.77 9.15
9
Spring 5.5 0.57 9.57
Summer 10.8 1.14 9.46
Fall 15 1.52 9.88
200 Winter 7.1 0.77 9.28
Table 21.9: The deseasonalized data for Sales of Toys Int.

Example 21.11
Consider the S&P indices for years 1900 through 1995 given in Example 21.1. Determine
the seasonal indices and plot the deseasonalized series.

Solution:
The seasonal indices are presented in Table 21.12, and the plot of the de-seasonalized
series along with the original series is given in Figure 21.11.

Total Mean Seasonal


Quarter Specific Specific index
seasonal seasonal
January 95.3531 1.00371 1.006284
3 7
April 95.1174 1.00123 1.003796
4 6
July 94.7398 0.99726 0.999811
1
October 93.8204 0.98758 0.990109
9 4
Table 21.10: The Seasonal index S&P indices.

Figure 21.11: The deseasonalized data for S&P indices

21.4.3 Using de-seasonalized data for future projection

The de-seasonalized time series can be used to forecast future values of the time series in
a more efficient manner. The use of de-seasonalized data for determining trend would
give much realistic trend values for future period and this forecasted trend can be
adjusted for seasonality using the seasonal effects. The procedure of forecasting future
values of a time series using deseasonalized data can be summarized in the following
steps:
Step 1: Using the deseasonalized data, a least square method is used to determine the
trend. As usual it is done by fitting a trend equation. In case of consideration of linear

trend the values of a and b in the equation Yt ' = a + bt are required to be determined.

Step 2: Using the linear trend equation the value of the time series for any future point of
time can be projected.
Step 3: Finally, the values for the future time points forecasted in step 2 are multiplied by
the corresponding seasonal indices to make the final forecasting.

Example 21.12

Consider the sales for Toys International for the years 1996 through 2001 reported in
millions of dollars given in Example 21.8. Forecast the sales for the four quarters of 2002
using deseasonalized sales.

Solution:
The calculation of the deseasonalization as shown in Table 21.10 are presented in table
21.12.
Year Season t De-season-
alized Year Season De-season-
series alized
1996 Winter 1 8.01 t series
Spring 2 8.76 1999 Winter 13 9.15
Summer 3 8.36 Spring 14 9.57
Fall 4 8.50 Summer 15 9.46
1997 Winter 5 8.01 Fall 16 9.88
Spring 6 8.59 2000 Winter 17 9.28
Summer 7 8.95 Spring 18 9.92
Fall 8 9.02 Summer 19 9.72
1998 Winter 9 8.70 Fall 20 9.55
Spring 10 9.11 2001 Winter 21 10.46
Summer 11 9.28 Spring 22 10.79
Fall 12 8.01 Summer 23 9.99
Fall 24 9.81
Table 21.11: The deseasonalized data for Sales of Toys Int.

The use of least square method yields the following values of a and b

∑ty − n ( ∑t )( ∑ y )
1
b= = 0.089894 and a = ∑ y − b ∑t =8.110496
∑t − n ( ∑t ) 
 2 1 2
n n
 
The value of t for quarters winter, spring, summer and fall of year 2002 are coded as 25,
26, 27 and 28 respectively. The linear trend equation for the problem is:
Yt ' =8.110496 + 0.089894 × t .

Thus for the winter quarter of year 2002, substituting t = 25 in the equation we get
Y25' =8.110496 + 0.089894 × 25 = 10.35785

From Table 21.10, we have the seasonal index for winter quarter is 0.765079, thus the
forecasted value adjusted for seasonality is given by
Y25 =10.35785 ×0.765079 = 7.924581 .
Table 21.13 and Figure 21.12 give the forecasted sales for the four quarters of 2002 using
deseasonalized sales. For an assessment of how good the forecasted sales match the
original data, the forecasted sales are plotted along with the original data in Figure 21.13.
Quarter Fitted trend Seasonal index Final forecast
( Yt ' =8.110496 (Fitted trend ×
+ 0.089894 × t ) Seasonal index)

Winter 2005 10.35785 0.76508 7.924581


Spring 2005 10.44774 0.57451 6.002331
Summer 2005 10.53763 1.14143 12.02797
Fall 2005 10.62753 1.51898 16.143
Table 21.12: Forecasted sales for the four quarters of
2002 using deseasonalized data of Toys Int.
Figure 21.12: Forecasted sales for the four quarters of 2002

Figure 21.13: Forecasted sales for the four quarters


of 2002 along with the original data

You might also like