Time Series and Forecasting Session 8
Time Series, Forecasting & Index Numbers Using Statistics Trend Analysis Seasonality and Cyclical Behavior The Ratio-to-Moving-Average Method Exponential Smoothing Methods Index Numbers Using the computer Summary and Review of Terms
8-1 Using Statistics A time series is a set of measurements of a variable that are ordered through time. Time series analysis attempts to detect and understand regularity in the fluctuation of data over time. Regular movement of time series data may result from a tendency to increase or decrease through time - trend- or from a tendency to follow some cyclical pattern through time - seasonality or cyclical variation. Forecasting is the extrapolation of series values beyond the region of the estimation data. Regular variation of a time series can be forecast, while random variation cannot.
The Random Walk A random walk: Zt- Zt-1=at or equivalently: The difference between Z in time t and time t-1 is a random error. 5 4 3 2 1 t Z R a n d o m W l k There is no evident regularity in a random walk, since the difference in the series from period to period is a random error. A random walk is not forecastable.
A Time Series as a Superposition of Cyclical Functions A Time Series as a Superposition of Two Wave Functions and a Random Error (not shown) 5 4 3 2 1 - t z In contrast with a random walk, this series exhibits obvious cyclical fluctuation. The underlying cyclical series - the regular elements of the overall fluctuation - may be analyzable and forecastable.
8-2 Trend Analysis: A Linear Model Year Loans Time 1988 833 -7 1989 939 -5 1990 1006 -3 1991 1120 -1 1992 1212 1 1993 1301 3 1994 1490 5 1995 1608 7 MTB > Regress 'Loans' 1 'Time' Regression Analysis The regression equation is Loans = 1189 + 54.5 Time Predictor Coef Stdev t-ratio p Constant 1188.62 12.59 94.41 0.000 Time 54.506 2.747 19.84 0.000 s = 35.61 R-sq = 98.5% R-sq(adj) = 98.2% 7 2 - 3 8 T i m e L o a n s 1 R S q u r d = . 9 5 Y 6 + 4 X t f D E x p l Example 12-1
Example 8-2 Year Line Fit Plot y = 26.23x - 52065 100 200 300 400 1988 SUMMARY OUTPUT Regression Statistics Multiple R 0.971670504 R Square 0.944143569 Adjusted R Square 0.936164079 Standard Error 18.67935099 Observations 9 ANOVA df SS MS F Significance F Regression 1 41284.44628 118.3212908 1.2256E-05 Residual 7 2442.427074 348.9181534 Total 8 43726.87336 Coefficients t Stat P-value Lower 95% Upper 95% Lower 95.0% Upper 95.0% Intercept -52064.60294 4806.111263 -10.83299992 1.25952E-05 -63429.24206 -40699.96383 X Variable 1 26.23116667 2.411493843 10.87755904 20.52889392 31.93343941 Year Line Fit Plot y = 26.23x - 52065 100 200 300 400 1988 1990 1992 1994 1996 1998 Year Price
Trend Analysis: An Exponential Model MTB > let 'LOGLoan' = loge('Loans') MTB > Name c5 = 'FITS1' MTB > Regress 'LOGLoan' 1 'Time'; SUBC> Fits 'FITS1'; SUBC> Constant. Regression Analysis The regression equation is LOGLoan = 7.06 + 0.0462 Time 8 cases used 1 cases contain missing values Predictor Coef Stdev t-ratio p Constant 7.05811 0.00562 1256.45 0.000 Time 0.046208 0.001226 37.70 0.000 s = 0.01589 R-sq = 99.6% R-sq(adj) = 99.5% MTB > let 'FITS' = expo(‘FITS1’) 1 9 6 5 4 3 2 8 7 Y e a r L o n s
8-3 Seasonality and Cyclical Behavior 88 87 86 1 9 8 7 6 t P a s e n g r M o h l y N u m b f A i 89 90 91 92 93 94 95 5 4 3 2 Y E G : J F D O S T When a cyclical pattern has a period of one year, it is usually called seasonal variation. A pattern with a period of other than one year is called cyclical variation.
Time Series Decomposition Types of Variation Trend (T) Seasonal (S) Cyclical (C) Random or Irregular (I) Additive Model Zt=Tt+ St+ Ct+ It Multiplicative Model Zt=(Tt )(St )(Ct )(It)
Estimating an Additive Model with Seasonality An additive regression model with seasonality: Zt=0+ 1 t+ 2 Q1+ 3 Q2 + 4 Q3 + at where Q1=1 if the observation is in the first quarter, and 0 otherwise; Q2=1 if the observation is in the second quarter, and 0 otherwise; Q3=1 if the observation is in the third quarter, and 0 otherwise.
8-4 The Ratio-to-Moving- Average Method A moving average of a time series is an average of a fixed number of observations that moves as we progress down the series. Time, t: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Series, Zt: 15 12 11 18 21 16 14 17 20 18 21 16 14 19 Five-period moving average: 15.4 15.6 16.0 17.2 17.6 17.0 18.0 18.4 17.8 17.6 Time, t: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Series, Zt: 15 12 11 18 21 16 14 17 20 18 21 16 14 19 (15 + 12 + 11 + 18 + 21)/5=15.4 (12 + 11 + 18 + 21 + 16)/5=15.6 (11 + 18 + 21 + 16 + 14)/5=16.0 . . . . . (18 + 21 + 16 + 14 + 19)/5=17.6
Comparing Original Data and Smoothed Moving Average 1 5 2 t Z O r i g n a l S e s d F v - P o M A Moving Average: “Smoother” Shorter Deseasonalized Removes seasonal and irregular components Leaves trend and cyclical components
Ratio-to-Moving Average Ratio-to-Moving Average for Quarterly Data Compute a four-quarter moving-average series. Center the moving averages by averaging every consecutive pair and placing the average between quarters. Divide the original series by the corresponding moving average. Then multiply by 100. Derive quarterly indexes by averaging all data points corresponding to each quarter. Multiply each by 400 and divide by sum.
Ratio-to-Moving Average: Example 8-2 1 5 7 6 4 3 S a l e s T i m A c t u o h d M D : P E L n g v r 2 . 9 8 F - Q Simple Centered Ratio Moving Moving to Moving Quarter Sales Average Average Average 1992W 170 * * * 1992S 148 * * * 1992S 141 * 151.125 93.3 1992F 150 152.25 148.625 100.9 1993W 161 150.00 146.125 110.2 1993S 137 147.25 146.000 93.8 1993S 132 145.00 146.500 90.1 1993F 158 147.00 147.000 107.5 1994W 157 146.00 147.500 106.4 1994S 145 148.00 144.000 100.7 1994S 128 147.00 141.375 90.5 1994F 134 141.00 141.000 95.0 1995W 160 141.75 140.500 113.9 1995S 139 140.25 142.000 97.9 1995S 130 140.75 * * 1995F 144 143.25 * *
Seasonal Indexes: Example 8-2 Quarter Year Winter Spring Summer Fall 1992 93.3 100.9 1993 110.2 93.8 90.1 107.5 1994 106.4 100.7 90.5 95.0 1995 113.9 97.9 Sum 330.5 292.4 273.9 303.4 Average 110.17 97.47 91.3 101.13 Sum of Averages = 400.07 Seasonal Index = (Average)(400)/400.07 Seasonal Index 110.15 97.45 91.28 101.11
Deseasonalized Series: Example 8-2 Seasonal Deseasonalized Quarter Sales Index (S) Series(Z/S)*100 1992W 170 110.15 154.34 1992S 148 97.45 151.87 1992S 141 91.28 154.47 1992F 150 101.11 148.35 1993W 161 110.15 146.16 1993S 137 97.45 140.58 1993S 132 91.28 144.51 1993F 158 101.11 156.27 1994W 157 110.15 142.53 1994S 145 97.45 148.79 1994S 128 91.28 140.23 1994F 134 101.11 132.53 1995W 160 110.15 145.26 1995S 139 97.45 142.64 1995S 130 91.28 142.42 1995F 144 101.11 142.42 Original Deseasonalized - - - 1 9 2 F S W 7 6 5 4 3 t a l e s O r i g n d o y A j u
The Cyclical Component: Example 8-2 1 8 7 6 5 4 3 2 9 F S W t a l e s T r n d L i M o v g A The cyclical component is the remainder after the moving averages have been detrended. In this example, a comparison of the moving averages and the estimated regression line: illustrates that the cyclical component in this series is negligible.
Example 8-2 using Excel The centered moving average, ratio to moving average, seasonal index, and deseasonalized values were determined using the Ratio-to-Moving-Average method (implemented with formulas).
Example 8-2 using Excel Comparison of actual sales data given in Example 12-2 for 1994-1997 versus predicted sales fit using (1) the trend model determined linear regression and (2) the seasonal index estimated from Ratio-to-Moving-Average method. The trend equation and seasonal index were used to calculate forecasts of sales for 1998 and 1999. Quarter Sales Trend Seas Indx Fit/Forcast 1994 W 170 154.169 110.139 169.8 S 148 153.063 97.448 149.157 S 141 151.957 91.291 138.723 Model Fit/Forecast F 150 150.851 101.122 152.545 1995 W 161 149.746 110.139 164.928 S 137 148.64 97.448 144.846 S 132 147.534 91.291 134.685 180 F 158 146.428 101.122 148.071 1996 W 157 145.322 110.139 160.056 160 S 145 144.216 97.448 140.536 S 128 143.11 91.291 130.647 Sales F 134 142.004 101.122 143.598 Sales 140 1997 W 160 140.899 110.139 155.184 Fit/Forecast S 139 139.793 97.448 136.225 120 S 130 138.687 91.291 126.609 F 144 137.581 101.122 139.125 1998 W 136.475 110.139 150.312 100 S 135.369 97.448 131.914 S 134.263 91.291 122.57 4 8 12 16 20 24 F 133.157 101.122 134.652 1999 W 132.051 110.139 145.44 Period (Fall 1993 = 0) S 130.946 97.448 127.604 S 129.84 91.291 118.532
Forecasting a Multiplicative Series: Example 8-2
Multiplicative Series: Review
8-5 Exponential Smoothing Methods Smoothing is used to forecast a series by first removing sharp variation, as does the moving average. Exponential smoothing is a forecasting method in which the forecast is based in a weighted average of current and past series values. The largest weight is given to the present observations, less weight to the immediately preceding observation, even less weight to the observation before that, and so on. The weights decline geometrically as we go back in time. - 5 1 . 4 3 2 L a g W e i h t s D c l n G o B k T m d S u Weights Decline as we go back in Time -10 Weight Lag
The Exponential Smoothing Model
Example 8-3 Day Z w=.4 w=.8 1 925 925.000 925.000 2 940 925.000 925.000 3 924 931.000 937.000 4 925 928.200 926.600 5 912 926.920 925.320 6 908 920.952 914.664 7 910 915.771 909.333 8 912 913.463 909.867 9 915 912.878 911.573 10 924 913.727 914.315 11 943 917.836 922.063 12 962 927.902 938.813 13 960 941.541 957.363 14 958 948.925 959.473 15 955 952.555 958.295 16 * 953.533 955.659 Original data: Smoothed, w=0.4: ...... Smoothed, w=0.8: ----- D a y 1 5 9 6 4 3 2 w = . E x p o n e t i l S m h g : d 8
8-6 Index Numbers An index number is a number that measures the relative change in a set of measurements over time. For example: the Dow Jones Industrial Average (DJIA), the Consumer Price Index (CPI), the New York Stock Exchange (NYSE) Index.
Index Numbers: Example 8-4 Index Index Year Price 1982=100 1989=100 1982 121 100.0 64.7 1983 121 100.0 64.7 1984 133 109.9 71.1 1985 146 120.7 78.1 1986 162 133.9 86.6 1987 164 135.5 87.7 1988 172 142.1 92.0 1989 187 154.5 100.0 1990 197 162.8 105.3 1991 224 185.1 119.8 1992 255 210.7 136.4 1993 247 204.1 132.1 1994 238 196.7 127.3 1995 222 183.5 118.7 Y e a r P i c n d I x ( 1 9 8 2 = ) o f N t u l G s 5 Original Index (1982) Index (1989)
Consumer Price Index Example 12-5: Adjusted Year Salary Salary 1980 29500 11953.0 1981 31000 11380.3 1982 33600 11610.2 1983 35000 11729.2 1984 36700 11796.8 1985 38000 11793.9 C P I Y e a r 4 5 3 2 1 9 8 7 6 Consumer Price index (CPI): 1967=100
Using the Computer: Example 8-2 (1) MTB > %Decomp 'Sales' 4; SUBC> Start 1. Time Series Decomposition Data Sales Length 16.0000 NMissing 0 Trend Line Equation Yt = 155.275 - 1.10588*t Seasonal Indices Period Index 1 1.10325 2 0.980148 3 0.906416 4 1.01019
Using the Computer: Example 8-2 (2)
Using the Computer: Example 8-2 (3)