Introduction to VAR Models

Introduction to VAR Models Nicola Viegi University of Pretoria July 2010 Nicola Viegi Var Models 1/23 Introduction Origins of VAR models Sims "M...
157 downloads 0 Views 174KB Size
Introduction to VAR Models

Nicola Viegi University of Pretoria July 2010

Nicola Viegi

Var Models

1/23

Introduction Origins of VAR models Sims "Macroeconomics and Reality" Econometrica 1980

It should be feasible to estimate large macromodels as unrestricted reduced forms, treating all variables as endogenous Natural extension of the univariate autoregressive model to multivariate time series ‰ Especially useful for describing the dynamic behaviour of economic and financial time series ‰ Benchmark in forecasting ‰ Used for structural inference ‰

Nicola Viegi

Var Models

2/23

Structural VAR

Consider a bivariate Yt=(yt, zt), first-order VAR model:

yt = b10 − b12zt + γ11yt −1 + γ12zt −1 +εyt zt = b20 − b21yt + γ21yt−1 + γ22zt−1 +εzt • •

• •

The two variables y and z are endogenous. The error terms (structural shocks) εyt and εzt are white noise innovations with standard deviations σy and σz and a zero covariance. Shock εyt affects y directly and z indirectly. There are 10 (8 coefficients and two standard deviations of the errors) parameters to estimate.

Nicola Viegi

Var Models

3/23

Standard VAR

• The structural is not estimable directly • VAR in reduced form is estimable. • In a reduced form representation y and z are just functions of lagged y and z. • To solve for a reduced form write the structural VAR in matrix form as:

⎡ 1 b12 ⎤ ⎡ yt ⎤ ⎡b10 ⎤ ⎡γ 11 γ 12 ⎤ ⎡ yt −1 ⎤ ⎡ε yt ⎤ =⎢ ⎥+⎢ +⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎥ ⎥ ⎢b ⎣ 21 1 ⎦ ⎣ zt ⎦ ⎣b20 ⎦ ⎣γ 21 γ 22 ⎦ ⎣ zt −1 ⎦ ⎣ε zt ⎦ or, in short

BYt = Γ0 + Γ1Yt −1 + ε t Nicola Viegi

Var Models

4/23

Standard VAR

• Premultipication by B-1 allow us to obtain a standard VAR(1):

BYt = Γ0 + Γ1Yt −1 + ε t Yt = B Γ0 + B Γ1Yt −1 + B ε t −1

−1

−1

Yt = A0 + A1Yt −1 + at • •



This reduced form can be estimated (by OLS equation by equation) Before estimating • Determine the optimal lag length of the VAR • Determine stability conditions (roots of the system inside the unit circle) After estimating the reduced form • Hypothesis Testing – Granger Casuality • Impulse Response Function • Variance Decomposition • Identification of Structural VAR

Nicola Viegi

Var Models

5/23

Determining the optimal lag length: Information Criterion in a Standard VAR(p)

Information Criteria (IC) can be used to choose the “right” number of lags in a VAR(p): that minimizes IC(p) for p=1, ..., P . 2 2 AIC = ln Σ ( p ) + (n p + n) T ln(T) 2 SBC = ln Σ ( p ) + (n p + n) T AIC criterion asymptotically overestimates the order with positive probability SBC criterion estimates the order consistently if the true p is less than the p(max) Nicola Viegi

Var Models

6/23

Stability of the system — roots of the companion matrix

Same concept of stability than in univariate time series The system is stable if the root of the matrix A1 of the system are all less than 1 in absolute value

Yt = A0 + A1Yt −1 + at If not Vector Error Correction Models and Cointegration Models more appropriate.

Nicola Viegi

Var Models

7/23

Granger Causality Test

Granger (1969) “Investigating Causal Relations by Econometric Models and Cross-Spectral Methods”, Econometrica, 37

Consider two random variables X t , Yt

Forecast of X t , s periods ahead Xˆ t (s)(1) = E( Xt +s | Xt , Xt −1,....) Xˆ t (s)(2) = E( Xt +s | Xt , Xt −1,....Yt ,Yt −1,....) Define Minimum square error

MSE( Xˆ t (s)) = E ( X t + s − Xˆ t (s))2

If MSE ( Xˆ t ( s ) (1) ) = MSE ( Xˆ t ( s ) ( 2 ) ) then Yt does not Granger - cause X t ∀ s > 0 ⇔ X t is exogenous with respect to Yt ⇔ Yt is not linearly informativ e to forecast X t Nicola Viegi

Var Models

8/23

Granger Causality Test Assume a lag length of p

X t = c1 + α1 X t −1 + α 2 X t −2 + .....α p X t − p + β1Yt −1 + β 2Yt −2 + ....β p X t − p + at Estimate by OLS and test for the following hypothesis

H 0 : β1 = β 2 = ...... = β p = 0 (Yt does not Granger - cause X t ) H1 : any β i ≠ 0 2 Unrestricted sum of squared residuals RSS1 = ∑ aˆt t

Restricted sum of squared residuals F=

RSS2 = ∑ aˆˆt

2

t

( RSS2 − RSS1 ) / p RSS1 /(T − 2 p − 1)

reject if F > Fα ,( p ,T −2 p −1)

Important – Stationarity of the data Nicola Viegi

Var Models

9/23

Impulse Response Function

Objective: Show the reaction of the system to a shock

Yt = c + Φ1Yt −1 + Φ 2Yt −2 + .... + Φ pYt − p + at If the system is covariance - stationary, Yt = µ + Ψ ( L)at = µ + at + Ψ1at −1 + Ψ2 at −2 + .... Ψ ( L) = [Φ ( L)]−1 Redating at time t + s : Yt + s = µ + at + s + Ψ1at + s −1 + Ψ2at + s −2 + .... + Ψs at + Ψs +1at −1 + ....

[ ]

∂Yt + s (s) = Ψs = ψ ij ∂a 't nxn

(multipliers)

∂yi ,t + s (s) = ψ ij ∂a jt

Reaction of the i-variable to a unit change in innovation j

Nicola Viegi

Var Models

10/23

Impulse Response Function

Impulse-response function: response of yi ,t + s to one-time impulse in y jt with all other variables dated t or earlier held constant.

∂yi ,t + s = ψ ij ∂a jt

ψ ij

1

Nicola Viegi

s

2 3

Var Models

11/23

Example: IRF for a VAR(1)

⎡σ 12 σ 12 ⎤ ⎡ y1t ⎤ ⎡φ11 φ12 ⎤ ⎡ y1t −1 ⎤ ⎡a1t ⎤ ⎥ ⎢ y ⎥ + ⎢ ⎥; Σ a = ⎢ ⎢ y ⎥ = ⎢φ ⎥ 2 ⎣ 2 t ⎦ ⎣ 21 φ22 ⎦ ⎣ 2t −1 ⎦ ⎣a2 t ⎦ ⎢⎣σ 12 σ 2 ⎥⎦ t < 0 y1t = y2 t = 0 t = 0 a20 = 1 ( y2 t increases by 1 unit) ( no more shocks occur) Reaction of the system

Nicola Viegi

⎡ y10 ⎤ ⎢y ⎥ = ⎣ 20 ⎦ ⎡ y11 ⎤ ⎢y ⎥ = ⎣ 21 ⎦

⎡0⎤ ⎢1 ⎥ ⎣ ⎦ ⎡φ11 ⎢φ ⎣ 21

(impulse) φ12 ⎤ ⎡ 0 ⎤ = ⎥ ⎢ ⎥ φ 22 ⎦ ⎣1 ⎦

⎡φ11 ⎤ ⎢φ ⎥ ⎣ 22 ⎦

⎡ y12 ⎤ ⎡φ11 ⎢ y ⎥ = ⎢φ ⎣ 22 ⎦ ⎣ 21 M

φ12 ⎤ ⎡ y11 ⎤ = φ 22 ⎥⎦ ⎢⎣ y 21 ⎥⎦

⎡ y1 s ⎤ ⎡φ11 ⎢ y ⎥ = ⎢φ ⎣ 2 s ⎦ ⎣ 21

φ12 ⎤ φ 22 ⎥⎦

Var Models

s

⎡φ11 ⎢φ ⎣ 21

φ12 ⎤ φ 22 ⎥⎦

2

⎡0⎤ ⎢1 ⎥ ⎣ ⎦

⎡0⎤ s ⎡0⎤ = Φ 1 ⎢ ⎥ ⎢1 ⎥ ⎣ ⎦ ⎣1 ⎦ 12/23

Forecast Error Variance Decomposition

Contribution of the j-th orthogonalized innovation to the MSE of the s-period ahead forecast If shocks does not explain none of the forecast error variance of at all forecast horizon we can say that the sequence is exogenous

Nicola Viegi

Var Models

13/23

Identification in a Standard VAR(1)

¾

Is it possible to recover the parameters in the structural VAR from the estimated parameters in the standard VAR? No!!

¾

There are 10 parameters in the bivariate structural VAR(1) and only 9 estimated parameters in the standard VAR(1).

¾

The VAR is underidentified.

¾

If one parameter in the structural VAR is restricted the standard VAR is exactly identified.

¾

Sims (1980) suggests a recursive system to identify the model letting b21=0. Choleski decomposition.

⎡1 b12 ⎤ ⎡ y t ⎤ ⎡ b10 ⎤ ⎡ γ11 γ12 ⎤ ⎡ y t −1 ⎤ ⎡ ε yt ⎤ +⎢ ⎥ ⎢ ⎥ ⎥ ⎢0 1 ⎥ ⎢ z ⎥ = ⎢ b ⎥ + ⎢ γ ⎣ ⎦ ⎣ t ⎦ ⎣ 20 ⎦ ⎣ 21 γ 22 ⎦ ⎣ z t −1 ⎦ ⎣ ε zt ⎦ Nicola Viegi

Var Models

14/23

Identification in a Standard VAR(1)

¾ b21=0 implies ⎡yt ⎤ ⎡1 − b12 ⎤ ⎡b10 ⎤ ⎡1 − b12 ⎤ ⎡γ11 γ12 ⎤ ⎡yt−1 ⎤ ⎡1 − b12 ⎤ ⎡εyt ⎤ ⎢z ⎥ = ⎢0 1 ⎥ ⎢b ⎥ + ⎢0 1 ⎥ ⎢γ γ ⎥ ⎢z ⎥ + ⎢0 1 ⎥ ⎢ ⎥ ⎦ ⎣ 20 ⎦ ⎣ ⎦ ⎣ 21 22 ⎦ ⎣ t−1 ⎦ ⎣ ⎦ ⎣εzt ⎦ ⎣ t⎦ ⎣ ⎡yt ⎤ ⎡a10 ⎤ ⎡a11 a12 ⎤ ⎡yt−1 ⎤ ⎡e1t ⎤ ⎢z ⎥ = ⎢a ⎥ + ⎢a a ⎥ ⎢z ⎥ + ⎢e ⎥ ⎣ t ⎦ ⎣ 20 ⎦ ⎣ 21 22 ⎦ ⎣ t−1 ⎦ ⎣ 2t ⎦ The parameters of the structural VAR can now be identified from the following 9 equations

a10 = b10 − b12b20 a 20 = b20 var(e1 ) = σ2y + b122 σ2z a11 = γ11 − b12γ21 a 21 = γ21 var(e2 ) = σ2z a12 = γ12 − b12 γ22 a 22 = γ22 cov(e1,e2 ) = −b12σz2 Nicola Viegi

Var Models

15/23

Identification in a Standard VAR(1)

¾

Both structural shocks can now be identified

¾

b21=0 implies y does not have a contemporaneous effect on z.

¾

Both εyt and εzt affect y contemporaneously but only εzt affects z contemporaneously.

¾

The residuals of e2t are due to pure shocks to z.

¾

There are other methods used to identify models – Restrictions coming from theory – (Sims Bernake, Blanchard and Quah etc)

Nicola Viegi

Var Models

16/23

Critics on VAR

¾

A VAR model can be a good forecasting model, but it is an atheoretical model (as all the reduced form models are).

¾

To calculate the IRF, the order matters: Identification not unique.

¾

Sensitive to the lag selection

¾

Dimensionality problem.

Standard Tool for Macroeconomic Analysis

Nicola Viegi

Var Models

17/23

An example of VAR analysis

Leeper Sims and Zha (1996) “What does monetary policy do”

Nicola Viegi

Var Models

18/23

The model Pt = Prices, X t = Income, M t = Money ⎡ Pt − p ⎤ ⎡ Pt ⎤ ⎡ Pt −1 ⎤ ⎡ Pt − 2 ⎤ ⎢ ⎥ Yt = ⎢⎢ X t ⎥⎥ Yt = c + Φ1 ⎢⎢ X t −1 ⎥⎥ + Φ 2 ⎢⎢ X t − 2 ⎥⎥ + ..Φ p ⎢ X t − p ⎥ + at ⎢M ⎥ ⎢⎣ M t ⎥⎦ ⎢⎣ M t −1 ⎥⎦ ⎢⎣ M t − 2 ⎥⎦ ⎣ t− p ⎦

⎡φ11 φ12 φ13 ⎤ Φ1 = ⎢φ21 φ22 φ23 ⎥ ⎥ ⎢ Where ⎢⎣φ31 φ32 φ33 ⎥⎦

(1)

And

⎧Ω t = τ E ( at ) = 0 E ( at aτ ' ) = ⎨ ⎩0 t ≠ τ

Steps: • Optimal Lag Length • Stability • Residual Analysis • Identification (if interest in structural form or in structural shocks) • Impulse Response Function • Variance Decomposition Nicola Viegi

Var Models

19/23

Optimal VAR Lag Length Selection Criteria

Nicola Viegi

Var Models

20/23

Stability of the VAR — Roots of the companion matrix

-1

-.5

Imaginary 0

.5

1

Roots of the com panion matrix

-1

-.5

0 R ea l

.5

1

Command varstable, graph after var or svar Nicola Viegi

Var Models

21/23

Granger Causality Test

Command – vargranger after varbasic, var or svar Nicola Viegi

Var Models

22/23

Cholesky Decomposition – Order Prices/Income/Money varbasic, lm 2, lm2

varbasic, lm2, lp

varbasic, lm2, ly

varbasic, lp, lm2

varbasic, lp, lp

varbasic, lp, ly

varbasic, ly, lm 2

varbasic, ly, lp

varbasic, ly, ly

.0 15 .0 1 .0 05 0 -.00 5

.0 15 .0 1 .0 05 0 -.00 5

.0 15 .0 1 .0 05 0 -.00 5 0

50

0

50

0

50

ste p 95% CI

ortho gon alized irf

Graphs by irfname, impulse variable, and response variable

varbasic lp ly lm2, lags(1/6) step(50) oirf Nicola Viegi

Var Models

23/23

Forecast Error Variance Decomposition - FEVD v arbasic, lm 2, lm2

varbas ic, lm 2, lp

varbas ic, lm2, ly

v arbasic, lp, lm2

varbas ic, lp, lp

varbas ic, lp, ly

v arbasic, ly , lm2

varbas ic, ly, lp

varbas ic, ly, ly

1 .5 0

1 .5 0

1 .5 0 0

50

0

50

0

50

ste p 95 % CI

fraction o f mse d u e to impu lse

Graphs by irfname, impulse variable, and response variable

varbasic lp ly lm2, lags(1/6) step(50) fevd Nicola Viegi

Var Models

24/23