Applied Econometrics Introduction to Time Series Roman Horváth Lecture 2
Contents Stationarity What it is and what it is for Some basic time series models Autoregressive (AR) Moving average (MA) Consequences of non-stationarity (spurious regression) Testing for (non)-stationarity Dickey-Fuller test Augmented Dickey-Fuller test 2
(Weak) Stationarity X t is stationary if: the series fluctuates around a constant long run mean X t has finite variance which is not dependent upon time Covariance between two values of X t depends only on the difference apart in time (e.g. covariance between Xtand Xt-1 is the same as for Xt-8 and Xt-9) E(X t ) = μ (mean is constant in t) Var(X t ) = σ 2 (variance is constant in t) Cov(X t,x t+k ) = χ(k) (covariance is constant in t) If data not stationary, spurious regression problem 3
Examples of Times Series Models AR autoregressive models X t = β + α*x t-1 + u t is called AR(1) process X t = β + α 1 *X t-1 + α 2 *X t-2 +.+α k *X t-k + u t is AR(k) process MA moving average models X t = β + u t + α 2 *u t-1 is called MA(1) process X t = β + u t + α 2 *u t-1 +.+α k *u t-k.is called MA(k) process If you combine AR and MA process, you get ARMA process E.g. ARMA (1,1) is X t = β +α*x t-1 +u t + α 2 u t-1 4
Is MA and AR process stationary? Compute mean, variance and covariance and check if it depends on time For AR process, you may easily derive that the process is stationary if α < 1 For MA (1) process, mean is β, variance is u t 2 *(1+α 22 ) and covariance cov(x t, X t-k ) is either 0 if k>1 or u t 2 * α 2,so it does not depend on time (MA(k) is stationary process) 5
Example of Stationary Time Series White noise process: X t = u t u t ~ IID(0, σ 2 ) 0.6 0.4 0.2 0-0.2-0.4-0.6 6
Another Example of Stationary Time Series X t = 0.5*X t-1 + u t u t ~ IID(0, σ 2 ) 0.8 0.6 0.4 0.2 0-0.2-0.4-0.6 Stationary without drift 7
Example of Non-stationary Time Series Y t = α + β*t + u t, where t is time trend Take the expected value E(Y t ) = α + β*t, clearly the mean depends on time and the series is non-stationary 8
Non-stationary time series In contrast a non-stationary time series has at least one of the following characteristics: Does not have a long run mean which the series returns Variance is dependent upon time and goes to infinity as the sample period approaches infinity Correlogram does not die out - long memory 9
Example of Non-stationary Time Series 120 100 80 60 40 20 0 1992 Q3 1993 Q2 1994 Q1 1994 Q4 1995 Q3 UK GDP Level 1996 Q2 1997 Q1 1997 Q4 1998 Q3 1999 Q2 2000 Q1 2000 Q4 2001 Q3 2002 Q2 2003 Q1 The level of GDP is not constant; the mean increases over time. 10
Non-stationary time series correlogram 1.0 0.9 ACF-Y UK GDP (Y t ) 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 1 2 3 4 5 6 7 For non-stationary series the Autocorrelation Function (ACF) declines towards zero at a slow rate as k increases. 11
Possible solutions of non-stationarity Some transformation = first differenece, logarithm, second difference... First difference of UK GDP (ΔYt = Yt - Yt-1) is stationary: - growth rate is reasonably constant through time - variance is also reasonably constant through time 1.4 1.2 1 0.8 0.6 0.4 0.2 0 1992 Q3 1993 Q2 1994 Q1 1994 Q4 1995 Q3 1996 Q2 1997 Q1 1997 Q4 1998 Q3 1999 Q2 2000 Q1 2000 Q4 2001 Q3 2002 Q2 2003 Q1 12
Stationary time series - correlogram UK GDP Growth (Δ Y t ) 1.00 ACF-DY 0.75 0.50 0.25 0.00-0.25-0.50-0.75 0 1 2 3 4 5 6 7 ACF decline towards zero as k increases Decline of ACF is rapid for stationary series 13
Non-stationary Time Series Continued Random Walk X t = X t-1 + u t, where u t ~ IID(0, σ 2 ) Mean is constant in t: E(X t ) = E(X t-1 ) X 1 = X 0 + u 1 (take initial value X 0 ) 1 0 1 0 X 2 = X 1 + u 2 = (X 0 + u 1 ) + u 2 X t = X 0 + u 1 + u 2 + + u t (take expectations) E(X t ) = E(X 0 + u 1 + u 2 + + u t ) = E(X 0 ) = constant Variance is not constant in t: Var(X t ) = Var(X 0 ) + Var(u 1 ) + + Var(u t ) = 0 + σ 2 + + σ 2 = t σ 2 14
Random walk X t = X t-1 + u t u t ~ IID(0, σ 2 ) 2.5 2 1.5 1 0.5 0 15
Relationship between stationary and nonstationary process AR(1) process: X t = + α X t-1 + u t ; (u t ~ IID(0, σ 2 )) α < 1stationary process - process forgets past α = 1non-stationary process - process does not forget past = 0 without drift 0 with drift MA process is always stationary 16
Summary on basic time series processes AR (k) process MA(k) process ARMA (p,l) process If you k-th difference the data, then you have ARIMA (p,k,l) estimation of ARIMA models is a subject of next lecture 17
Spurious Regression ( spurious correlation) Problem that time-series data usually includes trend Result: Spurious correlation (variables with similar trends are correlated) Spurious regression (independent variable with similar trend looks as dependent = strong statistical relationship) coefficient significant (high adjusted-r 2, large t-statistics)... even if unrelated in economic terms 18
How to avoid spurious regression: 3 approaches to non-stationarity 1. Include a time trend as an independent variable (oldfashioned) y t = c + 1 x t + 2 t + u t...(t = 1,2,..., T) 2. 1st difference the data if variables I(1); 2nd difference if I(2) = converts non-stationary variables into stationary variables Problems: theory often about levels detrending loss of information 3. Cointegration + ECM = Long-run relationship + short-run adjustment 19
How do we identify non-stationary processes? (A) Informal methods: - Plot time series - Correlogram (B) Formal methods: - Statistical test for stationarity - Dickey-Fuller tests. 20
Informal Procedures to identify non-stationary (a) Constant mean? processes 12 RW2 10 8 6 4 2 0 0 50 100 150 200 250 300 350 400 450 500 (b) Constant variance? 200 var 150 100 50 0-50 -100-150 -200 21 0 50 100 150 200 250 300 350 400 450 500
Informal Procedures to identify non-stationary processes Diagnostic test Correlogram for stationary process (dies out rapidly, series has no memory) 0.50 whitenoise 0.25 0.00-0.25 0 50 100 150 200 250 300 350 400 450 500 1.0 ACF-whitenoise 0.5 0.0-0.5 0 5 10 22
Informal Procedures to identify non-stationary processes Diagnostic test Correlogram for a random walk (does not die out, high autocorrelation for large values of k) 12.5 10.0 randomwalk 7.5 5.0 2.5 0.0 0 50 100 150 200 250 300 350 400 450 500 1.00 ACF-randomwalk 0.75 0.50 0.25 0 5 10 23
Dickey-Fuller Test Test based on Y t = Y t-1 + u t - DF test to determine whether =1 Yes unit root non-stationary No no unit root Dynamic model: Subtract Y t-1... Y t - Y t-1 = ( -1)Y t-1 + u t Reparameterise: Y t = Y t-1 + u t where = ( -1) Test =0 equivalent to test =1 24
Augmented Dickey-Fuller Test Augment dynamic model Y t = Y t-1 + u t : 1) Constant or drift term ( 0 ) Y t = 0 + Y t-1 + u t 2) Time trend (T) Y t = 0 + T + Y t-1 + u t 3) Lagged values of the dependent variable Y t = 0 + T + Y t-1 + 1 Y t-1 + 2 Y t-2 +... + u t Find the right specification, trade-off parsimony vs. white noise in residual 25
Critical values DF/ADF use t- and F-statistics but critical values are not standard Problems: distributions of these statistics are non-standard special tables of critical values (derived from numerical simulations) Usual t- and F-tests not valid in presence of unit roots 26