ECON 251 Research Methods 11. Time Series Analysis and Forecasting.

Slides:



Advertisements
Similar presentations
Decomposition Method.
Advertisements

©The McGraw-Hill Companies, Inc. 2008McGraw-Hill/Irwin Lesson 12.
Time Series and Forecasting
19- 1 Chapter Nineteen McGraw-Hill/Irwin © 2005 The McGraw-Hill Companies, Inc., All Rights Reserved.
1 BIS APPLICATION MANAGEMENT INFORMATION SYSTEM Advance forecasting Forecasting by identifying patterns in the past data Chapter outline: 1.Extrapolation.
Ka-fu Wong © 2003 Chap Dr. Ka-fu Wong ECON1003 Analysis of Economic Data.
Analyzing and Forecasting Time Series Data
Data Sources The most sophisticated forecasting model will fail if it is applied to unreliable data Data should be reliable and accurate Data should be.
1 Spreadsheet Modeling & Decision Analysis: A Practical Introduction to Management Science, 3e by Cliff Ragsdale.
Chapter 3 Forecasting McGraw-Hill/Irwin
Part II – TIME SERIES ANALYSIS C2 Simple Time Series Methods & Moving Averages © Angel A. Juan & Carles Serrat - UPC 2007/2008.
Forecasting McGraw-Hill/Irwin Copyright © 2012 by The McGraw-Hill Companies, Inc. All rights reserved.
McGraw-Hill/Irwin Copyright © 2010 by The McGraw-Hill Companies, Inc. All rights reserved. Time Series and Forecasting Chapter 16.
Time Series and Forecasting
Slides 13b: Time-Series Models; Measuring Forecast Error
CHAPTER 18 Models for Time Series and Forecasting
© 2003 Prentice-Hall, Inc.Chap 12-1 Business Statistics: A First Course (3 rd Edition) Chapter 12 Time-Series Forecasting.
Lecture 4 Time-Series Forecasting
1 1 Slide © 2009 South-Western, a part of Cengage Learning Chapter 6 Forecasting n Quantitative Approaches to Forecasting n Components of a Time Series.
Slides by John Loucks St. Edward’s University.
© 2002 Prentice-Hall, Inc.Chap 13-1 Statistics for Managers using Microsoft Excel 3 rd Edition Chapter 13 Time Series Analysis.
Chapter 15 Time-Series Forecasting and Index Numbers
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Copyright © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
Demand Management and Forecasting
Forecasting and Statistical Process Control MBA Statistics COURSE #5.
Non-continuous Relationships If the relationship between the dependent variable and an independent variable is non-continuous a slope dummy variable can.
TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS
1 Least squares procedure Inference for least squares lines Simple Linear Regression.
Business Forecasting Used to try to predict the future Uses two main methods: Qualitative – seeking opinions on which to base decision making – Consumer.
1 Spreadsheet Modeling & Decision Analysis: A Practical Introduction to Management Science, 3e by Cliff Ragsdale.
Copyright © 2015 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
DSc 3120 Generalized Modeling Techniques with Applications Part II. Forecasting.
MBA.782.ForecastingCAJ Demand Management Qualitative Methods of Forecasting Quantitative Methods of Forecasting Causal Relationship Forecasting Focus.
Time Series Analysis and Forecasting
© 2000 Prentice-Hall, Inc. Chap The Least Squares Linear Trend Model Year Coded X Sales
Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc Chapter 20 Time Series Analysis and Forecasting.
Time Series Analysis and Forecasting
© 1999 Prentice-Hall, Inc. Chap Chapter Topics Component Factors of the Time-Series Model Smoothing of Data Series  Moving Averages  Exponential.
Economics 173 Business Statistics Lecture 23 © Fall 2001, Professor J. Petry
Time Series Analysis and Forecasting. Introduction to Time Series Analysis A time-series is a set of observations on a quantitative variable collected.
Economics 173 Business Statistics Lecture 26 © Fall 2001, Professor J. Petry
Economics 173 Business Statistics Lecture 25 © Fall 2001, Professor J. Petry
Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.Chap 16-1 Statistics for Managers Using Microsoft® Excel 5th Edition Chapter.
Time Series and Forecasting
Economics 173 Business Statistics Lecture 27 © Fall 2001, Professor J. Petry
1 1 Chapter 6 Forecasting n Quantitative Approaches to Forecasting n The Components of a Time Series n Measures of Forecast Accuracy n Using Smoothing.
Forecasting is the art and science of predicting future events.
Time Series and Forecasting Chapter 16 McGraw-Hill/Irwin Copyright © 2012 by The McGraw-Hill Companies, Inc. All rights reserved.
MBF1413 | Quantitative Methods Prepared by Dr Khairul Anuar 8: Time Series Analysis & Forecasting – Part 1
Chapter 20 Time Series Analysis and Forecasting. Introduction Any variable that is measured over time in sequential order is called a time series. We.
©The McGraw-Hill Companies, Inc. 2008McGraw-Hill/Irwin Time Series and Forecasting Chapter 16.
Managerial Decision Modeling 6 th edition Cliff T. Ragsdale.
Demand Management and Forecasting Chapter 11 Portions Copyright © 2010 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin.
Statistics for Business and Economics Module 2: Regression and time series analysis Spring 2010 Lecture 7: Time Series Analysis and Forecasting 1 Priyantha.
Forecast 2 Linear trend Forecast error Seasonal demand.
Chapter 20 Time Series Analysis and Forecasting. Introduction Any variable that is measured over time in sequential order is called a time series. We.
Economics 173 Business Statistics Lecture 28 © Fall 2001, Professor J. Petry
Chapter 3 Lect 6 Forecasting. Seasonality – Repetition at Fixed Intervals Seasonal variations –Regularly repeating movements in series values that can.
Forecasting. Model with indicator variables The choice of a forecasting technique depends on the components identified in the time series. The techniques.
Chapter 11 – With Woodruff Modications Demand Management and Forecasting Copyright © 2010 by The McGraw-Hill Companies, Inc. All rights reserved.McGraw-Hill/Irwin.
TIME SERIES MODELS. Definitions Forecast is a prediction of future events used for planning process. Time Series is the repeated observations of demand.
Yandell – Econ 216 Chap 16-1 Chapter 16 Time-Series Forecasting.
Lecture 9 Forecasting. Introduction to Forecasting * * * * * * * * o o o o o o o o Model 1Model 2 Which model performs better? There are many forecasting.
Keller: Stats for Mgmt & Econ, 7th Ed
Chapter Nineteen McGraw-Hill/Irwin
Statistics for Managers using Microsoft Excel 3rd Edition
MBF1413 | Quantitative Methods Prepared by Dr Khairul Anuar
Chapter Nineteen McGraw-Hill/Irwin
Exponential Smoothing
TIME SERIES MODELS – MOVING AVERAGES.
Presentation transcript:

ECON 251 Research Methods 11. Time Series Analysis and Forecasting

Introduction Any variable that is measured over time in sequential order is called a time series. We analyze time series to detect patterns. The patterns help in forecasting future values of the time series. Future expected value The time series exhibit a downward trend pattern.

Components of a Time Series A time series can consist of four components. Long - term trend (T) Cyclical effect (C) Seasonal effect (S) Random variation (R) A trend is a long term relatively smooth pattern or direction, that persists usually for more than one year.

Components of a Time Series A time series can consists of four components. Long - term trend (T) Cyclical effect (C) Seasonal effect (S) Random variation (R) A cycle is a wavelike pattern describing a long term behavior (for more than one year). 6-88 12-88 6-89 12-89 6-90 Cycles are seldom regular, and often appear in combination with other components.

Components of a Time Series A time series can consists of four components. Long - term trend (T) Cyclical effect (C) Seasonal effect (S) Random variation (R) 6-88 12-88 6-89 12-89 6-90 The seasonal component of the time-series exhibits a short term (less than one year) calendar repetitive behavior.

Components of a Time Series A time series can consists of four components. Long - term trend (T) Cyclical effect (C) Seasonal effect (S) Random variation (R) Random variation comprises the irregular unpredictable changes in the time series. It tends to hide the other (more predictable) components. We try to remove random variation thereby, identify the other components.

Time-series models There are two commonly used time series models: The additive model The multiplicative model yt = Tt + Ct + St + Rt yt = Tt x Ct x St x Rt

Smoothing Techniques To produce a better forecast we need to determine which components are present in a time series To identify the components present in the time series, we need first to remove the random variation This can be easily done by smoothing techniques: moving averages exponential smoothing

Moving Averages A k-period moving average for time period t is the arithmetic average of the time series values where the period t is the center observation. Example: A 3-period moving average for period t is calculated by (yt+1 + yt + yt-1)/3. Example: A 5-period moving average for period t is calculated by (yt+2 + yt+1 + yt + yt-1 + yt-2)/5.

Example: Gasoline Sales To forecast future gasoline sales, the last four years quarterly sales were recorded. Calculate the three-quarter and five-quarter moving average. Data

(yt+2 + yt+1 + yt + yt-1 + yt-2)/5 3 period moving average (yt+1 + yt + yt-1)/3 5 period moving average (yt+2 + yt+1 + yt + yt-1 + yt-2)/5 Solution Solving by hand *

Example: Gasoline Sales Notice how the averaging process removes some of the random variation. There is some trend component present, as well as seasonality.

Example: Gasoline Sales The 5-period moving average removes more variation than the 3-period moving average. Too much smoothing may eliminate patterns of interest. Here, the seasonality component is removed when using 5-period moving average. Too little smoothing leaves much of the variation, which disguises the real patterns. 5-period moving average 3-period moving average

Example – Armani’s Pizza Sales Below are the daily sales figures for Armani’s pizza. Compute a 3-day moving average. (Armani TS.xls) Week 1 Week 2 Monday 35 38 Tuesday 42 46 Wednesday 56 61 Thursday 46 52 Friday 67 73 Saturday 51 58 Sunday 39 42 The moving average that is associated with Monday of week 2 is?

Centered moving average With 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.

Example – Armani’s Pizza Sales Calculate the 4-period moving average and center it, for the data given below: Period Time series Moving Avg. Centerd Mov.Avg. 1 15 2 27 3 20 4 14 5 25 6 11 19.0 (2.5) 20.25 21.5 (3.5) 19.50 17.5 (4.5)

Example – Armani’s Pizza Sales Armani’s pizza is back. Compute a 2-day centered moving average. Week 1 Monday 35 Tuesday 42 Wednesday 56 Thursday 46 Friday 67 Saturday 51 Sunday 39 The centered moving average that is associated with Friday of week 1 is?

Components of a Time Series A time series can consist of four components. Long - term trend (T) Cyclical effect (C) Seasonal effect (S) Random variation (R) A trend is a long term relatively smooth pattern or direction, that persists usually for more than one year.

Trend Analysis The trend component of a time series can be linear or non-linear. It is easy to isolate the trend component by using linear regression. For linear trend use the model y = b0 + b1t + e. For non-linear trend with one (major) change in slope use the quadratic model y = b0 + b1t + b2t2 + e

Example – Pharmaceutical Sales (Identify trend) Annual sales for a pharmaceutical company are believed to change linearly over time. Based on the last 10 year sales records, measure the trend component. Start by renaming your years 1, 2, 3, etc.

Example – Pharmaceutical Sales (Identify trend) Solution Using Excel we have Forecast for period 11 11

Example – Cigarette Consumption Determine the long-term trend of the number of cigarettes smoked by Americans 18 years and older. Data (Cigarettes.xls) Solution Cigarette consumption increased between 1955 and 1963, but decreased thereafter. A quadratic model seems to fit this pattern.

Example – Cigarette Consumption The quadratic model fits the data very well.

Example Forecast the trend components for the previous two examples for periods 12, and 41 respectively.

Components of a Time Series A time series can consists of four components. Long - term trend (T) Cyclical effect (C) Seasonal effect (S) Random variation (R) A cycle is a wavelike pattern describing a long term behavior (for more than one year). 6-88 12-88 6-89 12-89 6-90 Cycles are seldom regular, and often appear in combination with other components.

Measuring the Cyclical Effects Although often unpredictable, cycles need to be isolated. To identify cyclical variation we use the percentage of trend. Determine the trend line (by regression). Compute the trend value for each period t. Calculate the percentage of trend by

Example – Energy Demand Does the demand for energy in the US exhibit cyclic behavior over time? Assume a linear trend and calculate the percentage of trend. Data (Energy Demand.xls) The collected data included annual energy consumption from 1970 through 1993. Find the values for trend and percentage of trend for years 1975 and 1976.

Example – Energy Demand Now consider the multiplicative model (Assuming no seasonal effects). No trend is observed, but cyclicality and randomness still exist. The regression line represents trend.

(66.4/69.828)100 When groups of the percentage of trend alternate around 100%, the cyclical effects are present.

Components of a Time Series A time series can consists of four components. Long - term trend (T) Cyclical effect (C) Seasonal effect (S) Random variation (R) The seasonal component of the time-series exhibits a short term (less than one year) calendar repetitive behavior. 6-88 12-88 6-89 12-89 6-90

Measuring the Seasonal effects Seasonal variation may occur within a year or even within a shorter time interval. To measure the seasonal effects we can use two common methods: constructing seasonal indexes using indicator variables We will do each in turn

Example – Hotel Occupancy Calculate the quarterly seasonal indexes for hotel occupancy rate in order to measure seasonal variation. Data (Hotel Occupancy.xls)

Example – Hotel Occupancy Perform regression analysis for the model y = b0 + b1t + e where t represents the chronological time, and y represents the occupancy rate. Time (t) Rate 1 0.561 2 0.702 3 0.800 4 0.568 5 0.575 6 0.738 7 0.868 8 0.605 . . The regression line represents trend.

Example – Hotel Occupancy Now let’s consider the multiplicative model, and let’s DETREND data (Assuming no cyclical effects) The regression line represents trend. No trend is observed, but seasonality and randomness still exist.

Example – Hotel Occupancy To remove most of the random variation but leave the seasonal effects, average the terms StRt for each season. Average ratio for quarter 1: (.870 + .864 + .865 + .879 + .913)/5 = .878 Average ratio for quarter 2: (1.080+1.100+1.067+.993+1.138)/5 = 1.076 Average ratio for quarter 3: (1.222+1.284+1.046+1.123+1.182)/5 = 1.171 Average ratio for quarter 4: (.861 +.888 + .854 + .874 + .900)/ 5 = .875

Example – Hotel Occupancy Interpreting the results The seasonal indexes tell us what is the ratio between the time series value at a certain season, and the overall seasonal average. In our problem: 17.1% above the annual average Quarter 3 Quarter 3 87.8% 107.6% 117.1% 87.5% 7.6% above the annual average 12.5% below the annual average Annual average occupancy (100%) Quarter 2 Quarter 2 12.2% below the annual average Quarter 1 Quarter 1 Quarter 4 Quarter 4

Creating Seasonal Indexes Normalizing the ratios: The sum of all the ratios must be 4, such that the average ratio per season is equal to 1. If the sum of all the ratios is not 4, we need to normalize (adjust) them proportionately. Suppose the sum of ratios equaled 4.1. Then each ratio will be multiplied by 4/4.1 (Seasonal averaged ratio) (number of seasons) Sum of averaged ratios Seasonal index = In our problem the sum of all the averaged ratios is equal to 4: .878 + 1.076 + 1.171 + .875 = 4.0. No normalization is needed. These ratios become the seasonal indexes.

Example Using a different example on quarterly GDP, assume that the averaged ratios were: Quarter 1: .97 Quarter 2: 1.03 Quarter 3: .87 Quarter 4: 1.00 Determine the seasonal indexes.

Deseasonalizing time series Seasonally adjusted time series = Actual time series Seasonal index By removing the seasonality, we can: compare data across different seasons identify changes in the other components of the time - series.

Example – Hotel Occupancy A new manager was hired in Q3 1994, when hotel occupancy rate was 80.6%. In the next quarter, the occupancy rate was 63.2%. Should the manager be fired because of poor performance? Method 1: compare occupancy rates in Q4 1994 (0.632) and Q3 1994 (0.806) the manager has underperformed  he should be fired Method 2: compare occupancy rates in Q4 1994 (0.632) and Q4 1993 (0.600) the manager has performed very well  he should get a raise

Example – Hotel Occupancy Method 3: compare deseasonalized occupancy rates in Q4 1994 and Q3 1994 Seasonally adjusted time series = Actual time series Seasonal index Recall: Seasonally adjusted occupancy rate in Q4 1994 Actual occupancy rate in Q4 1994 Seasonal index for Q4 = Seasonally adjusted occupancy rate in Q3 1994 the manager has indeed performed well  he should be maybe get a raise

Recomposing the time series Recomposition will recreate the time series, based only on the trend and seasonal components – you can then deduce the value of the random component. In period #1 ( quarter 1): In period #2 ( quarter 2): Actual series Smoothed series The linear trend (regression) line

Example – Recomposing the Time Series Recompose the smoothed time series in the above example for periods 3 and 4 assuming our initial seasonal index figures of: Quarter 1: 0.878 Quarter 3: 1.171 Quarter 2: 1.076 Quarter 4: 0.875 and equation of:

Seasonal Time Series with Indicator Variables We create a seasonal time series model by using indicator variables to determine whether there is seasonal variation in data. Then, we can use this linear regression with indicator variables to forecast seasonal effects. If there are n seasons, we use n-1 indicator variables to define the season of period t: [Indicator variable n] = 1 if season n belongs to period t [Indicator variable n] = 0 if season n does not belong to period t

Example – Hotel Occupancy Let’s again build a model that would be able to forecast quarterly occupancy rates at a luxurious hotel, but this time we will use a different technique. Data (Hotel Occupancy.xls)

Example – Hotel Occupancy Use regression analysis and indicator variables to forecast hotel occupancy rate in 1996 Data Qi = 1 if quarter i occur at t 0 otherwise Quarter 1 belongs to t = 1 Quarter 2 does not belong to t = 1 Quarter 3 does not belong to t = 1 Quarters 1, 2, 3, do not belong to period t = 4.

The regression model y = b0 + b1t + b2Q1 + b3Q2 + b4Q3 +e There is insufficient evidence to conclude that seasonality causes occupancy rate in quarter 1 be different than this of quarter 4! There is sufficient evidence to conclude that trend is present. Good fit Seasonality effects on occupancy rate in quarter 2 and 3 are different than this of quarter 4!

The estimated regression model y = b0 + b1t + b2Q1 + b3Q2 + b4Q3 +e 1 2 3 4 b2 b3 b4 Trend line b0

Time-Series Forecasting with Autoregressive (AR) models Autocorrelation among the errors of the regression model provides opportunity to produce accurate forecasts. Correlation between consecutive residuals leads to the following autoregressive model: This is type of model is termed a first-order autoregressive model, and is denoted AR(1). A model which also includes both yt-1 and yt-2 is a second order model AR(2) and so on. Selecting between them is done on the basis of the significance of the highest order term. If you reject the highest order term, re-run the model without it. Apply the same criterion for the new highest order term, and so on. yt = b0 + b1yt-1 + et

Example – Consumer Price Index (CPI) Forecast the increase in the Consumer Price Index (CPI) for the year 1994, based on the data collected for the years 1951 -1993. Data (CPI.xls)

Example – Consumer Price Index (CPI) Regress the Percent increase (yt) on the time variable (t)  it does not lead to good results. The residuals form a pattern over time. Also, Yt = 2.14 + .098t r2 = 15.0% this indicates the potential presence of first order autocorrelation between consecutive residuals. (+) (-) (-)

Example – Consumer Price Index (CPI) An autoregressive model appears to be a desirable technique. The increase in the CPI for periods 1, 2, 3,… are predictors of the increase in the CPI for periods 2, 3, 4,…, respectively.

Compare linear trend model autoregressive model

Selecting Among Alternative Forecasting Models There are many forecasting models available ? * o o * o o o o o o Model 1 Model 2 Which model performs better?

Model selection To choose a forecasting method, we can evaluate forecast accuracy using the actual time series. The two most commonly used measures of forecast accuracy are: Mean Absolute Deviation Sum of Squares for Forecast Error In practice, SSE is SSFE are used interchangeably.

Model selection 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 using both MAD and SSE criterion. Use the model which generates the lowest MAD value, unless it is important to avoid (even a few) large errors - in this case use best model as indicated by the lowest SSE.

Example – Model selection I Assume we have annual data from 1950 to 2001. We used data from 1950 to 1997 to develop three alternate forecasting models (two different regression models and an autoregressive model), Use MAD and SSE to determine which model performed best using the model forecasts versus the actual data for 1998-2001.

Example – Model selection I Solution For model 1 Summary of results Actual y in 1998 Forecast for y in 1998

Example – Model selection II For the actual values and the forecast values of a time series shown in the following table, calculate MAD and SSE. Forecast Value Actual Value MAD SSE Ft yt 173 166 186 179 192 195 211 214 223 220