Sei sulla pagina 1di 13

QMB 6305 Quantitative Methods for Business Dr. Nestor M.

Arguea Building 53, Room 120 | 474-3071

Spring 1999 University of West Florida Marketing and Economics

Note. These are simple notes on some aspects of time series, as presented in class. It is a supplement to the reading list. Some of the discussion on random walk processes at the end was not presented in class. Therefore, you should ignore the technical discussion in sections 13, 14, and 15.

Lecture notes on time series

1 Time series data


Time series data refers to observation of a particular variable over time. These type of data allows the analyst to view" the evolution of a variable over a period of time. For instance: sales unemployment rate see graph attached to concept, in ation rate cost of production price of oil interest rates number of people going to an adventure park consumption of gasoline

1.1 Components of a time series


Any time series can contain some or all of the following components: 1. Trend T 2. Cyclical C 3. Seasonal S 4. Irregular I These components may be combined in di erent ways. It is usually assumed that they are multiplied or added, i.e.,

To correct for the trend in the rst case one divides the rst expression by the trend T. In the second case it is subtracted.

yt = T  C  S  I yt = T + C + S + I

1.1.1 Trend component

The trend is the long term pattern of a time series. A trend can be positive or negative depending on whether the time series exhibits an increasing long term pattern or a decreasing long term pattern. If a time series does not show an increasing or decreasing pattern then the series is stationary in the mean.

1.1.2 Cyclical component

Any pattern showing an up and down movement around a given trend is identi ed as a cyclical pattern. The duration of a cycle depends on the type of business or industry being analyzed. Seasonality occurs when the time series exhibits regular uctuations during the same month or months every year, or during the same quarter every year. For instance, retail sales peak during the month of December. This component is unpredictable. Every time series has some unpredictable component that makes it a random variable. In prediction, the objective is to model" all the components to the point that the only component that remains unexplained is the random component.

1.1.3 Seasonal component

1.1.4 Irregular component

2 Global and local trends


2.1 Global trend
Using a simple linear trend model, the global trend of a variable can be estimated. This way to proceed is very simplistic and assumes that the pattern represented by the linear trend remains xed over the observed span of time of the series. A simple linear trend model is represented by the following formulation:

yt = + t + t
Rarely a model like this is useful in practice. A more realistic model involves local trends.

2.2 Local trend


A more modern approach is to consider trends in time series as variable. A variable trend exists when the trend changes in an unpredictable way. Therefore, it is considered to be stochastic.1
1 The discussion of local trends is more advanced and it is connected with the discussion on random walk processes later in these notes.

3 Forecasting

Forecasting or prediction refers to the process of generating future values of a particular event. Business forecasting involves the use of quantitative methods to obtain estimations of future values of a variable or variables. These quantitative methods include the application of some statistical procedure. A forecast can also be produced by subjective and judgmental methods. These include the jury of executive opinion and the Delphi method. I both cases a panel of experts discuss their views to produce a forecast. Examples of forecasts at the rm level, and those related with some aspect of the economy follow: A. Within the rm a Sales for the next 6 months. b Levels of inventories for the next 5 weeks. c Costs and revenues B. The economy a The level of activity at the state or national levels. For instance, the unemployment rate, or the level of capacity utilization. b Prices of critical inputs labor, fuel c Interest rates

4 Time series methods


Time series methods or models makes reference to models use in forecasting where no "explanatory" variables are involved. Hence, the only source of information is the past values of the variable of interest. The main objective of these methods is forecasting future values. These models include smoothing methods moving averages, single and double exponential smoothing, and Holt-Winters exponential smoothing.2

5 Moving averages
A moving average is a method to obtain a smoother picture of the behavior of a series. The objective of applying moving averages to a series is to eliminated the irregular component, so that the process is clearer and easier to interpret. A moving average can be calculated for the purpose of smoothing the original series, or to obtain a forecast. In the rst case a centered" moving average is calculated. In the second case, the forecast for period n is calculated with the m previous values, where m is the number of periods the order of the moving average that enter the calculation.
2 ARIMA AutoRegressive Integrated Moving Average models are more complex forecasting models based on statistical assumptions about the data generating process. Parameters can be tested for signi cance as in the regression model.

5.1 Simple moving average


Two simple moving average processes not centered, for forecasting purposes of order 3, and 5 are presented below. , yt = yt,3 + yt3 2 + yt,1
, yt = yt,5 + yt,4 + yt5 3 + yt,2 + yt,1

5.2 Weighted moving average


A weighted moving average can be produced by repeated application of a simple averaging. For instance, for a moving average of order 3, applying a moving average again yields:
   yt = yt,2 + y3t,1 + yt
yt,5 +yt,4 +yt,3 + yt,4 +yt,3 +yt,2 + yt,3 +yt,2 +yt,1 3 3 3

t = yt,5 + 2yt,4 + 3y9,3 + 2yt,2 + yt,1

6 Exponential smoothing
6.1 Simple exponential smoothing
Forecasts generated with this method are a weighted average of the past values of the variable. The weights decline for older observations. The rationale is that more recent observations are more in uential than older observations. The forecast for period t + 1 calculated in period t is called Ft+1 . Therefore, Ft is the forecast for period t calculated in period t , 1. The forecast for period t + 1 is,

Ft+1 = At + 1 , Ft which represents a weighted average of the actual value At  and the forecast Ft  of the actual value calculated at t , 1. The higher the value of alpha the more weight is given to current values the shorter
the memory of the process .

6.2 Winter's exponential smoothing

This method uses three parameters to obtain forecasts: a smoothing constant for the data  , a smoothing constant for the seasonal estimate  , and a smoothing constant for the trend estimate  .

7 Evaluation of forecasts
Forecasts are evaluated using di erent measures based on the di erence between the actual and the predicted value the residual. Among these measures, the following are the most frequently used. a MAPE: mean absolute percentage error Pn=1 j et=Yt 100 j MAPE = t This method is useful when the units of measure of Yt are relatively large. b MSE: mean squared error Pn e2t MSE = t=1 n This measure is useful when the managers are interested in minimizing the occurrence of a major error. This measure magni es large errors. However one might tend to select a model with an error pattern of 10,1,1,1,1, rather than one with an error pattern of 5,5,5,5,5 one with a few large errors versus one with a smaller systematic error. This method does not indicate whether the model is systematically underestimating or overestimating the actual values. c RMSE: root mean squared error rP

RMSE =

n e2 t=1 t

d MAD: mean absolute deviation

The goal of the forecast exercise is to obtain accurate predictions. In measuring the accuracy of the prediction the forecaster usually relies on the performance of the model using past information. This is basically the assumption adopted in the previous section. A better approximation to measure how accurate a model predicts is to use only part of the sample and validate the model using the hold out sample. In this case the ratios based on forecast errors are calculated using the number of data points predicted for the hold out sample points. This provides a more reliable measure of the quality of the forecast for each model.

8 Validation

MAD = t=1 j et j n

Pn

9 Turning points - Graphical analysis


yt = yt , yt,1

The analysis of turning points actual and predicted allows the manager to judge which model predicts downturns and upturns with more accuracy. The graphical analysis consists of plotting the actual change in the variable to predict versus the predicted change. The actual and predicted or forecast changes are de ned as follows: ^yt = yt , yt,1 ^ ^ The results of the forecasts exercise include a correct prediction of the direction of change positive or negative, or a turning-point error. The possible results with the errors in forecasting changes can be categorized as follows: 5

1. Correct prediction of direction of change. a Overestimation of a positive change b Underestimation of a positive change c Overestimation of a negative change d Underestimation of a negative change 2. Turning-point errors. a Prediction of an upturn that did not occur NT b Failure to predict a downturn TN c Prediction of a downturn that did not occur NT d Failure to predict an upturn TN These results on turning-point errors can be summarized in a table, as follows.

Turning-point errors
Forecast Actual No TP No TP TP NN TN TP NT TT

The number of correct forecasts is the sum of the main diagonal occurrences NN+TT. NT represents false signals and TN refers to missed turning points. The proportion of false signals is de ned as

Efs = NTNTTT +
and the proportion of missed turning points is where NT + TT is the total number of TP predicted and TN + TT is the total number of actual TP .

Emt = TNTNTT +

10 Sources of data
10.1 Business cycle indicators
Leading and lagging indicator indexes are used to predict the business cycle. They represent key variables that either precede the business cycle or that lag the business cycle. A third commonly used index is the composite index of coincident indicators. These indicators follow the cycle closely. The composite index of 11 leading indicators includes information on the following topics: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. Average weekly hours Claims for unemployment insurance New orders Stock prices Orders for plant and equipment Private housing Vendor performance Consumer expectations Un lled orders Prices of sensitive materials Money supply

The nal goal of a forecast is to make decisions based on the future values of some variable. The forecast process can be presented with the following outline.3 1. Specify objective 2. De ne variable to forecast 3. Establish periodicity 4. Data considerations: measurement index, units, dollars 5. Model selection: regression, time series models, other 6. Model evaluation 7. Forecast preparation 8. Forecast presentation. Clear, nontechnical presentations are crucial in the communication of the forecast results. 9. Tracking results. Tracking the performance of the forecasts helps to rede ne, respecify the model, or to replace the estimation method used.

11 The forecast process

Wilson and Keating 1994, Chapter 2.

The following table presents a guideline of the di erent forecasting methods based on di erent conditions.
Forecasting method Naive Moving average Data pattern stationary stationary Data points Forecast Horizon Very short Very short Short short to medium Short to medium Quantitative skills None Little Little Moderate Little

1 or 2 At least the number of periods in the moving average Exponential smoothing Simple Stationary 5-10 Winter's Trend and seasonality 4-5 per season Regression-based Trend Linear or nonlinear 4-5 per season if seasontrend with or without ality included, otherwise seasonality 15-20 Regression-based Causal Any data pattern 10 per independent variable Time series decomposi- Trend, seasonal, and Enough to see two peaks tion cyclical patterns and troughs in the cycle ARIMA Stationary At least 50

Short, medium and Moderate long Short, medium, Little and long Short, medium, High and long

When more than one forecast are available the combination of those forecasts has the advantage of reducing the forecast error. Assume that two forecasts are available a linear regression model, and an exponential smoothing forecast. Denote them by f1 and f2 . Then, the combined forecast fc can be obtained as a weighted average of both forecasts. That is,

12 Combination of forecasts

fc = w1 f1 + w2 f2 w1 + w2 = 1 One way to select the weights w1 and w2 is by looking at the past performance of both methods and assigning
the larger weight to that method that perform the best, for instance based on the value of the MSE mean squared error. The weight can be proportional to the inverse of the MSE, and can be calculated in the following way:
1 MSE1 1 = 1 MSE1 + MSE2

w1 =
and

MSE2 MSE1 + MSE2

MSE1 w2 = 1 , w1 = MSE + MSE 1 2

Autoregressive conditional heteroscedastic ARCH, and generalized ARCH GARCH models allow the econometrician to estimate the variance of a series at a particular point in time. Estimating the variance of a series at di erent points in time provide the analyst with better information when the objective is the evaluation of a particular nancial portfolio. This information is more relevant than the unconditional or long term variance of the series.

13.1 ARCH and GARCH

13 Models with non constant variance

13.2 ARCH-M

This model is an extension of the basic ARCH model. The mean value of the series is allowed to vary with its conditional variance.

14 Deterministic and stochastic trends

A typical time series may exhibit a trend, a cycle, a seasonal component, and an irregular component. Various features of economics time series can be characterized by the following facts.4 1. Time series that contain a trend. Most macroeconomic time series contain an upward or downward trend. In general, they are not stationary because the mean does not revert to a long term mean value. 2. Some series meander. The have periods of decreasing and periods of increasing behavior. 3. Some series show shocks that are persistent. The mean of the series can increase for some time but after a while that mean can go back to the previous level. 4. For some series the volatility varies over time. These series show conditional on some time frame heteroscedasticity, that is periods where the variance is relatively high. 5. Some series tend to move together. This happens in series that are determined by similar underlying economics forces. A deterministic trend refers to the long term trend that is not a ected by short term uctuations in the economy. Some of the occurrences in the economy are random and may have a permanent e ect of the trend. Therefore the trend must contain a deterministic and a stochastic component.

Enders, W. 1995, Chapter 3.

15 A random walk process

A random walk is de ned as a process where the current value of a variable is composed of the past value plus an error term de ned as a white noise a normal variable with zero mean and variance one. Algebraically a random walk is represented as follows:

15.1 A simple random walk model

yt = yt,1 + t
The implication of a process of this type is that the best prediction of y for next period is the current value, or in other words the process does not allow to predict the change yt , yt,1 . That is, the change of y is absolutely random. It can be shown that the mean of a random walk process is constant but its variance is not. Therefore a random walk process is nonstationary, and its variance increases with t. In practice, the presence of a random walk process makes the forecast process very simple since all the future values of yt+s for s 0, is simply yt . The following graphs depict simulated random walk processes. The third graph includes a drift.

10

11

15.2 A random walk model with drift

A drift acts like a trend, and the process has the following form:

yt = yt,1 + a + t
For a 0 the process will show an upward trend. The third graph presented in the previous page was generated assuming a = 1. This process shows both a deterministic trend and a stochastic trend. Using the general solution for the previous process,
n X t=1

yt = y0 + at +

where y0 + at is the deterministic trend and n=1 t is the stochastic trend. t The relevance of the random walk model is that many economic time series follow a pattern that resembles a trend model. Furthermore, if two time series are independent random walk processes then the relationship between the two does not have an economic meaning. If one still estimates a regression model between the two the following results are expected: a High R2 b Low Durbin-Watson statistic or high  c High t ratio for the slope coe cient This indicates that the results from the regression are spurious. A regression in terms of the changes can provide evidence against previous spurious results. If the coe cient of a regression yt = a0 + 1 xt + t is not signi cant, then this is an indication that the relationship between y and x is spurious, and one should proceed by selecting other explanatory variable. If the Durbin-Watson test is passed then the two series are conintegrated, and a regression between them is appropriate.

15.3 Testing for random walks

The question is whether 1 a series goes back to a long term trend following a shock, or whether 2 a series follows a random walk, in which case the temporary shock becomes permanent. Suppose yt grows over time following a process that includes a trend and a lagged value. That is,

yt = + t + yt,1 + t
The di erent possibilities based on values of and are the following: a 0, and 1: a positive trend but stationary after detrending. Then the model can be estimated using ordinary least squares. b 0, = 0, and = 1: this de nes a random walk with drift. In order to estimate using yt it is necessary to transform yt into a stationary series by using rst di erences yt . The procedure to follow should allow the analyst to determine whether = 1 in

yt = yt,1 + t Let us subtract from each side of the equation yt,1 to get
12

yt , yt,1 = yt =
=

yt,1 , yt,1 + t yt,1 + t

Adding , and the following two models can be de ned: yt = a0 + yt,1 + t yt = a0 + a1 t + yt,1 + t These three models describe: 1. A pure random walk model. 2. A random walk with a drift. 3. A random walk with a drift and a linear trend. A unit root exists if = 0 and using a t-ratio to determine whether the null hypothesis can be rejected or not.5 Testing whether the process is a random walk, involves performing an F test by running two di erent models as follows. The unrestricted model is: yt = a0 + a1 t + yt,1 + 1 yt,1 + t and the restricted model, obtained by imposing the conditions of the null  = a1 = 0, is yt = a0 + 1 yt,1 + t and the F test is SSE , SSE F = SSE R n , m U =r = + 1
U

where SSER and SSEU are the sum of squares of the residuals in the restricted and unrestricted models, respectively, r is the number of restrictions, and n , m + 1 is the degrees of freedom of the unrestricted model where n is the number of observations, and m + 1 is the number of estimated parameters. Rejection of the null hypothesis means that the process is not a random walk.6

15.4 Message

One should be cautious about using nonstationary time series series with trend components, since the results of a regression model can be meaningless.

5 6

Special t tables de ned by Dickey and Fuller should be used. Dickey and Fuller provide with a special F table to perform this test.

13

Potrebbero piacerti anche