Time Series Analysis
Time Series Analysis
21.1 Introduction
This chapter dealt with the basic components of time series, time series decomposition, and simple forecasting. At the end of this chapter, you should know the following: 1. The four possible components of a time series. 2. How to use smoothing techniques to remove the random variation and identify the remaining components. 3. How to use the linear and quadratic regression models to analyze the trend. 4. How to measure the cyclical effect using the percentage of trend method. 5. How to measure the seasonal effect by computing the seasonal indices. 6. How to calculate MAD and SSE to determine which forecasting model works best. 7. How to use exponential smoothing to forecast a time series. 8. How to use the three regression models to forecast a time series.
21.2
The four possible components of a time series are the following: 1. Trend: the long-term, relatively smooth pattern or direction that the series exh ibits. 2. Cycle: a wavelike pattern that varies about the long-term trend. Cyclic patterns appear over a number of years. 3. Seasonal variation: cycles that occur over short periods of time, less than one year. 4. Random variation: random or irregular changes that a time series exhibits. The classical time series may be additive,
Yt
Tt
Ct
St
Rt
or multiplicative,
Yt
Tt
Ct
St
Rt
21.3
Smoothing Techniques
There are two methods that can be used to remove the random variation from a time series: moving averages and exponential smoothing.
287
Moving averages involve averaging the time series over a specific number of periods. We usually choose an odd number of periods.
Example 21.1
The monthly production of crude petroleum in Canada during 1989 is shown below. Compute the three-month moving averages. Month Crude Petroleum J F M A M J J A S O N D
5,886 5,485 6,269 5,776 6,109 5,867 6,196 6,045 5,839 6,180 6,192 6,362
Solution
Month J F M A M J J A S O N D
Crude Petroleum 5,886 5,485 6,269 5,776 6,109 5,867 6,196 6,045 5,839 6,180 6,192 6,362
Three-Month Moving Average 5,880.00 5,843.33 6,051.33 5,917.33 6,057.33 6,036.00 6,026.67 6,021.33 6,070.33 6,244.67
One of the reasons why we frequently choose an odd number of periods is because that enables us to place the moving average in the center of the periods being averaged. If the number of periods is even, we must place the moving average between the two middle periods. This creates graphing problems, which we solve by centering the moving averages.
Example 21.2
Calculate the four-month centered moving averages for the time series in Example 21.1.
288
Solution
We first calculate the four-month moving averages. Notice that we position the moving averages between the second and third months of the four-month period. We then calculate the average of the moving averages. The centered moving averages are placed in the third month of the five months involved in each moving average.
Month J F M A M J J A S O N D
Crude Petroleum 5,886 5,485 6,269 5,776 6,109 5,867 6,196 6,045 5,839 6,180 6,192 6,362
Four-Month Moving Average 5,854.00 5,909.75 6,005.25 5,987.00 6,054.25 5,986.75 6,065.00 6,064.00 6,143.25
Centered Four-Month Moving Average 5,881.875 5,957.500 5,996.125 6,020.625 6,020.500 6,025.875 6,064.500 6,103.625
The second method frequently used to reduce the random variation in a time series is exponential smoothing. Exponential smoothing is performed using the formula S t = wyt + (1 w) S t 1 for t 2 where St = Exponentially smoothed value at time t yt = Time series at time t w = Smoothing constant where 0 w 1
S 1 = y1
289
A small value of w results in a great deal of smoothing. A large value of w produces very little smoothing.
Example 21.3
Compute the exponentially smoothed time series with w = .2 for the data in Example 21.1.
Solution
Month J F M A M J J A S O N D Crude Petroleum 5,886 5,485 6,269 5,776 6,109 5,867 6,196 6,045 5,839 6,180 6,192 6,362
St
wy t
(1
w ) S t 1
5,886.00 5,805.80 5,898.44 5,873.95 5,920.96 5,910.17 5,967.34 5,982.87 5,954.09 5,999.28 6,037.82 6,102.66
EXERCISES
21.1 Given the following time series, compute the three-period moving average.
Period 1 2 3 4 5
Time Series 17 29 21 36 43
290
6 7 8
29 36 44
21.2
21.3
21.4
Given the following time series, use exponential smoothing with w = .6 to reduce the random variation. Period 1 2 3 4 5 6 7 8 9 10 Time Series 103 121 86 74 83 58 62 41 23 32
21.4
Trend Analysis
y
In this section, we presented two models that allow us to measure the trend. The two models are 1. Linear model: = 1 + 1 t +
2. Quadratic model: y = 0 + 1 t + 2 t 2 +
291
Example 21.4
The number of airline passengers (in 1,000s) traveling to Canada annually is shown below. a) Plot the time series. b) Which of the two models, linear or quadratic, do you thing would fit best?
Year 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986
t 1 2 3 4 5 6 7 8 9 10 11 12
Passengers 181 184 230 235 302 409 458 639 647 792 801 942
Solution
a)
292
b) There appears to be some curvature in the graph, which suggests that the quadratic model would fit best.
Example 21.5
Refer to Example 21.4. Suppose that the three models were estimated as follows:
Linear Model
y
8 .2
73 . 3t
. 958
Quadratic Model
y
120
25 .3 t
3 .69 t 2
. 980
Solution
293
21.5
We can isolate and measure the cyclical effect by the percentage of trend. We do this in the following way. 1. Determine the trend line.
for each time period. 2. Compute the trend value y )100. 3. The percent of trend is (y/ y
Example 21.6
A recent pensioner decided to evaluate the earnings of her self-administered pension plan portfolio. As part of her analysis, she wanted to identify any possible cycles in the real rates of return she had been earning over the 20 years from 19711990. 1971 1972 1973 1974 1975 6.8% 7.0 3.4 5.6 5.2 1976 1977 1978 1979 1980 2.6% 7.0 5.8 7.5 3.5 1981 1982 1983 1984 1985 1.1% 6.1 2.2 3.9 3.4 1986 1987 1988 1989 1990 1.0% 4.0 4.3 2.8 5.4
a) Plot the series on graph paper. b) Using the percentage of trend approach, isolate the cycle.
Solution
294
b) The regression equation is = 6.64 .240t y The percentage of trend is shown in the table below.
Year
Rate of Return y 6.8% 7.0 3.4 5.6 5.2 2.6 7.0 5.8 7.5 3.5 1.1 6.1 2.2 3.9 3.4 1.0 4.0 4.3 2.8 5.4
Trend y 6.40 6.16 5.92 5.68 5.44 5.20 4.96 4.72 4.48 4.24 4.00 3.76 3.52 3.28 3.04 2.80 2.56 2.32 2.08 1.84
Percentage of Trend )100 (y/ y 106.3 113.6 57.4 98.6 95.6 50.0 141.1 122.9 167.4 82.5 27.5 162.2 62.5 118.9 111.8 35.7 156.3 185.3 134.6 293.5
1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
As you can see, the cycles are quite irregular. As a consequence, we cannot use these results to forecast the rate of return.
295
Question: Answer:
What do I look for when I graph the percentage of trend? You should look for cycles whose amplitudes (peaks and valleys) and time periods are approximately equal. In general, however, cycles will not be so well behaved. Random variation is likely to make it quite difficult to see cycles.
EXERCISES
21.5 The history of gross fixed capital formation as a percentage of gross domestic product is listed below. The linear trend line is
y
19 . 142
.447 t
(t = 1, 2, . . . , 19)
Year 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988
t 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Capital Formation 20.8 23.6 24.7 19.3 18.6 21.7 18.6 21.7 27.6 27.4 23.2 20.1 21.1 25.3 31.6 30.7 31.9 25.3 22.5
296
21.6
Refer to Exercise 21.5. Graph the percentage of trend. Does it appear that a regular cyclical pattern exists?
21.6
In this section, we discussed how to measure the seasonal variations. We do this by calculating seasonal indices, where seasons can be defined as the quarter of a year, months, weeks, or days. Seasonal indices are computed as follows:
. 1. If the time series displays little or no cyclical effect, calculate the trend value y
If the time series exhibits a cyclical effect, compute the moving averages. The number of periods is the number of types of seasons, that is, 4 quarters per year, 12 months per year, 4 weeks per month, or 5 working days per week. 2. Compute the ratio of the time series over the trend value or the moving average. 3. For each type of season, determine the average ratio. 4. Adjust the average ratios so that the average is equal to 1.
Example 21.7
The following data give, by quarter, the total number (in thousands) of crimes and offenses recorded by the police in England and Wales:
Source: Central Statistical Office, Monthly Digest of Statistics, U.K. Government Statistical Service, No. 491, November 1986. Calculate quarterly indices for the data using a four-quarter centered moving average.
297
Solution
The seasonal (quarterly) indices are computed below.
Year
Quarter
Crimes y 186.5 191.8 190.1 197.7 190.9 198.0 203.8 207.6 188.9 207.0 202.9 212.6 196.4 207.8 203.1 206.4 196.4 201.6
Four-Quarter Moving Average 191.525 192.625 194.175 197.600 200.075 199.575 201.825 201.600 202.850 204.725 204.925 204.975 203.425 203.425 203.000
Centered Moving Average 192.1 193.4 195.9 198.8 199.8 200.7 201.7 202.2 203.8 204.8 205.0 204.2 203.4 203.2
Ratio y/MA .990 1.022 .974 .996 1.020 1.034 .937 1.024 .996 1.038 .958 1.018 .999 1.016
1982
1 2 3 4
1983
1 2 3 4
1984
1 2 3 4
1985
1 2 3 4
1986
1 2
298
Quarter Year 1982 1983 1984 1985 1986 Average Seasonal Index 1 .974 .937 .958 .956 .956 2 .996 1.024 1.018 1.013 1.014 3 .990 1.020 .996 .999 4 1.022 1.034 1.038 1.016 Total
1.001 1.001
1.028 1.029
3.998 4.000
EXERCISES
21.7 The average daily price of hotel rooms in Florida is listed below for each quarter for the years 19861989. Use a four-quarter centered moving average to compute the seasonal indices.
Quarter Year 1986 1987 1988 1989 1 93 108 118 125 2 58 54 59 67 3 72 75 83 86 4 85 93 110 105
21.8
74 . 6
+ 1. 45 t (t = 1, 2, . . . , 16)
Use the linear trend line to compute the seasonal indices. 21.9 Retailers are constantly concerned about consumers spending habits. A retailer is considering a major expansion but needs more information. An assistant has compiled the following quarterly expenditures on consumer goods and services in the city of the proposed expansion during the three years 19871989.
299
to compute the seasonal indices. Expenditures on Consumer Goods and Services (in $millions) Quarter Year 1987 1988 1989 1 98 112 86 2 75 92 95 3 61 73 74 4 121 128 102
21.7
Introduction to Forecasting
It is important to measure the accuracy of forecasting models to determine which is best. There are two such measures. They are
yt
MAD = and SSE = where
t =1
Ft
( y t Ft )
=1
MAD averages the absolute value of the error, and SSE squares the error. Consequently, SSE should be used to measure forecast accuracy when the avoidance of large errors is especially important. The calculation of each measure is quite simple.
300
Example 21.8
In 1984, two forecasting models were used to predict annual sales for the period 19851989. The forecasts and actual sales are listed below. For each model, calculate MAD and SSE to determine which model worked best for the period 19851989.
Forecast (in $millions) Year 1985 1986 1987 1988 1989 Sales (in $millions) 305 362 417 405 423 Model 1 259 328 403 418 439 Model 2 280 330 398 384 390
Solution
Model 1: MAD = = 305 259 + 362 328 + 417 403 + 405 418 + 423 439 5 46 + 34 + 14 + 13 + 16 123 = = 24 .3 5 5
2 2 2 2 2 SSE = (305 259) + (362 328) + (417 403) + (405 418) + (423 439) 2 2 2 2 2 = 46 + 34 + 14 + 13 + 16 = 3,893
Model 2: MAD = =
305 280 + 362 330 + 417 398 + 405 384 + 423 390 5 25 + 32 + 19 + 21 + 33 130 = = 26 .0 5 5
2 2 2 2 2 SSE = (305 280) + (362 330) + (417 398) + (405 384) + (423 390) 2 2 2 2 2 = 25 + 32 + 19 + 21 + 33 = 3,540
Measuring forecast error by MAD, Model 2 is better. Using SSE, Model 1 appears to predict more accurately.
301
EXERCISES
21.10 Compute MAD and SSE for the following forecasts.
21.11 Two forecasting models were used to predict annual output of a small oil well. Calculate MAD and SSE for each model to determine which one was better.
Year
Oil Output (in 1,000s of barrels) Model 1 698 882 875 801 740
21.8
When there is little or no trend and no cyclical and no seasonal pattern, exponential smoothing produces reasonably good forecasts. If t represents the current time period the forecast for the next period is
Ft + 1
St
wy t
+ (1
w ) St 1
where w is the smoothing constant. We can forecast more than one period into the future using this method. That is,
Ft + k
St
where k = 1, 2, 3, . . .
302
Example 21.9
Annual production of wine by a California company for the past 10 years 19801989 is shown in the accomp anying table. Use exponential smoothing with w = .8 to forecast wine production for 1990 and 1991.
Year
1980 1981 1982 1983 1984 1985 1986 1987 1988 1989
Solution
Exponential smoothing appears to be a good choice of model, since there appears to be no cyclical pattern and a relatively weak upward trend. The exponentially smoothed values are shown below.
Year 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989
Wine Production yt 57 63 69 61 67 58 56 61 65 68
S t = wyt + (1 w) S t 1 57.00 58.20 60.36 60.49 61.79 61.03 60.03 60.22 61.18 62.54
303
Thus and
EXERCISES
21.12 A replacement muffler company has recorded the total number of mufflers installed annually for the years 19801989. Use exponential smoothing with w = .3 to forecast the number of mufflers to be installed in 1990.
Year 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989
Number of Mufflers (in 1,000s) 227 211 245 257 236 239 248 227 263 252
21.14 Discuss the differences between the two forecasting values in Exercises 21.12 and 21.13.
21.9
When a time series is comprised of trend and a seasonal pattern we can use two different models. The first is
Ft
= 0 + 1 t
SI t
304
where SIt = Seasonal index for period t and are the linear regression coefficients. and 0 1 The second model uses multiple regression with dummy variables, which represent the seasons. For example, if the four quarters of the year are the seasons, the model is Ft = y t = 0 + 1 t + 2 Q1 + 3 Q 2 + 4 Q3 + where Q1 = 1 if quarter 1 = 0 if not Q 2 = 1 if quarter 2 = 0 if not Q3 = 1 if quarter 3 = 0 if not
Example 21.10
Refer to Example 21.7. The linear trend line is
= 191 + .89t y
(t = 1, 2, . . . , 18)
Use this trend line and the seasonal indices computed in Example 21.7 to forecast the next six quarters.
Solution
The seasonal indices are as follows
Quarter 1 2 3 4
305
Year
Quarter
Time Period t 19 20 21 22 23 24
Trend Value y = 191 + .89t 207.91 208.80 209.69 210.58 211.47 212.36
Forecast
t SIt F t = y
208.118 214.855 200.464 213.528 211.681 218.518
1986 1987
3 4 1 2 3 4
Example 21.11
Using the data from Example 21.7, we found the following estimates of the multiple regression model
y
= 0 + 1 t + 2 Q 1 + 3 Q 2 + 4 Q 3 +
1 = .819 2 = 13 . 4 3 = . 3. 93 4 = 5. 28
0 =
198
Solution
Forecast Year 1986 1987 Quarter 3 4 1 2 3 4 t 19 20 21 22 23 24
Q1 Q2 Q3
198
. 819 t
13 .4 Q1
3 . 93 Q 2
5 .28 Q 3
0 0 1 0 0 0
0 0 0 1 0 0
1 0 0 0 1 0
= 0 + 1 yt 1 +
is used when there is a relatively strong correlation among the residuals of the linear trend model
306
Example 21.12
The table below lists the annual sales of replacement automobile radios for the 15 years from 1975 1989. The linear trend line was found to be
= 33.4 + .957t y
and the DurbinWatson statistic was d = 3.70 As a result, the autoregressive model was estimated. It is
t y
61 . 9
.487 yt 1
Year
1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
307
Solution
1990 = 61 . 9 .487 y1989 = 61 . 9 .487 ( 45 ) = 40 . 00 y We predict that the company will sell 40,000 replacement radios in 1990.
EXERCISES
21.15 Refer to Exercise 21.8. Use the trend line and the seasonal indices to forecast the four quarters of 1990.
21.16 Use the trend line and the seasonal indices in Exercise 21.9 to forecast the four quarters of 1990.
21.17 Using the data in Exercise 20.9, we developed the following multiple regression model:
y
117
. 06 t
18 .1 Q1
29 .5 Q 2
47 .6 Q 3
where
Q1
t = 1, 2, . . . , 12 = 1 if quarter 1 = 0 if not
Q2
= 1 if quarter 2 = 0 if not
Q3
= 1 if quarter 3 = 0 if not
308