Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.1 Chapter 20 Time Series Analysis and Forecasting.

Similar presentations


Presentation on theme: "Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.1 Chapter 20 Time Series Analysis and Forecasting."— Presentation transcript:

1 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.1 Chapter 20 Time Series Analysis and Forecasting

2 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.2 Time Series Analysis… A variable measured over time (in sequential order) is called a time series. From this data, we analyze it to detect patterns that will enable us to forecast future values of the variable. As you might expect, this technique has wide application:  Governments want to know future values of interest rates, unemployment rates and percentage increases in the cost of living.  Housing industry economists must forecast mortgage interest rates, demand for housing, and the cost of building materials.  Many companies attempt to predict the demand for their product and their share of the market.  Universities and colleges often try to forecast the number of students who will be applying for acceptance at post-secondary-school institutions. …and so on!

3 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.3 Time Series Components… A time series can consist of four different components:  Long-term trend  Cyclical variation  Seasonal variation  Random variation time variable of interest A trend is a long term relatively smooth pattern or direction, that persists usually for more than one year

4 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.4 Time Series Components… A time series can consist of four different components:  Long-term trend  Cyclical variation  Seasonal variation  Random variation time variable of interest A cycle is a wavelike pattern describing a long term behavior (for more than one year). Cyclical patterns that are consistent and predictable are quite rare; hence, we will ignore this type of variation

5 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.5 Time Series Components… A time series can consist of four different components:  Long-term trend  Cyclical variation  Seasonal variation  Random variation time variable of interest The seasonal component of the time series exhibits a short term (less than one year) calendar repetitive behavior.

6 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.6 Time Series Components… A time series can consist of four different components:  Long-term trend  Cyclical variation  Seasonal variation  Random variation time variable of interest Random variation comprises the irregular unpredictable changes in the time series. It tends to hide the other (more predictable) components. One of our objectives will be to remove random variation…

7 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.7 Smoothing Techniques… If we can determine which components actually exist in a time series, we can develop better forecasts. We can reduce random variation by smoothing the time series. To methods to smooth the data are: moving averages, and exponential smoothing.

8 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.8 Moving Averages… A moving average for a time period is the arithmetic mean of the values in that time period and those close to it. This is what we hear something like “three year moving average”. Example 20.1Example 20.1: time period 12345… sales (,000s) 3937615818… and so on…

9 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.9 Example 20.1… Again, calculating manually can be tedious and error prone. In Excel: Tools > Data Analysis… > Moving Average COMPUTE note how the moving average is “smoother” than the raw data…

10 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.10 Moving Average… The averaging process removes some of the random variation. If we use a 5-quarter moving average, removes even more variation and our line is smoother, but now we’ve lost the seasonality that appears in the 3-quarter moving average. INTERPRET

11 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.11 Centered Moving Average… We’ve considered moving averages for odd numbers of time periods: 3-period: 5-period: What happens when we use even numbers of periods to calculate moving averages?

12 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.12 Centered Moving Average… With an even number of observations included in the moving average, the average is placed between the two periods in the middle. To place the moving average in an actual time period, we need to center it. Two consecutive moving averages are centered by taking their average, and placing it in the middle between them.

13 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.13 Centered Moving Average… Consider this 6-period time series: 15, 27, 20, 14, 25, 11 Can we calculate its four-period moving average?

14 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.14 Exponential Smoothing… There are two drawbacks with the moving average method of smoothing:  No moving averages for the first and last sets of time periods.  The moving average “forgets” most of the previous time-series values (i.e. only looks at those around it). Exponential smoothing addresses these issues…

15 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.15 (our original data) Exponentially Smoothed Time Series… An exponentially smoothed time series is one that’s given by S t = wy t + (1 – w)S t-1 (for t ≥ 2) where: S t = Exponentially smoothed time series at time t y t = Time series at time period t S t-1 = Exponentially smoothed time series at time t–1 w = Smoothing constant, where 0 ≤ w ≤ 1 In general:

16 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.16 Example 20.2Example 20.2… We can calculate these values manually… S t = wy t + (1 – w)S t-1 S 1 = y 1 COMPUTE

17 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.17 Example 20.2… Excel > Tools > Data Analysis… > Exponential Smoothing COMPUTE 1 – w

18 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.18 Example 20.2… INTERPRET With w =.7, we have very little smoothing. With w =.2, we have too much smoothing.

19 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.19 Trend and Seasonal Effects… A trend can be linear or nonlinear (or, in fact, take any number of functional forms). The easiest way of measuring the long-term trend is by regression analysis, where the independent variable is time. Linear TrendQuadratic Trend

20 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.20 Seasonal Analysis… Seasonal variation may occur within a year or within shorter intervals, such as a month, week, or day. To measure the seasonal effect, we compute seasonal indexes, which gauge the degree to which the seasons differ from one another. Employment numbers, for example, are seasonally adjusted to account for summer jobs of students, etc. Was the change in employment numbers due to seasonality or a real change in the economy?

21 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.21 Computing Seasonal Indexes… We can use this procedure to compute seasonal indexes:  Compute the sample regression line:  For each time period, compute the ratio:  For each type of season, compute the average of the ratios from step   Adjust the averages in  so the average of all seasons = 1

22 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.22 Example 20.3… Calculate the seasonal indexes to account for variations in Bermuda hotel occupancy rates from observed data:observed data Regression Analysis…  Compute the sample regression line: Add a new spreadsheet column… Add the independent variable, time… Compute 

23 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.23 Example 20.3…  For each time period, compute the ratio: Compute 

24 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.24 Example 20.3…  For each type of season, compute the average of the ratios from step  Compute 

25 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.25 Example 20.3…  Adjust the averages in  so the average of all seasons = 1 No adjustments are required since: Compute  Average of all seasons

26 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.26 Example 20.3… Alternatively, you can set up the data in this fashion: [ y t ] [season code] and use the Seasonal Indexes tool from Data Analysis Plus COMPUTE

27 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.27 Example 20.3 The seasonal indexes tell us that, on average, the occupancy rates in the first and fourth quarters are below the annual average, and the occupancy rates in the second and third quarters are above the annual average. E.g., we expect the occupancy rate in the first quarter to be 12.2% (100% - 87.8%) below the annual rate, and 7.6% above for the second quarter, etc. INTERPRET

28 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.28 Time Series and Trend… Here is the time series data and the regression line together:

29 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.29 Deseasonalizing a Time Series… One application of seasonal indexes is to remove the seasonal variation in a time series, by deseasonalizing. The result is called a seasonally adjusted time series. This allows us to more easily compare the time series across seasons… Seasonally Adjusted Time Series = Actual Time Series Season Index

30 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.30 Effects of “Deseasonalization”… Here we’re comparing the original occupancy rate time series data with the seasonally adjusted time series data:

31 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.31 Interpretation… Compared to a horizontal line, we can see that occupancy rates are rising over time…

32 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.32 Introduction to Forecasting… There are many different forecasting models available to us. One way to choose with method or model to use is to select the technique with the greatest forecast accuracy. Two measures of this quantity are: Mean Absolute Deviation (MAD): and Sum of Squares for Forecast Error (SSE): (y t = actual value of time series at time t, F t = forecasted value, n = number of time periods)

33 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.33 Which to use? SSE? MAD? MAD averages the absolute differences between the actual and forecast values. SSE is the sum of the squared differences. Which measure to use in judging forecast accuracy depends on the circumstances:  If avoiding large errors is important SSE should be used because it penalizes large deviations more heavily than does MAD. Otherwise use MAD.

34 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.34 Model Selection… Here is a useful procedure for model selection:  Use some of the observations to develop several competing forecasting models.  Run the models on the rest of the observations.  Calculate the accuracy of each model.  Select the model with the best accuracy measure

35 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.35 Example 20.4… We have developed three forecasting models; which model performed best? E.g. Actuals vs. Forecast #1…

36 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.36 Example 20.4… Model 2 is inferior to both models 1 and 3 – drop it. Using MAD, model 3 is best, but using SSE, model 1 is most accurate. So? Which one to choose?! INTERPRET

37 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.37 Example 20.4… The choice between model 1 and model 3 should be made on the basis of whether we prefer a model that consistently produces moderately accurate forecasts (model 1) or one whose forecasts come quite close to most actual values but miss badly in a small number of time periods (model 3). INTERPRET

38 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.38 Forecasting Models… The choice of a forecasting technique depends on the components identified in the time series. Three techniques will be discussed… Exponential smoothing, Seasonal indexes, and Autoregressive models.

39 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.39 Forecasting with Exponential Smoothing… IF the time series — displays a gradual or no trend, and — no evidence of seasonal variation, THEN exponential smoothing can be effective as a forecasting method. The forecast for period t+k (k=1, 2, 3,…) is given by: F t+k = S t where S t is the exponentially smoothed value computed using techniques discussed earlier.

40 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.40 Forecasting with Exponential Smoothing… k=1 F t+1 = S t k=2 F t+2 = S t k=3 F t+3 = S t As you can see, we can produce a reasonably accurate prediction for the next time period (t+1), but the accuracy of the forecast decreases rapidly more than one time period into the future (i.e. t+2, t+3, …)

41 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.41 Forecasting with Seasonal Indexes… IF the time series — is composed of seasonal variation, and — has a long-term trend, THEN we can use seasonal indexes and the regression equation to forecast. The forecast for time period t is: F t = [b 0 + b 1 t] x SI t

42 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.42 Example 20.5… Forecast hotel occupancy rates for the next year in Example 20.3… We know…  The regression line: and  The Seasonal Indexes: Put them all together using: F t = [b 0 + b 1 t] x SI t

43 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.43 Example 20.5… F t = [b 0 + b 1 t] x SI t Continuing into the next year (through the first to fourth quarter, i.e. time periods 20+1, 20+2, 20+3, and 20+4): That is, we forecast the quarterly occupancy rates to be:.658,.812,.890, and.670

44 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.44 Autoregressive Model… IF the time series — has no obvious trend or seasonality, but — we believe that there is a correlation between consecutive residuals THEN the autoregressive model may be most effective. The autoregressive forecasting model is given by: and is estimated using the regression line:

45 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.45 Example 20.6… The consumer price index (CPI) is a general measure of inflation and is widely used. Consider the annual percent increases in CPI collected over 22 year years and forecast next year’s change in the CPI… increases

46 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.46 Example 20.6… Remember, we’re trying to correlate the CPI in time period t with the previous time period, t–1, hence we modify the dataset from the list set-up in the first Excel snippet to the set-up in the second (which is how the dataset Xm20-06.xls is structured).Xm20-06.xls Now we can run the Regression tool… COMPUTE This is the independent variable (x) This is the dependent variable (y)

47 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.47 Example 20.6… Our regression analysis runs… Since the CPI was.016 in 2002, we predict a CPI increase of 1.17% in 2003… COMPUTE


Download ppt "Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 20.1 Chapter 20 Time Series Analysis and Forecasting."

Similar presentations


Ads by Google