Module 6: Introduction to Time Series Forecasting



Similar documents
MGT 267 PROJECT. Forecasting the United States Retail Sales of the Pharmacies and Drug Stores. Done by: Shunwei Wang & Mohammad Zainal

Week TSX Index

Exponential Smoothing with Trend. As we move toward medium-range forecasts, trend becomes more important.

A Primer on Forecasting Business Performance

Demand forecasting & Aggregate planning in a Supply chain. Session Speaker Prof.P.S.Satish

Industry Environment and Concepts for Forecasting 1

Not Your Dad s Magic Eight Ball

Section A. Index. Section A. Planning, Budgeting and Forecasting Section A.2 Forecasting techniques Page 1 of 11. EduPristine CMA - Part I

CALL VOLUME FORECASTING FOR SERVICE DESKS

FORECASTING. Operations Management

Demand Forecasting When a product is produced for a market, the demand occurs in the future. The production planning cannot be accomplished unless

Simple Methods and Procedures Used in Forecasting

Module 5: Multiple Regression Analysis

Regression and Time Series Analysis of Petroleum Product Sales in Masters. Energy oil and Gas

Methodology For Illinois Electric Customers and Sales Forecasts:

Outline: Demand Forecasting

Time series forecasting

Time-Series Forecasting and Index Numbers

Ch.3 Demand Forecasting.

Promotional Forecast Demonstration

TIME SERIES ANALYSIS

Forecasting the first step in planning. Estimating the future demand for products and services and the necessary resources to produce these outputs

CHAPTER 11 FORECASTING AND DEMAND PLANNING

Forecasting DISCUSSION QUESTIONS

Forecasting in STATA: Tools and Tricks

Time Series AS This Is How You Do. Kim Freeman

business statistics using Excel OXFORD UNIVERSITY PRESS Glyn Davis & Branko Pecar

8. Time Series and Prediction

Forecasting in supply chains

Time series Forecasting using Holt-Winters Exponential Smoothing

Module 3: Correlation and Covariance

MICROSOFT EXCEL FORECASTING AND DATA ANALYSIS

2. What is the general linear model to be used to model linear trend? (Write out the model) = or

Indian School of Business Forecasting Sales for Dairy Products

OBJECTIVE ASSESSMENT OF FORECASTING ASSIGNMENTS USING SOME FUNCTION OF PREDICTION ERRORS

Introduction to time series analysis

Smoothing methods. Marzena Narodzonek-Karpowska. Prof. Dr. W. Toporowski Institut für Marketing & Handel Abteilung Handel

IBM SPSS Forecasting 22

Baseline Forecasting With Exponential Smoothing Models

2. Simple Linear Regression

Market Potential and Sales Forecasting

Comparative Study of Demand Forecast Accuracy for Healthcare Products Using Linear and Non Linear Regression

2) The three categories of forecasting models are time series, quantitative, and qualitative. 2)

Data Analysis Tools. Tools for Summarizing Data

2013 MBA Jump Start Program. Statistics Module Part 3

TIME SERIES ANALYSIS

INCREASING FORECASTING ACCURACY OF TREND DEMAND BY NON-LINEAR OPTIMIZATION OF THE SMOOTHING CONSTANT

I. Introduction. II. Background. KEY WORDS: Time series forecasting, Structural Models, CPS

This content downloaded on Tue, 19 Feb :28:43 PM All use subject to JSTOR Terms and Conditions

Demand Forecasting LEARNING OBJECTIVES IEEM Understand commonly used forecasting techniques. 2. Learn to evaluate forecasts

Time Series Analysis. 1) smoothing/trend assessment

Integrated Resource Plan

NCSS Statistical Software Principal Components Regression. In ordinary least squares, the regression coefficients are estimated using the formula ( )

Simple Predictive Analytics Curtis Seare

Engineering Problem Solving and Excel. EGN 1006 Introduction to Engineering

MULTIPLE LINEAR REGRESSION ANALYSIS USING MICROSOFT EXCEL. by Michael L. Orlov Chemistry Department, Oregon State University (1996)

Change-Point Analysis: A Powerful New Tool For Detecting Changes

Chapter 27 Using Predictor Variables. Chapter Table of Contents

Chapter 25 Specifying Forecasting Models

Lecture 4: Seasonal Time Series, Trend Analysis & Component Model Bus 41910, Time Series Analysis, Mr. R. Tsay

Using Excel s Analysis ToolPak Add-In

When someone asks, How s the economy. A New Look at Economic Indexes for the States in the Third District. Theodore M. Crone*

TIME SERIES ANALYSIS & FORECASTING

Forecasting Methods. What is forecasting? Why is forecasting important? How can we evaluate a future demand? How do we make mistakes?

7 Time series analysis

c 2015, Jeffrey S. Simonoff 1

Time Series Analysis: Basic Forecasting.

Jinadasa Gamage, Professor of Mathematics, Illinois State University, Normal, IL, e- mail:

Time Series Analysis

1) Write the following as an algebraic expression using x as the variable: Triple a number subtracted from the number

(More Practice With Trend Forecasts)

RELEVANT TO ACCA QUALIFICATION PAPER P3. Studying Paper P3? Performance objectives 7, 8 and 9 are relevant to this exam

TIME SERIES ANALYSIS. A time series is essentially composed of the following four components:

Chapter 7: Simple linear regression Learning Objectives

Using Excel (Microsoft Office 2007 Version) for Graphical Analysis of Data

4. Simple regression. QBUS6840 Predictive Analytics.

Slides Prepared by JOHN S. LOUCKS St. Edward s University

Agenda. Managing Uncertainty in the Supply Chain. The Economic Order Quantity. Classic inventory theory

Regression step-by-step using Microsoft Excel

Below is a very brief tutorial on the basic capabilities of Excel. Refer to the Excel help files for more information.

A Short Tour of the Predictive Modeling Process

1. What is the critical value for this 95% confidence interval? CV = z.025 = invnorm(0.025) = 1.96

KSTAT MINI-MANUAL. Decision Sciences 434 Kellogg Graduate School of Management

Time Series Analysis

Statistics 104 Final Project A Culture of Debt: A Study of Credit Card Spending in America TF: Kevin Rader Anonymous Students: LD, MH, IW, MY

Business Valuation Review

Causal Forecasting Models

How To Analyze Data In Excel 2003 With A Powerpoint 3.5

Financial Planning using Excel

Univariate Regression

Forecasting of Paddy Production in Sri Lanka: A Time Series Analysis using ARIMA Model

MULTIPLE REGRESSIONS ON SOME SELECTED MACROECONOMIC VARIABLES ON STOCK MARKET RETURNS FROM

CB Predictor 1.6. User Manual

USING TIME SERIES CHARTS TO ANALYZE FINANCIAL DATA (Presented at 2002 Annual Quality Conference)

Production Planning. Chapter 4 Forecasting. Overview. Overview. Chapter 04 Forecasting 1. 7 Steps to a Forecast. What is forecasting?

Predictor Coef StDev T P Constant X S = R-Sq = 0.0% R-Sq(adj) = 0.

16 : Demand Forecasting

Chapter 12. Aggregate Expenditure and Output in the Short Run

Simple Regression Theory II 2010 Samuel L. Baker

Transcription:

Using Statistical Data to Make Decisions Module 6: Introduction to Time Series Forecasting Titus Awokuse and Tom Ilvento, University of Delaware, College of Agriculture and Natural Resources, Food and Resource Economics T The last module examined the multiple regression modeling techniques as a tool for analyzing financial data. Multiple regression is a commonly used technique for explaining the relationship between several variables of interest. Although financial analysts are interested in explaining the relationship between correlated variables, they also want to know the future trend of key variables. Business managers and policymakers regularly use forecasts of financial variables to help make important decisions about production, purchases, market conditions, and other choices about the best allocation of resources. How are these decisions made and what forecasting techniques are used? Are the forecasts accurate and reliable? This module introduces some basic skills for analyzing and forecasting data over time. We will discuss several forecasting techniques and how they are used in generating forecasts. Furthermore, we will also examine important issues on how to evaluate and judge the accuracy of forecasts and discuss some of the common challenges to developing good forecasts. BASICS OF FORECASTING Time series are any univariate or multivariate quantitative data collected over time either by private or government agencies. Common uses of time series data include: 1) modeling the relationships between various time series; 2) forecasting the underlying behavior of the data; and 3) forecasting what effect changes in one variable may have on the future behavior of another variable. There are two major categories of forecasting approaches: Qualitative and Quantitative. Key Objectives Understand the basic components of forecasting including qualitative and quantitative techniques Understand the three types of time series forecasts Understand the basic characteristics and terms of forecasts See an example of a forecast using trend analysis In this Module We Will: Run a time series forecast with trend data using Excel Compare a linear and nonlinear trend analysis Qualitative Techniques: Qualitative techniques refer to a number of forecasting approaches based on subjective estimates from informed experts. Usually, no statistical data analysis is involved. Rather, estimates are based on a deliberative process of a group of experts, based on their For more information, contact: Tom Ilvento 213 Townsend Hall, Newark, DE 19717 302-831-6773 ilvento@udel.edu

Using Statistical Data to Make Decisions: Time Series Forecasting Page 2 past knowledge and experience. Examples are the Delphi technique and scenario writing, where a panel of experts are asked a series of questions on future trends, the answers are recorded and shared back to the panel, and the process is repeated so that the panel builds a shared scenario. The key to these approaches is a recognition that forecasting is subjective, but if we involve knowledgeable people in a process we may get good insights into future scenarios. This approach is useful when good data are not available, or we wish to gain general insights through the opinions of experts. Quantitative Techniques: refers to forecasting based on the analysis of historical data using statistical principles and concepts. The quantitative forecasting approach is further sub-divided into two parts: causal techniques and time series techniques. Causal techniques are based on regression analysis that examines the relationship between the variable to be forecasted and other explanatory variables. In contrast, Time Series techniques usually use historical data for only the variable of interest to forecast its future values (See Table 1 below). Table 1. Alternative Forecasting Approaches Categories Application Specific Techniques Qualitative Techniques Casual Techniques Time Series Techniques Useful when historical data are scare or non-existent Useful when historical data are available for both the dependent (forecast) and the independent variables Useful when historical data exists for forecast variable and the data exhibits a pattern Delphi Technique Scenario Writing Visionary Forecast Historic Analogies Regression Models Econometric Models Leading Indicators Correlation Methods Moving Average Autoregression Models Seasonal Regression Models Exponential Smoothing Trend Projection Cointegration Models Forecast horizon: The forecast horizon is defined as the number of time periods between the current period and the date of a future forecast. For example, for the case of monthly data, if the current period is month T, then a forecast of sales for month T+3 has a forecast horizon of three steps. For quarterly data, a step is one quarter (three months), but

Using Statistical Data to Make Decisions: Time Series Forecasting Page 3 for annual data, one step is one year (twelve months). The forecast changes with the forecast horizon. The choice of the best and most appropriate forecasting models and strategy usually depends on the forecasting horizon. Three Types of Time Series Forecasts Point Forecast: a single number or a "best guess." It does not provide information on the level of uncertainty around the point estimate/forecast. For example, an economist may forecast a 10.5% growth in unemployment over the next six months. Interval Forecast: relative to a point forecast, this is a range of forecasted values which is expected to include the actual observed value with some probability. For example, an economist may forecast growth in unemployment rate to be in the interval, 8.5% to 12.5%. An interval forecast is related to the concept of confidence intervals. Density Forecast: this type of forecast provides information on the overall probability distribution of the future values of the time series of interest. For example, the density forecast of future unemployment rate growth might be normally distributed with a mean of 8.3% and a standard deviation of 1.5%. Relative to the point forecast, both the density and the interval forecasts provide more information since we provide more than a single estimate, and we provide a probability context for the estimate. However, despite the importance and more comprehensive information contained in density and interval forecasts, they are rarely used by businesses. Rather, the point forecast is the most commonly used type of forecast by businesses managers and policymakers. CHARACTERISTICS OF TIME SERIES Any given time series can be divided into four categories: trend, seasonal components, cyclical components, and random fluctuations. Trend. The trend is a long-term, persistent downward or upward change in the time series value. It represents the general tendency of a variable over an extended time period. We usually observe a steady increase or decline in the values of a time series over a given time period. We can characterize an observed trend as linear or non-linear. For example, a data plot of U.S. overall retail sales data over the 1955-1996 time period exhibits an upward trend, which may be reflecting the increase in the purchases of consumer durables and non-durables over time (See Figure 1). The

Using Statistical Data to Make Decisions: Time Series Forecasting Page 4 Monthly U.S. Retail Sales, 1955 to 1996 Millions Dollars $200,000 $175,000 $150,000 $125,000 $100,000 $75,000 $50,000 $25,000 $0 Oct-54 Jun-57 Mar-60 Dec-62 Sep-65 Jun-68 Mar-71 Dec-73 Monthly Trend Aug-76 May-79 Feb-82 Nov-84 Aug-87 May-90 Jan-93 Oct-95 Jul-98 Figure 1. Time Series Plot of Monthly U.S. Retail Sales, 1955 to 1996 plot in Figure 1 shows a nonlinear trend - sales were increasing at an increasing rate. This type of relationship is a curvilinear trend best represented by a polynomial regression. Seasonal Components. Seasonal components to a time series refer to a regular change in the data values of a time series that occurs at the same time every year. This is a very common characteristic of financial and other business related data. The seasonal repetition may be exact (deterministic seasonality) or approximate (stochastic seasonality). Sources of seasonality are technologies, preferences, and institutions that are linked to specific times of the year. It may be appropriate to remove seasonality before modeling macroeconomic time series (seasonally adjusted series) since the emphasis is usually on nonseasonal fluctuations of macroeconomic series. However, the removal of seasonal components is not appropriate when forecasting business variables. It is important to account for all possible sources of variation in business time series. U.S. Monthly Housing Starts, 1990 to 2003 Thousands of Starts 200 180 160 140 120 100 80 60 40 20 0 Jan-90 Sep-92 Jun-95 Mar-98 Dec-00 Sep-03 Figure 2. Graph of Seasonal Fluctuations in Housing Starts

Using Statistical Data to Make Decisions: Time Series Forecasting Page 5 For example, retail sales of many household and clothing products are very high during the fourth quarter of the year. This is a reflection of Christmas seasonal purchases. Also, as shown in Figure 2, housing starts exhibits seasonal patterns as most houses are started in the spring while the winter period shows very low numbers of home construction due to the colder weather. Figure 3 shows the same data, seasonally adjusted by the Census Bureau. Notice now the regular pattern of sharp fluctuations has disappeared from the adjusted figures. U.S. Monthly Housing Starts Adjusted for Seasonality, 1990 to 2003 200 Thousands of Starts 150 100 50 0 Jan-90 Sep-92 Jun-95 Mar-98 Dec-00 Sep-03 Figure 3. Seasonally Adjust Housing Starts Cyclical Components: refer to periodic increases and decreases that are observed over more than a one-year period. In contrast to seasonal components, these types of variation are also known as business cycles. They cover a longer time period and are not subject to a systematic pattern that is easily predictable. Cyclical variation can produce peak periods known as booms, and trough periods known as recessions. Although economist may try, it is not easy to predict economic booms and recessions. Random (Irregular) Components: refer to irregular variations in time series that are not due to any of the three time series components: trend, seasonality, and cyclical. This is also known as residual or error component. This component is not predictable and is usually eliminated from the time series through data smoothing techniques. Stationary Time Series refers to a time series without a trend, seasonal, or cyclical components. A stationary time series contains only a random error component. Analysis of time series always assumes that the value of the variable, Y t, at time period t, is equal to the sum of the four components and is represented by: Y t = T t + S t +C t + R t

Using Statistical Data to Make Decisions: Time Series Forecasting Page 6 TIME SERIES DATA MODIFICATION STRATEGIES When dealing with data over time, there are several things we might do to adjust, smooth, or otherwise modify data before we begin our analysis. Some of these strategies are relatively straightforward while others involve a more elaborate model which requires decisions on our part. Within the regression format that we are emphasizing, some of these techniques can be built into the regression model as an alternative to modifying the data. Adjusting For Inflation. Often time series data involve financial variables, such as income, expenditures, or revenues. Financial data over time are influenced by inflation. The longer the time series (in years), the more potential for inflation to be a factor in the data. With financial data over time, part of the trend may simply be a reflection of inflation. While there may be an upward trend in sales, part of the result might be a function of inflation and not real growth. The dominant strategy to deal with inflation is to adjust the data by the Consumer Price Index (CPI), or a similar index that is geared toward a specific commodity or sector of the economy. For example, we might use a health care index when dealing with health expenditures because this sector of the economy has experienced higher inflation than general commodities. The CPI is an index based on a basket of market goods. The Bureau of Labor Statistics calculates these indices on an annual basis, often breaking it down by region of the country and commodity. There are many places to find the consumer price index. The following are two useful Internet sites which contain CPI indices as well as definitions and discussions about their use. Bureau of Labor http://www.bls.gov/cpi/home.htm#overview Minneapolis Federal Reserve Bank http://minneapolisfed.org/research/data/us/calc/index.cfm Using the CPI to adjust your data is relatively straight forward. The index is often based on 100 and is centered around a particular year. The other years are expressed as being above (>100) or below (<100) the base year. However, any year can be thought of the base year. In order to adjust our data for inflation in Excel, we would obtain the CPI index for the years in our time series and use this index to create a new variable which is expressed in dollars for one of the time periods. An example is given in Table 2. The base year is 2002, so a CPI Ratio is calculated as the CPI for 2002 (179.9) divided by each years CPI. The CPI ratio is then multiplied by the Loss figure to calculate an adjusted loss, expressed in 2002 dollars.

Using Statistical Data to Make Decisions: Time Series Forecasting Page 7 Table 2. U.S. Flood Insurance Losses Adjusted by the CPI for 2002 Dollars, Partial Table, 1978 to 2002 Loss 1 Trend CPI CPI Ratio Adj Loss $147,719 1978 65.2 2.76 $407,587 $483,281 1979 72.6 2.48 $1,197,552 $230,414 1980 82.4 2.18 $503,053 $127,118 1981 90.9 1.98 $251,579 $198,296 1982 96.5 1.86 $369,673 $519,416 1997 160.5 1.12 $582,199 $885,658 1998 163.0 1.10 $977,484 $754,150 1999 166.6 1.08 $814,355 $250,796 2000 172.2 1.04 $262,010 $1,268,446 2001 177.1 1.02 $1,288,500 $338,624 2002 179.9 1.00 $338,624 1 Loss data are expressed in $1,000s Seasonal Data. Data that reflect a regular pattern that is tied to a time of year is referred to as seasonal data. Seasonal data will show up on a graph as a regular hills and valleys in the data across the trend. The seasons may reflect quarters, months, or some other regular reoccurring time period throughout the year. The best way to think of seasonal variations is that part of the pattern in the data reflect a seasonal component. In most cases we expect the seasonal variations and are not terribly concerned with explaining them. However, we do want to account for them when we make our estimate of the trend in the data. Seasonal variations may mask or impede our ability to model a trend. We can account for seasonal data in one of two main ways. The first is to deseasonalize the data by adjusting the data for seasonal effects. This often is done for us when we use government data that has already been adjusted. The second method is to account for the seasons within our model. In regression based models this is done through the use of dummy variables. In the latter approach, we use dummy variables to account for quarters (3 dummy variables) or months (11 dummy variables). The deseasonal adjustment is done through a ratio-tomoving-average method. The exact computations to do this are beyond the scope of this module. The computations, while involved and at times tedious, are not difficult to do with a spreadsheet program. This approach involves the following basic steps. 1. Calculate moving averages based on the number of seasons (4 for quarters, 12 for months) 2. Calculate a centered moving average when dealing with an even number of seasons. The center is the average of two successive moving averages to

Using Statistical Data to Make Decisions: Time Series Forecasting Page 8 center around a particular season. For example, the average of quarters 1 to 4, and quarters 2 to 5, would be added together and divided by two to give a centered moving average for quarter 3. 3. Calculate a ratio to moving average of a specific season s value by dividing the value by its centered moving average 4. Calculate an average ratio to moving average for each of the seasons in the time series, referred to as a seasonal index 5. Use this seasonal index to adjust each season in the time series Data are often available from secondary sources already adjusted. The Housing Start data used in this Module included data that were seasonally adjusted through a similar, but more sophisticated method as listed above. Whenever possible, use data that have already been adjusted by the agency or source that created the data. Most likely they will have the best method, experience, and knowledge to adjust the data. Using seasonally adjusted data in a modeling technique, such as regression, allows us to make a better estimate of the trend in the data. However, when we want to make a future prediction of forecast with a model using deseasonalized data, we need to add back in the seasonal component. In essence we have to readjust the forecast using the seasonal index to make an accurate forecast. The regression approach to deal with seasonal variations is to include the seasons into the model. This is done through the use of dummy variables. By including dummy variables that represent the seasons we are accounting for seasonal variation in the model. If the seasons are quarters (4 time periods), we will include three dummy variables with one quarter represented in the reference category. If the seasons are months, we will include 11 dummy variables with one month as the reference category. It does not matter which season is the reference category, but we must always have k-1 dummy variables in the model (where k equals the number of seasons). Let s look at an example of the regression approach which uses the U.S. monthly housing starts from 1990 to 2003. The data show a strong seasonal effect, as might be expected. Housing starts are highest in the spring through summer and lowest in November through February. There is a strong upward trend in the data which reflects growth in housing starts over time. Figure 2 shows this upward

Using Statistical Data to Make Decisions: Time Series Forecasting Page 9 trend with season fluctuations. The R 2 for the trend in the data is.45 and the estimate of the slope coefficient is.3609 (data not shown). The seasonal adjusted data provide a much better fit with a R 2 =.78 and the estimate of the slope coefficient for the trend is.3589 (data not shown). We have to be careful in comparing R 2 across these models because the dependent variable is not the same in both models, but clearly removing the seasonal component helped to improve the fit of the trend. The last model is the original data, unadjusted for seasonal variations, but dummy variables representing the months are included in the model. Since there are 12 months, 11 dummy variables were included in the model, labeled M1 (January) through M11 (November). The reference month is December and is represented in the intercept. The regression output from Excel is included in Table 3. The model shows significant improvement over the first model and R 2 increases from.45 to.87. Including the dummy variables for the months improved the fit of the model dramatically. The estimate for the slope coefficient for the trend is very similar to that estimated in the adjusted data (.3576). If we focus on the dummy variables, we can see that the coefficients for M1 (January) and M2 (February) are not significantly different from zero, indicating that housing starts for January and February are not significantly different as those for December, the reference category in the model. All the other dummy variable coefficients are significantly different from zero and follow an expected pattern - the coefficients are positive and get larger as we move toward the summer months. Both the deseasonalized model and the regression model with dummy season variables fit the data quite well. It is also comforting that the estimate for the trend is very similar in both models. Either approach will provide a simple but good model to make forecasts. The regression approach seemed to be the best model had the added advantage that forecasts from the model will directly include the seasonal component, unlike the deseasonalized model. The regression approach with dummy variables for season is relatively straight-forward and can easily be modeled with Excel.

Using Statistical Data to Make Decisions: Time Series Forecasting Page 10 Table 3. Regression Output of Housing Start Data Including Seasonal Dummy Variables Regression Statistics Multiple R 0.934 R Square 0.872 Adjusted R Square 0.862 Standard Error 9.725 Observations 168 ANOVA df SS MS F Sig F Regression 12 100092.725 8341.060 88.195 0.000 Residual 155 14659.199 94.575 Total 167 114751.924 Coef Std Error t Stat P-value Intercept 67.6221 2.950 22.921 0.000 Trend 0.3576 0.016 23.056 0.000 M1-5.5877 3.680-1.519 0.131 M2-1.6310 3.679-0.443 0.658 M3 24.5399 3.678 6.671 0.000 M4 37.1823 3.678 10.110 0.000 M5 41.8604 3.677 11.383 0.000 M6 41.6957 3.677 11.340 0.000 M7 37.3452 3.677 10.158 0.000 M8 35.1662 3.676 9.566 0.000 M9 29.4943 3.676 8.023 0.000 M10 33.4652 3.676 9.104 0.000 M11 12.3076 3.676 3.348 0.001 Data Smoothing. Data smoothing is a strategy to modify the data through a model to remove the random spikes and jerks in the data. We will look at two smoothing techniques, both of which are available in Excel - moving averages and exponential smoothing. Smoothing can be thought of as an alternative modeling approach to regression, or as an intermediate step to prepare the data for analysis in regression. The Moving Averages approach replaces data with an average of past values. In essence it fits a relatively simple model to the data which uses an average to model the data points. The rationale behind this approach is to not allow a single data point to have too much influence on the trend, by tempering it with observations surrounding or prior to the value. The result should provide modified data that shows the direction of the trend, but without the random noise that can hide or distort. The data are replaced with an average of past values that move forward

Using Statistical Data to Make Decisions: Time Series Forecasting Page 11 by a set span. For example, if we have annual data, we might replace each value with a span of a three or five year average. We would calculate the averages based on successive data points that move forward over time, so that each three year average uses two old and one new data point to calculate the new average. Please note, some approaches to moving averages have the modified value surrounded by the observations used in the average (some observations before the value and some after). Excel exclusively uses past values to calculate the moving average, so that the first three observations are used to estimate an average for the third observation in a 3-period moving average. With a three year average, we will lose two data points in our series because we can t calculate an average for the first or second year. The number of time periods for our moving average is a decision point which is influenced by the length of our series, the time units involved, and our experiences with the volatility of the data. If I have annual data for 20 years, I might not feel comfortable with a 5- year moving average because I would lose too many data points (four). However, if the data were collected monthly over the 20 years, a five or six month moving average would not be a limitation. We want to pick a number that provides a reasonable number of time periods so that extreme values are tempered in the series, but we don t want to lose too much information by picking a time span for the average that is too large. The longer the period of the span for the moving average, the less influence extreme values have in the calculation, and thus the smoother the data will be. However, too many observations in the calculation will distort the trend by smoothing out all of the trend. The decision point for the span (or interval in Excel) is part art and part science, and often requires an iterative process guided by experience. Let s look at an example with Excel using the housing start data. The data are given in months, and the series, from 1990 to 2003, provided 168 time periods. We have enough data to have flexibility with a longer moving average. I will use a 6 month moving average. In Excel this is accomplished fairly easily using the following commands. Tools Data Analysis Moving Average

Using Statistical Data to Make Decisions: Time Series Forecasting Page 12 It is wise to insert a blank column in the worksheet where you want the results to go and to label that column in advance. Within the Moving Average Menu, the options are relatively simple. Input Range Labels Interval Output Range Chart Output The source of the original time series A check box of whether the first row contains a label The span of the moving average, given as an integer (such as a 3, 4, or 5 period moving average) Where you want the new data to go (you only need to specify the first cell of the column). Excel will only put the results in the current worksheet. Please note, if you used a label for the original data, Excel will not create a label for the moving average. Therefore you should specify the first row of the data series, not the first label row. Excel provides a scatter plot of the original data and the smoothed data Standard Errors Excel will calculate standard errors of the estimates compared with the original data. Each calculated standard error is based on the interval specified for the moving average. The following table is part of the output for the housing start data (see Table 4). You can see that with a 6 interval moving average (translated as a 6-month moving average for our data), the first five observations are undefined for the new series. The sixth value is simply the sum of the first six observations, divided by 6. Value = (99.20+86.90+108.50+119.00+212.10+117.80)/6 Value = 108.75 The next value is calculated in a similar way: Value = (86.90+108.50+119.00+212.10+117.80+111.20)/6 Value = 110.75

Using Statistical Data to Make Decisions: Time Series Forecasting Page 13 Table 4. Partial Excel Output of a 6-Month Moving Average of the Housing Start Data Housing Starts 6-Month Avg 99.20 #N/A 86.90 #N/A 108.50 #N/A 119.00 #N/A 121.10 #N/A 117.80 108.75 111.20 110.75 102.80 113.40 93.10 110.83 The graph below shows the 6-month moving average data for housing starts plotted over time. The data still shows an upward trend with seasonal fluctuations, but clearly the revised data have removed some of the noise in the original time series. Moving averages is a simple and easy way to adjust the data, even if it is a first step before further analysis with more sophisticated methods. Care must be taken in choosing the span of the average - too little will not help, but too much risks smoothing the trend. Experience and an iterative approach usually guide most attempts at moving averages. U.S. Monthly Housing Starts based on 6-Month Moving Averages, 1990 to 2003 Thousands of Starts 180 160 140 120 100 80 60 40 20 0 Jan-90 Sep-92 Jun-95 Mar-98 Dec-00 Sep-03 Figure 4. Graph of a 6-Month Moving Average for U.S. Housing Starts, 1990 to 2003

Using Statistical Data to Make Decisions: Time Series Forecasting Page 14 Exponential Smoothing. Another approach at smoothing time series data is exponential smoothing. It forecasts data on a weighted average of past observations, but it places more weight on more recent observations to make its estimates. The model for exponential smoothing is more complicated than that of moving averages. The equations for exponential smoothing follow this format. F t+1 = F t + "(y t - F t ) or F t+1 = "y t + (1-")F t where: F t+1 = forecast value for period t+1 y t = Actual value for period t F t = Forecast value for period t " = Alpha (a smoothing constant where (0 # " #1) From this equation we can see that the forecast for the next period will equal the forecast mode for this period plus or minus an adjustment. We won t have to worry too much about the equations because Excel will make the calculations for us. However, we will have to specify the constant, ". Alpha (") will be a value between zero and one and it reflects how much weight is given to distant past values of y when making our forecast. A very low value of " (.1 to.3) means that more weight is given to past values, whereas a high value of " (.6 or higher) means that more weight is given to recent values and the forecast reacts more quickly to changes in the series. In this sense " is similar to the span in a moving average - low values of " are analogous to a higher span. You are required to choose alpha when forecasting with exponential smoothing. Excel uses a default value of.3. In Excel exponential smoothing is accomplished fairly easily using the following commands. Tools Data Analysis Exponential Smoothing It is wise to insert a blank column in the worksheet where you want the results to go and to label that column in advance. Within the Exponential Smoothing Menu, the options are relatively simple.

Using Statistical Data to Make Decisions: Time Series Forecasting Page 15 Input Range Damping Factor Labels Output Range Chart Output The source of the original time series The level of (1-alpha). The default is.3. A check box of whether the first row contains a label Where you want the new data to go (you only need to specify the first cell of the column). Excel will only put the results in the current worksheet. Please note, if you used a label for the original data, Excel will not create a label for the exponential smoothing. Therefore you should specify the first row of the data series, not the first label row, for the output. Excel provides a scatter plot of the original data and the smoothed data Standard Errors Excel will calculate standard errors of the estimates compared with the original data. The graph below shows the exponential smoothing data for housing starts plotted over time. The data still shows an upward trend with seasonal fluctuations, but like the moving average example the revised data have removed some of the noise in the original time series. Exponential smoothing is a bit more complicated approach and requires software to do it well. There are several models to choose from (not identified here), some of which can incorporate seasonal variability. Like moving averages, exponential smoothing may be a first step before further analysis with more sophisticated methods. Care must be taken in choosing the level of alpha for the model. Experience and an iterative approach usually guide most attempts at exponential smoothing. U.S. Monthly Housing Starts based on Exponential Smoothing (alpha =.3), 1990 to 2003 Thousands of Starts 200 150 100 50 0 Jan-90 Sep-92 Jun-95 Mar-98 Dec-00 Sep-03 Figure 5. Example of Exponential Smoothing of the Housing Start Data

Using Statistical Data to Make Decisions: Time Series Forecasting Page 16 STEPS TO MODELING AND FORECASTING TIME SERIES Step 1: Determine Characteristics/Components of Series Some time series techniques require the elimination of all components (trend, seasonal, cyclical) except the random fluctuation in the data. Such techniques require modeling and forecasting with stationary time series. In contrast, other methods are only applicable to a time series with the trend component in addition to a random component. Hence, it is important to first identify the form of the time series in order to ascertain which components are present. All business data have a random component. Since the random component cannot be predicted, we need to remove it via averaging or data smoothing. The cyclical component usually requires the availability of long data sets with minimum of two repetitions of the cycle. For example, a 10-year cycle requires, at least 20 years of data. This data requirement often makes it unfeasible to account for the cyclical component in most business and industry forecasting analysis. Thus, business data is usually inspected for both trend and seasonal components. How can we detect trend component? Inspect time series data plot Regression analysis to fit trend line to data and check p-value for time trend coefficient How can we detect seasonal component? Requires at least two years worth of data at higher frequencies (monthly, quarterly) Inspect a folded annual time series data plot - each year superimposed on others Check Durbin-Watson regression analysis diagnostic for serial correlation Step 2: Select Potential Forecasting Techniques For business and financial time series, only trend and random components need to be considered. Figure 3 summarizes the potential choices of forecasting techniques for alternative forms of time series. For example, for stationary time series (only random component exist), the appropriate approach are stationary forecasting methods such as moving averages, weighted

Using Statistical Data to Make Decisions: Time Series Forecasting Page 17 Time Series Data Trend Component Exists? No Yes Seasonal Component Exist? Seasonal Component Exist? No Yes Yes No Stationary Forecasting Methods Naïve Moving Average Weighted Moving Average Exponential Smoothing Seasonal Forecasting Methods Seasonal Multiple Regression Seasonal Autoregression Time Series Decomposition Trend Forecasting Methods Linear Trend Projection Non-linear Trend Projection Trend Autoregression Figure 6. Potential Choices of Forecasting Techniques moving average, and exponential smoothing. These methods usually produce less accurate forecasts if the time series is non-stationary. Time series methods that account for trend or seasonal techniques are best for non-stationary business and financial data. These methods include: seasonal multiple regression, trend and seasonal autoregression, and time series decomposition.

Using Statistical Data to Make Decisions: Time Series Forecasting Page 18 Step 3: Evaluate Forecasts From Potential Techniques After deciding on which alternative methods are suitable for available data, the next step is to evaluate how well each method performs in forecasting the time series. Measures such as R 2 and the sign and magnitude of the regression coefficients will help provide a general assessment of our models. However, for forecasting, an examination of the error terms from the model is usually the best strategy for assessing performance. First, each method is used to forecast the data series. Second, the forecast from each method is evaluated to see how well it fits relative to the actual historical data. Forecast fit is based on taking the difference between individual forecast and the actual value. This exercise produces the forecast errors. Instead of examining individual forecast errors, it is preferable and much easier to evaluate a single measurement of overall forecast error for the entire data under analysis. Error (e t ) on individual forecast, the difference between the actual value and the forecast of that value, is given as: e t = Y t - F t Where: e t = the error of the forecast Y t = the actual value F t = the forecast value There are several alternative methods for computing overall forecast error. Examples of forecast error measures include: mean absolute deviation (MAD), mean error (ME), mean square error (MSE), root mean square error (RMSE), mean percentage error (MPE), and mean absolute percentage error (MAPE). The best forecast model is that with the smallest overall error measurement value. The choice of which error criteria are appropriate depends on the forecaster s business goals, knowledge of data, and personal preferences. The next section presents the formulas and a brief description of five alternative overall measures of forecast errors.

Using Statistical Data to Make Decisions: Time Series Forecasting Page 19 1) Mean Error (ME) A quick way of computing forecast errors is the mean error (ME) which is a simple average of all the errors of forecast for a time series data. This involves the summing of all the individual forecast errors and dividing by the number of forecast. The formula for calculating mean absolute deviation is given as: ME N i = = 1 N e i An issue with this measure is that if forecasts are both over (positive errors) and below (negative errors) the actual values, ME will include some cancellation effects that may potentially misrepresent the actual magnitude of the forecast error. 2) Mean Absolute Deviation (MAD) The mean absolute deviation (MAD) is the mean or average of the absolute values of the errors. The formula for calculating mean absolute deviation is given as: N e i MAD = = 1 N i Relative to the mean error (ME), the mean absolute deviation (MAD) is commonly used because by taking the absolute values of the errors, it avoids the issues with the canceling effects of the positive and negative values. N denotes the number of forecasts. 3) Mean Square Error (MSE) Another popular way of computing forecast errors is the mean square error (MSE) which is computed by squaring each error and then taking a simple average of all the squared errors of forecast. This involves the summing of all the individual squared forecast errors and dividing by the number of forecast. The formula for calculating mean square error is given as:

Using Statistical Data to Make Decisions: Time Series Forecasting Page 20 MSE N e 2 i i = = 1 N The MSE is preferred by some because it also avoids the problem of the canceling effects of positive and negative values of forecast errors. 4) Mean Percentage Error (MPE) Instead of evaluating errors in terms of absolute values, we sometimes compute forecast errors as a percentage of the actual values. The mean percent error (MPE) is the ratio of the error to the actual value being forecast multiplied by 100. The formula for calculating mean percent error is given as: MPE = N i= 1 ei ( Y ) i 100 N 5) Mean Absolute Percentage Error (MAPE) Similar to the mean percent error (MPE), the mean absolute percent error (MAPE) is the average of the absolute values of the percentage of the forecast errors. The formula for calculating mean absolute percent error is given as: MAPE = N i= 1 ei ( ) Y i 100 N The MAPE is another measure that also circumvents the problem of the canceling effects of positive and negative values of forecast errors.

Using Statistical Data to Make Decisions: Time Series Forecasting Page 21 TWO EXAMPLES OF FORECASTING TECHNIQUES Forecasting Time Series with Trend The first example will focus on modeling data with a trend. For this example we will look at monthly U.S. Retail Sales data from Jan. 1955 to Jan. 1996. The data are given in million of dollars and are not seasonally adjusted or adjusted for inflation. We know there is a curvilinear relationship in this data, so we will be able to see how much better we can do in our estimates by estimating a second order polynomial to the data. Our strategy will be the following: 1. Examine the scatter plot of the data 2. Decide on two alternative models, one linear and the other nonlinear 3. Split the sample into two parts. The first part will be designated as the estimation sample. It contains most of the data and be used to estimate the two models (1955:1 to 1993:12). The second part of the data is called the validation sample and will be used to assess the ability of the models to forecast into the future. 4. After we determine which model is best, we will reestimate the preferred model using all the data. This model will be used to make future forecasts. The plot of the data shows an upward trend, but the trend appears to be increasing at an increasing rate (see Figure 7). A second order polynomial could provide a better fit to this data and will be used as an alternative model to the simple linear trend. Monthly U.S. Retail Sales, 1955 to 1996 Millions Dollars $200,000 $175,000 $150,000 $125,000 $100,000 $75,000 $50,000 $25,000 $0 Oct-54 Jun-57 Mar-60 Dec-62 Sep-65 Jun-68 Mar-71 Dec-73 Monthly Trend Aug-76 May-79 Feb-82 Nov-84 Aug-87 May-90 Jan-93 Oct-95 Jul-98 Figure 7. U.S. Monthly Retail Sales, 1955 to 1996

Using Statistical Data to Make Decisions: Time Series Forecasting Page 22 Linear Trend Regression. The first model is a linear regression of Retail Sales from January 1955 to December 1993. The Excel Regression output is given below in Table 5. The R 2 for the model is fairly high,.89. The coefficient for trend is positive and significantly different from zero. The estimated regression equation is: Y t = -15,826.216 + 329.955(Trend) I used the residual option in Excel to calculate columns of predicted values and residuals for the data. From these I was able to calculate the Mean Absolute Difference (MAD), Mean Percentage Error (MPE), and the Mean Absolute Percentage Error (MAPE). The average values for the data in the analysis for each sample are give below. MAD MPE MAPE Average Estimation Sample 13920.40 6.50 41.34 Average Validation Sample 37556.53 20.71 20.71 These figures are not easy to interpret on their own, but they will make more sense once we compare them to the second model. However, if you look at the residuals you would notice that there are long strings of consecutive positive residuals followed by strings of negative residuals (data not shown). This pattern repeats itself several times. The pattern reflects that the relationship is nonlinear and the model systematically misses the curve of the data. Table 5. Regression of Monthly Retail Sales on Trend Regression Statistics Multiple R 0.942 R Square 0.888 Adjusted R Square 0.888 Standard Error 15853.125 Observations 468 ANOVA df SS MS F Sig F Regression 1 929960937041.49 929960937041.49 3700.28 0.000 Residual 466 117115854291.71 251321575.73 Total 467 1047076791333.20 Coef Std Error t Stat P-value Intercept -15826.216 1467.974-10.781 0.000 Trend 329.955 5.424 60.830 0.000

Using Statistical Data to Make Decisions: Time Series Forecasting Page 23 Polynomial Trend Regression. The alternative model is a polynomial or quadratic model of the form: Y t = b o + b 1 Trend + b 2 Trend 2 This model is linear in the parameters, but will fit a curve to the data. The form of the curve depends upon the signs of the coefficients for b 1 and b 2. If b 2 is negative, the curve will show an increasing function at a decreasing rate, eventually turning down. If it is positive, the curve will increase at an increasing rate. The regression output of the polynomial equation is given in Table 6. R 2 for this model is much higher,.997, which indicates that adding the squared trend term in the model improved the fit. The coefficient for Trend 2 is positive and significant (p<.001). Once again I used the residual option in Excel to calculate MAD, MPE, and MAPE for the estimation sample and the validation sample. The following table contains the results of this analysis. Each of the summary error measures are smaller for the polynomial regression, indicating the second model fits the data better and will provide better forecasts. Average Estimation Sample Average Validation Sample MAD MPE MAPE 2307.65 0.06 6.07 3303.41-1.77 1.88 Table 6. Polynomial Regression of U.S. Monthly Sales on Trend and Trend Squared Regression Statistics Multiple R 0.998 R Square 0.997 Adjusted R Square 0.997 Standard Error 2725.375 Observations 468 ANOVA df SS MS F Sig F Regression 2 1043622925925.31 521811462962.65 70252.40 0.000 Residual 465 3453865407.89 7427667.54 Total 467 1047076791333.20 Coef Std Error t Stat P-value Intercept 19245.229 379.562 50.704 0.000 Trend -117.765 3.738-31.509 0.000 TrendSq 0.955 0.008 123.703 0.000

Using Statistical Data to Make Decisions: Time Series Forecasting Page 24 Forecasting Time Series with Seasonality This second example focuses on how to estimate and forecast time series that exhibit seasonality. A relatively straightforward approach to modeling and forecasting seasonality is through the use of dummy variables in multiple regressions to represent the seasons. Dummy or indicator variables were introduced earlier in the modules on simple and multiple regressions. Dummy variables are used to represent qualitative variables in a regression. Recall that for any k categories, only k-1 dummy variables are needed to represent it in a regression. For example, we can represent quarterly time series with three dummy variables and monthly series by eleven dummy variables. The excluded quarter or month is known as the reference category. For example, the complete model for a monthly time series can be specified as follows: Y t = b o + b 1 *Time + b 2 *M 1 + b 3 *M 2 + b 4 *M 3 + b 5 *M 4 + b 6 *M 5 + b 7 *M 6 + b 8 *M 7 + b 9 *M 8 + b 10 *M 9 + b 11 *M 10 + b 12 M 11 where: b o is the intercept b 1 is the coefficient for the time trend component b 2, b 3,, b 12 are the coefficients that indicate how much each month differs from the reference month, month 12 (December). M 1, M 2,, M 11 are the dummy variables for the first 11 months (= 1 if the observation is from the specified month, otherwise =0) Y t is the monthly number of U.S. housing starts, in 1,000s Using the U.S. Housing Starts used earlier, we illustrate how to produce out-of-sample forecast for a data with a monthly seasonal component. First, we analyze the monthly time series plot of the data and identify a seasonal component in the time series. Then we create 11 monthly seasonal dummy variables. Although we will use December as the reference category, any of the months can be chosen as the reference month. Next, divide the data set into two sub-samples. The first sub-sample will be designated as the "estimation sample" while the second sub-sample represents the "validation sample." Then, we estimate seasonal dummy variable regression model with the estimation sample (1990:1-2002:12) and hold out some data as the validation sample 2003:1-2003:12) to validate the accuracy of the trend regression forecasting

Using Statistical Data to Make Decisions: Time Series Forecasting Page 25 models. The model without the seasonal dummies is shown in the graph below (see Figure 8). The R 2 for this model is low, only.45. U.S. Monthly Housing Starts, 1990 to 2003 Thousands of Starts 200 180 160 140 120 100 80 60 40 20 0 y = 0.0119x - 298.14 R 2 = 0.4482 Jan-90 Sep-92 Jun-95 Mar-98 Dec-00 Sep-03 Figure 8. Simple Linear Regression of U.S. Monthly Housing Starts on Trend, 1990 to 2003 A full model is then estimated for the data from January 1990 to December 2002 (estimation sample). The Excel output is in Table 7. The full model dramatically improves R2 to.864. We can assume that most of the remaining variation is due to the cyclical component of the time series. However, this model is only designed to capture the seasonal (and trend) component. Note that all the seasonal dummies (except JAN and FEB dummies) are statistically significant as shown by their very low p-values. This implies that the seasonal regression model is a good model for forecasting this time series. The seasonal effects are relatively low in the winter months, but rise quickly in the spring when most home construction gets started. The seasonal effects seem to have peaked by the month of June Including the dummy variables for month has improved the fit of the model. The estimated regression coefficients are then used to generate the error measures for the estimation sample and the validation sample, as shown below. The figures for MAD, MPE, and MAPE are all reasonable for this model, for both the estimation sample and the validation sample. Given the partial nature of the model, which only account for seasonal effects, the measures of forecast error looks reasonable. In order to obtain a more reliable forecast with lower errors, we will need to account for the cyclical factors in the macroeconomic data for housing starts. Overall, the model fits the data well. Average Estimation Sample Average Validation Sample MAD MPE MAPE 7.18-0.81 6.56 10.16 3.36 6.61

Using Statistical Data to Make Decisions: Time Series Forecasting Page 26 Table 7. Regression of Housing Starts on Trend and Season Regression Statistics Multiple R 0.934 R Square 0.872 Adjusted R Square 0.862 Standard Error 9.725 Observations 168 ANOVA df SS MS F Sig F Regression 12 100092.72 8341.06 88.19 0.000 Residual 155 14659.20 94.58 Total 167 114751.92 Coef Std Error t Stat P-value Intercept 67.622 2.950 22.921 0.000 Trend 0.358 0.016 23.056 0.000 M1-5.588 3.680-1.519 0.131 M2-1.631 3.679-0.443 0.658 M3 24.540 3.678 6.671 0.000 M4 37.182 3.678 10.110 0.000 M5 41.860 3.677 11.383 0.000 M6 41.696 3.677 11.340 0.000 M7 37.345 3.677 10.158 0.000 M8 35.166 3.676 9.566 0.000 M9 29.494 3.676 8.023 0.000 M10 33.465 3.676 9.104 0.000 M11 12.308 3.676 3.348 0.001 CONCLUSION This module introduced various methods available for developing forecasts from financial data. We defined some forecasting terms and also discussed some important issues for analyzing and forecasting data over time. In addition, we examined alternative ways to evaluate and judge the accuracy of forecasts and discuss some of the common challenges to developing good forecasts. Although mastering the techniques is very important, equally important is the forecaster s knowledge of the business problems and good familiarity with the data and its limitations. Finally, the quality of forecasts from any time series model is highly dependent on the quality and quantity of data (information) available when forecasts are made. This is another way of saying Garbage in, garbage out.