Time Series
Short Description
Download Time Series...
Description
Lesson 21
Time series Analysis
21.1 21.1
Introd Introduct uctio ion n
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. da ta. Time series analysis is one quantitative method we can use to determine patterns in data
collected over time. Table 21.1 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 Y 1
, Y 2 ,...
of a variable Y at times
t 1 , 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
Y 1
, the quarter April 1900 can be coded as quarter
2 (or t = 2 ) and the corresponding index value is read as index
Y 380
Y 2
, … and so on up to the
corresponding to the quarter October 1995. The data is given in Table A21.1.
A line diagram of the d data ata 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 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
Y t ' = a + bt ,
where
Y t
'
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
Y t
'
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 1
b=
∑ty − n (∑t )(∑y )
and a =
1 2 2 − ( ) t t ∑ ∑ n
∑y − b ∑t 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 b y 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. Year
Sales ($ million)
t
tY
t 2
1 2 3 4 5 15
7 20 27 44 65 163
1 4 9 16 25 55
Y 1997 1998 1999 2000 2001
7 10 9 11 13 50
Table 21.2: Computations needed for determining the
trend equation for sales data of Jenson foods Now the linear trend equation is Y t ' = a + bt ,
where b and a are calculated using the necessary calculations done in Table 21.3. We now have 1
b=
∑ty − n ( ∑t )( ∑y ) 1 2 t 2 − ( ∑t ) ∑ n
163 −
=
1
(15 )( 50 )
n 1
2 55 − (15 ) n
= 1.3 and
a =
∑y n
−b
∑t n
50 15 = −1.3( ) = 6.1 5 5
The trend equation, therefore, is given by Y t ' = 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 Y t ' = 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: Y t ' = 6.1 +1.3t
Thus for the year 2004, substituting t = 8 in the equation we get Y t ' = 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 be a time series data. A k -point MA, m1
Y 1
Y
=
Y 2m1 =
m1
Y 1
, Y 2 ,..., Y n
is obtained by using the following relations:
Y 1 +Y 2 +... +Y k k
,
Y 2 +Y 3 +... +Y k +1 k
,
… Y nm−1k =
Y n −k + Y n −k +1 + ... + Y n 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 ($million) 1 2 3 4 5 4 3 2 3 4 5 6 5 4 3 4 5 6 7 6 5 4 5 6 7 8
Seven year moving total
Seven year moving Average
Year Time 1976 1 1977 2 1978 3 1979 4 22 3.142857143 1980 5 23 3.285714286 1981 6 24 3.428571429 1982 7 25 3.571428571 1983 8 26 3.714285714 1984 9 27 3.857142857 1985 10 28 4 1986 11 29 4.142857143 1987 12 30 4.285714286 1988 13 31 4.428571429 1989 14 32 4.571428571 1990 15 33 4.714285714 1991 16 34 4.857142857 1992 17 35 5 1993 18 36 5.142857143 1994 19 37 5.285714286 1995 20 38 5.428571429 1996 21 39 5.571428571 1997 22 40 5.714285714 1998 23 41 5.857142857 1999 24 2000 25 2001 26 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 b e 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 Coded Time 1 2 3
2.13 0.35 39.8
4
257
5
211
Log of Fitted linear sales trend 0.32838 -0.45593 1.59988 3 2.40993 3 2.32428 2
Fitted nonlinear trend
-140.579 -8.89643 122.7861
1.278716 4.231067 13.99993
254.4686
46.32356
386.1511
153.2773
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. Correction
factor
=
4.00
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.
Year 1996
Quarter Winter
Sales ($ million) 6.7
Spring
4.6
Summer
10.0
Fall
12.7
Four-Quarter total
Four-Quarter MA
34.0
8.5
33.8 33.8 1997
Winter Spring Summer Fall
1998
Winter Spring Summer
8.725
35.3
8.825
13.6 6.9
Fall 1999
Winter Spring Summer Fall
37.0
9.25
37.4
9.35
7.0 5.5
2000
7.1
Spring
5.7
38.9 38.4 Summer
8.675
1.13
8.775
1.55
8.9
0.775
9.038
0.553
9.113
1.141
9.188
1.535
9.3
0.753
9.463
0.581
9.588
1.126
9.625
1.558
9.688
0.733
9.663
0.590
9.713
1.143
9.65 9.725 9.6
11.1 39.3
0.54
9.6
15.0
Winter
8.513
9.575
10.8
38.6
0.772
9.125
14.1
38.4
8.425
9.1
10.4
38.3
1.503
8.975
5.0
36.5
8.45
8.625
34.9
36.4
1.18
8.4
9.8
35.9
8.475
8.45
4.6 34.5
Specific Seasonal
8.45
6.5 33.6
Centered MA
9.825
Fall
14.5 39.8
2001
Winter
8.0
Spring
6.2
1.466
9.888
0.801
10.075
0.615
9.95
40.1
10.025
40.5 Summer
9.888
10.125
11.4
Fall 14.9 Table 21.7: The computation for the ratio-to-moving average method
Quarter
1996
Winter
1997
1998
0.77 2 0.54
0.775
1999
0.75 3 Spring 0.553 0.58 1 Summer 1.18 1.13 1.141 1.12 6 Fall 1.50 1.55 1.535 1.55 3 8 Table 21.8: The Seasonal index with the
2000
2001
Total
Mean
0.73 3 0.59
0.801
3.83 4 2.87 9 5.72
0.766 8 0.575 0.574507 8 1.144 1.141432
0.615
Seasonal index 0.765079
1.14 3 1.46 7.61 1.522 1.518982 6 2 4 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, Deseasonal ized value =
Original value Seasonal index
=
T × C × S × I S
= T × C × 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
199 6
199 7
199 8
Winter
Original time series 6.7
Spring Summer
0.77
Deseasonalized series 8.76
4.6
0.57
8.01
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
Winter
6.5
0.77
8.50
Fall
14.9
1.52
9.81
Spring
4.6
0.57
8.01
Summer
9.8
1.14
8.59
Fall
13.6
1.52
8.95
Winter
6.9
0.77
9.02
Spring
5
0.57
8.70
Summer
10.4
1.14
9.11
Fall
14.1
1.52
9.28
Year
199 9
200
Seasonal index
Seasonal index
Winter
Original time series 7
0.77
Deseasonalized series 9.15
Spring
5.5
0.57
9.57
Summer
10.8
1.14
9.46
Fall
15
1.52
9.88
Winter
7.1
0.77
9.28
0
200 1
Spring
5.7
0.57
9.92
Summer
11.1
1.14
9.72
Fall
14.5
1.52
9.55
Winter
8
0.77
10.46
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 Specific seasonal 95.3531 3 95.1174 4 94.7398
Mean Seasonal Quarter Specific index seasonal January 1.00371 1.006284 7 April 1.00123 1.003796 6 July 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 Y t = 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
1996
1997
1998
Season
t
Winter
1
De-seasonalized series 8.01
Spring
2
8.76
Summer
3
Fall
Year
Winter
t 13
De-seasonalized series 9.15
8.36
Spring
14
9.57
4
8.50
Summer
15
9.46
Winter
5
8.01
Fall
16
9.88
Spring
6
8.59
Winter
17
9.28
Summer
7
8.95
Spring
18
9.92
Fall
8
9.02
Summer
19
9.72
Winter
9
8.70
Fall
20
9.55
Spring
10
9.11
Winter
21
10.46
Summer
11
9.28
Spring
22
10.79
Fall
12
8.01
Summer
23
9.99
Fall
24
9.81
1999
2000
2001
Season
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 1
b=
∑ty − n (∑t )(∑ y ) 2 1 2 ( ) t t − ∑ ∑ n
= 0.089894 and a = ∑y − b ∑t =8.110496 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: Y t ' =8.110496 + 0.089894 × t .
Thus for the winter quarter of year 2002, substituting t = 25 in the equation we get ' Y 25 =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 Y 25 =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 ( Y =8.110496 + 0.089894 × t ) ' t
Seasonal index
Final forecast (Fitted trend × 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
View more...
Comments