Advanced Econometrics Marco Sunder Nov 04 2010 Marco Sunder Advanced Econometrics 1/ 25
Contents 1 2 3 Marco Sunder Advanced Econometrics 2/ 25
Music Marco Sunder Advanced Econometrics 3/ 25
Music Marco Sunder Advanced Econometrics 4/ 25
We often assume that our time series have constant first and second moments (covariance stationarity). Trends in the data have to be dealt with. (Linear) time trends are easy to spot, but what about stochastic trends (unit roots)? Simplest possible process with a unit root: random walk y t = 1 y t 1 + ε t ε is white noise y t = y 0 + ε 1 + ε 2 +... + ε t Shocks long ago do not lose their effect on today s y t (persistence) Difficult to distinguish this from AR(1) with φ 1 = 0.95 in small samples! Marco Sunder Advanced Econometrics 5/ 25
Marco Sunder Advanced Econometrics 6/ 25
The Augmented Dickey-Fuller test (ADF) starts from an AR(p) model plus a linear time trend (as an alternative trend specification. E.g.: AR(2) model y t = δ + βt + φ 1 y t 1 + φ 2 y t 2 + ε t A unit root would imply φ 1 + φ 2 = 1. Rewriting the equation yields y t y t 1 = δ + βt + (φ 1 + φ 2 1)y t 1 φ 2 y t 1 + φ 2 y t 2 + ε t y t = δ + βt + α y t 1 φ 2 y t 1 + ε t Marco Sunder Advanced Econometrics 7/ 25
Test can easily be extended to larger p, just include p 1 augmenting lags : p 1 y t = δ + βt + αy t 1 + λ j y t j + ε t Estimate the equation by OLS and choose p 1 such that the residuals are not correlated anymore. j=1 Null hypothesis of a single unit root: α = 0 (H 1 : α < 0) Caution: this test requires special critical t-values! Critical values of statistic in large samples Deterministic regressors 10% 5% 1% Intercept only 2.57 2.86 3.43 Intercept and time trend 3.12 3.41 3.96 Marco Sunder Advanced Econometrics 8/ 25
: Example lnsp500 4.5 5 5.5 6 6.5 1980m1 1985m1 1990m1 1995m1 time Figure: Logarithm of S&P 500 index Marco Sunder Advanced Econometrics 9/ 25
: Example Figure: Testing for a unit root in the levels Marco Sunder Advanced Econometrics 10/ 25
: Example Figure: Testing for a unit root in the first differences Marco Sunder Advanced Econometrics 11/ 25
Autocovariances of y: γ k = E[(y t µ)(y t k µ)], k = 0, 1, 2,... γ 0 denotes the variance of a process The autocorrelation function (ACF) is the sequence of correlation coefficients ρ k = γ j /γ 0 Empirical counterpart: ˆρ k = 1 T T t=k+1 (y t k ȳ)(y t ȳ) T t=1 (y t ȳ) 2 1 T The partial autocorrelation function (PACF) gives the strength of the association between the time series and its k th lag after controlling for lags 1 through k 1. Marco Sunder Advanced Econometrics 12/ 25
ACF and PACF may help you in determining what kind of ARMA(p,q) process may have generated a time series. Pure AR processes tend to have many spikes in the ACF and few ones in the PACF The opposite is the case for pure MA processes White noise has no autocorrelation at all (except lag zero ) If the ACF remains close to 1 for many lags, chances are the time series is not stationary Is there any (significant) autocorrelation? Ljung-Box test statistic: For white noise: Q χ 2 m Q = T (T + 2) m k=1 1 T k ˆρ2 k Marco Sunder Advanced Econometrics 13/ 25
hprescott lnsp500, stub(hp) smooth(14400) Figure: Time series of lnsp500 deviations from HP trend Marco Sunder Advanced Econometrics 14/ 25
ac hp_lnsp500_1, ylab(-1(0.5)1) lags(52) Figure: Autocorrelation function of HP deviations Marco Sunder Advanced Econometrics 15/ 25
pac hp_lnsp500_1, ylab(-1(0.5)1) lags(52) Figure: Partial autocorrelation function of HP deviations Marco Sunder Advanced Econometrics 16/ 25
Figure: in STATA Marco Sunder Advanced Econometrics 17/ 25
ARMA models Figure: ARMA(2,0) model for lnsp500 deviations from HP trend Marco Sunder Advanced Econometrics 18/ 25
ARMA models Figure: ARMA(2,1) model for lnsp500 deviations from HP trend Marco Sunder Advanced Econometrics 19/ 25
ARMA models Estimated ARMA(2,0) process: y t = 0.001 + 1.213y t 1 0.365y t 2 + ε t T = 189, AIC = 777.3, BIC = 764.3 Estimated ARMA(2,1) process: y t = 0.001 + 1.176y t 1 0.332y t 2 + ε t + 0.043 ε t 1 T = 189, AIC = 775.3, BIC = 759.1 How could one select a preferred specification? Akaike information criterion: AIC = 2 ln L + 2(# parameters) Schwarz Bayesian information criterion: BIC = 2 ln L + (# parameters) ln T Less is better! BIC tends to favor more parsimonious specifications. Marco Sunder Advanced Econometrics 20/ 25
Frequency domain analysis Autocovariances of a stationary process 1 can be cast into the frequency domain (Fourier transform). The resulting spectral density function f ( spectrum ) helps us identify cyclical features of the process: are there frequency bands that contribute heavily to the overall variance? Spectral density of a covariance-stationary process f (λ) = γ k exp{i2πλk} = γ 0 + 2 γ k cos(2πλk) k= λ frequency [0, 0.5] i imaginary number 1 k=1 Notice: White noise process has γ k = 0 k > 0 flat spectrum 1 with the property k= γ k < Marco Sunder Advanced Econometrics 21/ 25
Frequency domain analysis: periodogram If you have a time series rather than a theoretical process, you could use the Fourier transform formula and replace γ k by its estimate ˆγ k. The result is called periodogram: T 1 ˆf (λ) = ˆγ 0 + 2 ˆγ j cos(2πλk) Problem: Periodogram is not a consistent estimator of the spectral density as its variance does not approach zero with T. Longer time horizons imply that more covariances can be estimated. Covariances are not all based on the same subsample. k=1 Alternative 1: smoothing the periodogram Alternative 2: obtain spectrum from theoretical covariances implied by ARMA model Marco Sunder Advanced Econometrics 22/ 25
Frequency domain analysis: periodogram pergram hp_lnsp500_1 Figure: Periodogram for HP-filtered lnsp500 Marco Sunder Advanced Econometrics 23/ 25
ARMA models: spectral analysis ARMA processes imply certain autocorrelation structures These can be used to construct the spectral density of the process Spectrum of an ARMA(p,q) process f (λ) = 1 q h=1 θ h exp{i2πλh} 2 1 p j=1 φ j exp{i2πλj} 2 λ frequency [0, 0.5] i imaginary number 1 Set q = 1, θ 1 = 0 if you have a pure AR model Marco Sunder Advanced Econometrics 24/ 25
ARMA models: spectral analysis arima hp_lnsp500_1, arima(8,0,0) do armaspec Figure: Spectrum for AR(8) model estimated for HP-filtered lnsp500 Marco Sunder Advanced Econometrics 25/ 25