ECON/FIN 250: Forecasting in Finance and Economics: Section 7: Unit Roots & Dickey-Fuller Tests Patrick Herb Brandeis University Spring 2016 Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 1 / 27
Course Overview 1 Key Objectives 2 ARIMA Processes 3 Testing for Unit Roots Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 2 / 27
Key Objectives 1 Key Objectives 2 ARIMA Processes 3 Testing for Unit Roots Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 3 / 27
Key Objectives ARIMA Processes Dickey-Fuller Tests Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 4 / 27
Stochastic Trends Random Walk y t = y t 1 + ɛ t, ɛ t WN(0, σ 2 ) (1) Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 5 / 27
Stochastic Trends Random Walk y t = y t 1 + ɛ t, ɛ t WN(0, σ 2 ) (1) Random Walk with Drift y t = δ + y t 1 + ɛ t, ɛ t WN(0, σ 2 ) (2) Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 5 / 27
Stochastic Trends Geometric Random Walk log(y t ) = log(y t 1 ) + ɛ t, ɛ t WN(0, σ 2 ) (3) Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 6 / 27
Stochastic Trends Geometric Random Walk log(y t ) = log(y t 1 ) + ɛ t, ɛ t WN(0, σ 2 ) (3) Geometric Random Walk with Drift log(y t ) = δ + log(y t 1 ) + ɛ t, ɛ t WN(0, σ 2 ) (4) Better for series where percentage changes are constant magnitude over time: stock prices, GDP... Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 6 / 27
Basic Random Walk Properties y 0 + y t = y t 1 + ɛ t, ɛ t WN(0, σ 2 ) (5) y t = t ɛ i (6) Starting at y 0 i=1 Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 7 / 27
Basic Random Walk Properties y 0 + y t = y t 1 + ɛ t, ɛ t WN(0, σ 2 ) (5) y t = t ɛ i (6) Starting at y 0 i=1 E[y t ] = y 0 (7) Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 7 / 27
Basic Random Walk Properties y 0 + y t = y t 1 + ɛ t, ɛ t WN(0, σ 2 ) (5) y t = t ɛ i (6) Starting at y 0 i=1 E[y t ] = y 0 (7) T Var[y t ] = E[ɛ 2 i ] = tσɛ 2 (8) i=1 Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 7 / 27
Basic Random Walk Properties y 0 + y t = y t 1 + ɛ t, ɛ t WN(0, σ 2 ) (5) y t = t ɛ i (6) Starting at y 0 i=1 E[y t ] = y 0 (7) T Var[y t ] = E[ɛ 2 i ] = tσɛ 2 (8) i=1 lim Var[y t] = (9) t Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 7 / 27
Basic Random Walk with Drift Properties tδ y t = δ + y t 1 + ɛ t, ɛ t WN(0, σ 2 ) (10) yt = y0 + T + ɛ i (11) Starting at y 0 i=1 Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 8 / 27
Basic Random Walk with Drift Properties tδ y t = δ + y t 1 + ɛ t, ɛ t WN(0, σ 2 ) (10) yt = y0 + T + ɛ i (11) Starting at y 0 i=1 E[y t ] = y 0 + tδ (12) Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 8 / 27
Basic Random Walk with Drift Properties tδ y t = δ + y t 1 + ɛ t, ɛ t WN(0, σ 2 ) (10) yt = y0 + T + ɛ i (11) Starting at y 0 i=1 E[y t ] = y 0 + tδ (12) T Var[y t ] = E[ɛ 2 i ] = tσɛ 2 (13) i=1 Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 8 / 27
Basic Random Walk with Drift Properties tδ y t = δ + y t 1 + ɛ t, ɛ t WN(0, σ 2 ) (10) yt = y0 + T + ɛ i (11) Starting at y 0 i=1 E[y t ] = y 0 + tδ (12) T Var[y t ] = E[ɛ 2 i ] = tσɛ 2 (13) i=1 lim Var[y t] = (14) t Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 8 / 27
Random Walk Forecasts y t = y t 1 + ɛ t, ɛ t WN(0, σ 2 ) (15) Forecast h steps ahead starting at time T h y T +h = y T + ɛ T +i (16) i=1 Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 9 / 27
Random Walk Forecasts y t = y t 1 + ɛ t, ɛ t WN(0, σ 2 ) (15) Forecast h steps ahead starting at time T h y T +h = y T + ɛ T +i (16) i=1 E[y T +h Ω T ] = y T, h (17) Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 9 / 27
Random Walk Forecasts y t = y t 1 + ɛ t, ɛ t WN(0, σ 2 ) (15) Forecast h steps ahead starting at time T h y T +h = y T + ɛ T +i (16) i=1 E[y T +h Ω T ] = y T, h (17) Var[y T +h Ω] = E[(y T +h E[y T +h Ω T ]) 2 ] (18) Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 9 / 27
Random Walk Forecasts y t = y t 1 + ɛ t, ɛ t WN(0, σ 2 ) (15) Forecast h steps ahead starting at time T h y T +h = y T + ɛ T +i (16) i=1 E[y T +h Ω T ] = y T, h (17) Var[y T +h Ω] = E[(y T +h E[y T +h Ω T ]) 2 ] (18) h Var[y T +h Ω T ] = E[(y T +h y T ) 2 ] = ɛ 2 T +i = hσɛ 2 (19) i=1 Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 9 / 27
Random Walk Forecast Intuitive Properties Best forecast is current value Longer forecasts don t converge to the mean Forecast variance expand linearly in h as hσ 2 ɛ Forecast std s expand as h or hσ ɛ Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 10 / 27
ARIMA Processes 1 Key Objectives 2 ARIMA Processes 3 Testing for Unit Roots Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 11 / 27
Integrated Processes ARIMA(p,d,q) An AR(p) process is a unit root process if one of the roots of the lag operator polynomial is equal to one Unit roots result in nonstationary behavior Differencing a random walk process integrates or undoes the unit root. Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 12 / 27
Integrated Processes ARIMA(p,d,q) An AR(p) process is a unit root process if one of the roots of the lag operator polynomial is equal to one Unit roots result in nonstationary behavior Differencing a random walk process integrates or undoes the unit root. y t y t 1 = ɛ t (20) The difference is a white noise process z t = ɛ t, ɛ t WN(0, σ 2 ) (21) Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 12 / 27
More Examples Consider an ARIMA(1,1,0) Difference is AR(1) y t y t 1 = φ(y t 1 y t 2 ) + ɛ t (22) z t = φz t 1 + ɛ t (23) Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 13 / 27
More Examples Consider an ARIMA(1,1,1) Difference is ARMA(1,1) y t y t 1 = φ(y t 1 y t 2 ) + θɛ t 1 + ɛ t (24) z t = φz t 1 + θɛ t 1 + ɛ t (25) Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 14 / 27
Differencing vs. Detrending Differencing a Stochastic Trend Model y t = a 0 + y t 1 + ɛ t (26) t y t = y 0 + a 0 t + ɛ i (27) i=1 t 1 y t 1 = y 0 + a 0 (t 1) + ɛ i (28) i=1 y t = a 0 + ɛ t (29) The difference is stationary A series with a unit root can be transformed into a stationary series by differencing Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 15 / 27
Differencing vs. Detrending Differencing a Deterministic Trend Model y t = y 0 + a 1 t + ɛ t (30) y t 1 = y 0 + a 1 (t 1) + ɛ t 1 (31) y t = a 1 + ɛ t + ɛ t 1 (32) The difference is not stationary (not invertible) Need to detrend data with deterministic time trend, not (necessarily) difference A trend-stationary series can be transformed into a stationary series by removing the deterministic trend Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 16 / 27
ARIMA Notation and Methods ARIMA(p,d,q) p = AR q = MA d = differencing level What is differencing level? d = 1, y t y t 1 is ARMA(p,q) d = 2, (y t y t 1 ) (y t 1 y t 2 ) is ARMA(p,q) d = 3, keep going. Higher order differencing is rare in economics data Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 17 / 27
What do you do? If you know d Difference y t d times Estimate ARMA components Generate forecasts of ẑ t Add back together ŷ t = ŷ t 1 + ẑ t Problem: You often don t know d In economics data, the question is often between d = 1 or d = 0 Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 18 / 27
In Lag Notation ARMA(p,q) Φ(L)y t = c + Θ(L)ɛ t (33) ARIMA(p,1,q) ARIMA(p,d,q) Φ(L) = 1 φ 1 L φ 2 L 2 +... φ p L p (34) Θ(L) = 1 θ 1 L θ 2 L 2 +... θ q L q (35) Φ(L)(1 L)y t = c + Θ(L)ɛ t (36) Φ(L)(1 L) d y t = c + Θ(L)ɛ t (37) Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 19 / 27
Testing for Unit Roots 1 Key Objectives 2 ARIMA Processes 3 Testing for Unit Roots Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 20 / 27
Testing d = 0 or d = 1 What about regressing y t = φy t 1 + ɛ t? Test for φ = 1 Many people did this a while ago It turns out the distribution of φ is not t-distribution Proper tests have Dickey-Fuller-distribution Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 21 / 27
Dickey-Fuller Tests y t = φy t 1 + ɛ t (38) y t y t 1 = (φ 1)y t 1 + ɛ t (39) y t = γy t 1 + ɛ t (40) Regress y t y t 1 on y t 1 Testing is γ = 0 is equivalent to testing φ = 1 The null hypothesis is γ = 0, φ = 1, or {y t } has a unit root the alternative is (φ 1) < 0 Failing to reject unit root Rejecting the null no unit root Alternative would be φ < 1 stationary AR(1) Alternatives are important Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 22 / 27
Dickey-Fuller Tests: Expanding the Alternative Random Walk + Drift y t = a 0 + γy t 1 + ɛ t (41) Random Walk + Drift + Deterministic Time Trend y t = a 0 + γy t 1 + a 2 t + ɛ t (42) Test if γ = 0 to determine if process has unit root Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 23 / 27
Augmented Dickey-Fuller Null: Random Walk + AR(p); Alternative: AR(p) + No Mean p y t = γy t 1 + β i y t i+1 + ɛ t (43) i=2 Null: Random Walk + Drift + AR(p); Alternative: AR(p) + Mean p y t = a 0 + γy t 1 + β i y t i+1 + ɛ t (44) i=2 Null: Random Walk + Drift + Deterministic Time Trend + AR(p); Alternative: AR(p)+Trend p y t = a 0 + γy t 1 + a 2 t + β i y t i+1 + ɛ t (45) i=2 Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 24 / 27
Dickey-Fuller Instructions Don t worry about critical values and tests, they are performed by all good software. Do worry about interpretation and alternatives. No software does this Basic Steps Is your data trending over time? If yes, use form 3 If no obvious trend, then use form 1 or 2 depending on mean Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 25 / 27
Stata Code: Forms 1-3 1 dfuller lgdp, noconstant reg lags(k) 2 dfuller lgdp, reg lags(k) 3 dfuller lgdp, trend reg lags(k) The reg option prints out regression coefficients Skipping the drift option Try this with U.S. GDP data Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 26 / 27
Size and Power: Important Unit root testing can be difficult The Power of the Dickey-Fuller test can be low Higher chance of Type II error Failing to reject a false null hypothesis Failing to reject a unit root when there is no unit root Often accept random walk null when time trend might be true model Think about your data Patrick Herb (Brandeis University) Unit Root Tests ECON/FIN 250: Spring 2016 27 / 27