lecture 11 vt13

Upload: kushtrimbajqinca

Post on 05-Oct-2015

224 views

Category:

Documents


0 download

DESCRIPTION

serial correlation

TRANSCRIPT

  • Lecture 11: An introduction to time series

    Moursli Mohamed Reda

    University of Gothenburg

    February 5, 2013

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • What we previously covered

    I The definition of a random process yt

    I White noise process, usually a property we seek in the errorterm of a regression

    I Weak Stationarity: an essential set of assumptions about themoments of our process, which guarantees a well behavingseries

    I The assumptions required for the Gauss-Markov Theorem toapply

    I The importance of properly handeling Trends in the data.

    I Serial correlation

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • RecapAutocorrelation Function

    I We generalize the concept of correlation to that ofautocorellation when looking at the linear dependence withina (weakly) stationary series zt.

    I the autocorrelation between zt and zts is given as:

    s =Cov(zt, zts)

    Var(zt)Var(zts)=

    Cov(zt, zts)Var(zt)

    I In the result above, the constant variance assumption impliedby the weak stationarity is used.

    I We can also estimate the Lag-1 sample autocorrelation asabove.

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • RecapAutocorrelation Function

    I Assume we have a sample of returns rt with t = 1, ..., T, r isthe sample mean then the Lag-1 sample autocorrelation of rtis given by:

    1 =Tt=2(rt r)(rt1 r)

    Tt=1(rt r)2I In general, the Lag-s sample autocorrelation of rt is defined as:

    s =Tt=s+1(rt r)(rts r)

    Tt=1(rt r)2,

    0 s < T 1

    I The statistics defined above, 1, 2, ... are called the ACF ofrt, and allow us to capture the linear dynamics of a time seriesdata.

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • The following four slides show the ACF and PACF of the monthlyUS Stock Market Return Index, and that of US Dividend Yield

    Figure : ACF Return Index US 12 Lags

    0.20

    0.

    100.

    000.

    100.

    20A

    utoc

    orre

    latio

    ns o

    f rus

    a

    0 5 10 15Lag

    Bartletts formula for MA(q) 95% confidence bands

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • Figure : PACF Return Index US 12 Lags

    0.

    20

    0.10

    0.00

    0.10

    0.20

    Par

    tial a

    utoc

    orre

    latio

    ns o

    f rus

    a

    0 5 10 15Lag

    95% Confidence bands [se = 1/sqrt(n)]

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • Figure : ACF Dividend Yield US 36 Lags

    1.

    00

    0.50

    0.00

    0.50

    1.00

    Aut

    ocor

    rela

    tions

    of p

    dusa

    0 10 20 30 40Lag

    Bartletts formula for MA(q) 95% confidence bands

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • Figure : PACF Dividend Yield US 36 Lags

    0.00

    0.50

    1.00

    Par

    tial a

    utoc

    orre

    latio

    ns o

    f pdu

    sa

    0 10 20 30 40Lag

    95% Confidence bands [se = 1/sqrt(n)]

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • Weakly Dependent Series

    I We define now another concept closely related to stationarity,but slightly different:

    I Two series are said to be weakly dependent when they startbecoming more independent the longer the time horizon

    I assume we have the following series xt and xt+h then thehigher h is the more independent the two series become,which in turn implies that:

    I Corr[xt, xt+h] 0 as h

    I In the case above, we call our series to be covariancestationary or asymptotically uncorrelated

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • AR modelsIntroduction

    I A natural starting point for a forecasting model is to use pastvalues of yt to forecast yt.

    I An AR model is a regression model in which yt is regressedagainst its own lagged values.

    I The pth order AR model, denoted AR(p), is written

    yt = + 1yt1 + ... + pytp + ut

    where {ut} is white noise with variance 2.

    I and 1, ..., p do not have causal interpretations.

    I If 1 = ... = p = 0, then yt1, ..., ytp are not useful forforecasting yt.

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • AR modelsProperties

    I Consider the AR(1) model:

    yt = 1yt1 + utI What are the mean, variance and covariance of {yt}?

    I The mean can be obtained from

    E(yt) = 1E(yt1) + E(ut) = 1E(yt1)

    If {yt} is stationary, then E(yt) = E(yt1) = , and so we get = 1, or

    =0

    1 1= 0

    I Consider next the variance. It holds that

    var(yt) = 21var(yt1) + var(ut) = 21var(yt1) +

    2

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • I The variance: Continued.

    If {yt} is stationary, then var(yt) = var(yt1) = 0, giving

    0 = 210 +

    2

    or

    0 =2

    1 21I The covariance at one lag is given by

    1 = E(ytyt1) = E((1yt1 + ut)yt1)= 1E(y2t1) + E(utyt1) = 10

    The general pattern is

    k = k10

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • I The kth order autocorrelation is given by

    k =k0

    =k100

    = k1

    I We need |1| 6= 1 as otherwise

    0 =2

    1 21=

    2

    0=

    I We can also not have |1| > 1 because then

    0 =2

    1 21< 0

    I In other words, we need |1| < 1 in order to ensure that {yt}is well-behaved.

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • Estimation

    I Consider the AR(1) model:

    yt = 1yt1 + ut

    I As long as yt1 is independent of ut, this model is just like anyother regression model, which can be estimated using OLS.

    I One problem: Write

    1 =Tt=2 yt1ytTt=2 y2t1

    =Tt=2 yt1(1yt1 + ut)

    Tt=2 y2t1

    = 1 +1T

    Tt=2 yt1ut

    1T

    Tt=2 y2t1

    At this point, we want to use the LLN to show that the lastterm goes to zero. However, since {yt} is serially correlatedour usual LLN and CLT results cannot be used here.

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • I Fortunately, there are extensions of the LLN and CLT thatapply when the observations are serially dependent.

    I Assumptions:

    1. E(ut|yt1) = 0.

    2. {yt} is stationary.

    3. yt and ytk become independent as k increases.

    4. E(y4t ) is nonzero and finite.

    I Let It1 = {yt1, yt2, ..., y1} be the past history of yt. Intime series, if

    E(ut|It1) = 0then ut is called a martingale difference sequence (MDS).Assumption 1 implies this.

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • I Assumption 2 is the time series counterpart of the identicallydistributed part of the iid assumption when applied to(y1, ..., yT).

    I Assumptions 3 is the time series counterpart of theindependently distributed part of iid. It replaces the usualassumption that yt and ytk are independent with the timeseries requirement that they become independent as kincreases. This assumption is sometimes referred to as weakdependence or ergodicity.

    I Under assumptions 1-4 the OLS estimators are aymptoticallynormally distributed, and it also implies that the usual OLSstandard errors, t and F statistics, and LM statistics areasymptotically valid.

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • Non-Stationarity

    I A non-stationary process is a process that violates one of thestationarity assumptions mentioned above, it is also called aunit root process

    I A stationary process is a I(0) process, while an non-stationaryprocess is an I(1) process

    I A non-stationary serie that is I(1) can be rendered stationaryby first differencing:I If we have a random walk as follow:

    yt = 0 + 1yt1 + et

    I and if 1 = 1 and et is weakly stationary then by firstdifferencing the series we get:

    yt = yt yt1 = et

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • I Identifying if the series have a unit root

    I The identification of a unit root can be done based ongraphical inspection when there is a clear trend in the data

    I Othewise there are several ways to decide on thenon-stationarity of series (we will not cover a formal procedurein this chapter)

    I The first order autocorrelation can be an informal way of doingso: from the AR(1) model we saw that stationarity requiresthat |1| < 1

    I So if we estimate the first order autocorrelation 1 and it isclose to 1 then we can suspect that we have non-stationarity

    I The reason of the result above is that the 1 is a consistantestimator of 1

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • The deterministic trend model

    I A deterministic trend is a nonrandom function of time, forexample, t or t2.

    I Consider the following deterministic trend model:

    yt = + t + ut

    where ut is iid.

    I In the deterministic trend model {yt} is non-stationary.

    I Proof: Note that

    E(yt) = + t + E(ut) = + t

    which depends on t, thus violating stationarity condition 1.

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • I The Effect of the Presence of a Trend

    R2 = 1 SSRSST

    p 1

    where

    SSR =T

    t=1

    u2t

    ut = yt t

    I Thus, R2 p 1 even though the observations do not getcloser to the regression line as T . This is therefore aspurious result!

    I The reason for why SSR/T is not exploding in the same wayas SST/T is that ut = yt t is stationary.

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • I The spuriously high R2 is due to the fact that while SSRaccounts for the trend SST does not.

    I This result does not only hold in a regression of yt on aconstant and trend, but extends to all regressions where thedependent variable is trending, and the trend is included onthe right-hand side.

    I Solution: Replace yt with the de-trended series ut whenrunning regressions.

    I The point here is that the mean and variance have nomeaning if {yt} is non-stationary, as the mean is time-varyingand the variance is exploding.

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • The stochastic trend model

    I Unlike a deterministic trend, a stochastic trend is random andvaries over time.

    I An important example of a stochastic trend is a random walk:

    yt = yt1 + ut

    where ut iid(0, 2).

    I Because this is an AR(1) with unit AR slope coefficient, thecharacteristic equation is given by

    1 1z = 1 z = 0

    which has a root at unity, z = 1.

    I We therefore say that yt has a unit root.

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • The DF test

    I How do you detect trends?

    I Plot the data

    I There is a regression-based test for a random walk theDickeyFuller (DF) test for a unit root.

    I The AR(1) model can be written as

    yt = (1 1)yt1 + ut = yt1 + utI The unit root hypothesis is given by

    H0 : = 0 (or 1 = 1)H1 : < 0 (or |1| < 1)

    I This is a one-sided test; if there is no unit root, yt isstationary.

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • I The DF statistic is the usual t-statistic for testing = 0:

    tDF =

    SE()

    I The difference is that the distribution is no longer standardnormal. New critical values are therefore needed.

    I How to treat the presence of nonzero intercept and trendterms?

    I The decision to use the intercept-only DF test or the interceptand trend DF test depends on what the alternative is andwhat the data look like.I In the intercept-only specification, the alternative is that yt is

    stationary around a constant.I In the intercept and trend specification, the alternative is that

    yt is stationary around a linear time trend.

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • I when we have serial correlation in our error term, then wewould rather use an augmented version of the DF test

    I The ADF test includes lags to the standard DF, based on thepersistance of the serial correlation in our error term

    I The general format of the ADF would look like:

    yt = (1 1)yt +l

    i=1

    iyti + ut

    I A common problem in testing for the presence of unit root isthe low power of the tests used.

    I Another issue is that if the data has pronounced shifts, thentests such as the DF or the ADF are not really suitable.

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • Serial Correlation

    I We have seen that for the Gauss-Markov theorem to hold, weshould have no serrial correlation among the error terms ofour model, and the errors should be homoskedastic

    I If we have serial correlation in the residuals then:I The OLS estimator is no longer BLUE

    I The standard erros and test statistics are not valid (evenasymptotically)

    I However the R-squared would be still a good measure ofgoodness of fit as long as we assume stationarity and weakdependence (the variances are constant)

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • Testing for Serial Correlation

    I There are several ways to test for the presence of serialcorrelation

    I We look at a t-test for AR(1) serial correlation with strictlyexogenous regressors

    yt = 0 + 1xt1 + ... + kxtk + ut

    ut = ut1 + etwe assume the following:

    E[et|ut1, ...] = 0Var(et|ut1) = 2eThe null hypothesis would be that H0 : = 0; however theissue is that ut is unobserved

    III the solution is to use the t from the OLS estimation toapproximate ut

    I Regress t on t1I Finally use the t-statistic associated with to test for the null

    hypothesis Moursli Mohamed Reda Lecture 11: An introduction to time series

  • Correcting for Serial Correlation

    I We can correct for serial correlation by using the FGLSprocedure

    yt = 0 + 1xt + ut

    yt1 = 0 + 1xt1 + ut1

    I If we compute yt yt1 we will get new series for yt and xt,and thus we can rewrite our regression as follow:

    yt = yt yt1, xt = xt xt1,

    yt = 0 + 1xt + ut

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • I The steps are as follow:

    I First we run OLS on our regression and we extract theresiduals

    I Then we run the regression on the error terms and extract

    I Apply OLS to our new equation to estimate the coefficients

    I In order to get serial correlation-robust standard errors wefollow the Newey West method

    I The robust standard errors applied in case of serial correlationare similar to the ones used for heteroskedasticity

    yt = 0 + 1xt1 + 2xt2 + ut

    Moursli Mohamed Reda Lecture 11: An introduction to time series

  • I The interest is to get a serial correlation robust standarderrors for 1. So the way to go is:

    I Estimate our main model using OLS and extract se(1), andthe OLS residuals ut

    I Run a regression of xt1 on the other explanatory variables

    xt1 = 0 + 2xt2 + rt

    I compute the residuals rt and then form at = rtut for each t

    I define v as in 12.42 in the book by choosing g

    I Finally compute se(1)

    Moursli Mohamed Reda Lecture 11: An introduction to time series