Lecture 7a: Vector Autoregression (VAR)

Similar documents
Lecture 7a: Vector Autoregression (VAR)

Lecture 8a: Spurious Regression

Time Series Analysis. James D. Hamilton PRINCETON UNIVERSITY PRESS PRINCETON, NEW JERSEY

Time Series Analysis for Macroeconomics and Finance

A primer on Structural VARs

Simultaneous Equation Models Learning Objectives Introduction Introduction (2) Introduction (3) Solving the Model structural equations

Autoregressive distributed lag models

Lecture 4a: ARMA Model

Econometría 2: Análisis de series de Tiempo

Structural VAR Models and Applications

Time Series Analysis. James D. Hamilton PRINCETON UNIVERSITY PRESS PRINCETON, NEW JERSEY

Title. Description. var intro Introduction to vector autoregressive models

Vector autoregressions, VAR

Lecture 8a: Spurious Regression

ECON 4160, Spring term Lecture 12

Multivariate Time Series Analysis and Its Applications [Tsay (2005), chapter 8]

Structural VARs II. February 17, 2016

Cointegrated VAR s. Eduardo Rossi University of Pavia. November Rossi Cointegrated VAR s Financial Econometrics / 56

Multivariate Time Series: VAR(p) Processes and Models

New Introduction to Multiple Time Series Analysis

ECON 4160, Lecture 11 and 12

Class 4: VAR. Macroeconometrics - Fall October 11, Jacek Suda, Banque de France

Notes on Time Series Modeling

VAR Model. (k-variate) VAR(p) model (in the Reduced Form): Y t-2. Y t-1 = A + B 1. Y t + B 2. Y t-p. + ε t. + + B p. where:

1 Teaching notes on structural VARs.

Econ 423 Lecture Notes: Additional Topics in Time Series 1

Lecture 6a: Unit Root and ARIMA Models

Unit roots in vector time series. Scalar autoregression True model: y t 1 y t1 2 y t2 p y tp t Estimated model: y t c y t1 1 y t1 2 y t2

ECON 4160: Econometrics-Modelling and Systems Estimation Lecture 9: Multiple equation models II

ECON 4160, Autumn term 2017 Lecture 9

A Primer on Vector Autoregressions

When Do Wold Orderings and Long-Run Recursive Identifying Restrictions Yield Identical Results?

B y t = γ 0 + Γ 1 y t + ε t B(L) y t = γ 0 + ε t ε t iid (0, D) D is diagonal

FINANCIAL ECONOMETRICS AND EMPIRICAL FINANCE -MODULE2 Midterm Exam Solutions - March 2015

Vector Auto-Regressive Models

Block Bootstrap Prediction Intervals for Vector Autoregression

VAR Models and Applications

1 Teaching notes on structural VARs.

Structural Vector Autoregressions with Markov Switching. Markku Lanne University of Helsinki. Helmut Lütkepohl European University Institute, Florence

It is easily seen that in general a linear combination of y t and x t is I(1). However, in particular cases, it can be I(0), i.e. stationary.

Financial Econometrics

10. Time series regression and forecasting

Multivariate forecasting with VAR models

1. Shocks. This version: February 15, Nr. 1

Inverse of a Square Matrix. For an N N square matrix A, the inverse of A, 1

Multivariate Time Series

Advanced Econometrics

CHAPTER 21: TIME SERIES ECONOMETRICS: SOME BASIC CONCEPTS

Multivariate Time Series: Part 4

Vector error correction model, VECM Cointegrated VAR

Stationarity and Cointegration analysis. Tinashe Bvirindi

Vector Autoregression

TESTING FOR CO-INTEGRATION

9. Multivariate Linear Time Series (II). MA6622, Ernesto Mordecki, CityU, HK, 2006.

Factor models. May 11, 2012

Identifying the Monetary Policy Shock Christiano et al. (1999)

1. Introduction. Hang Qian 1 Iowa State University

Factor models. March 13, 2017

Empirical Market Microstructure Analysis (EMMA)

Lecture: Simultaneous Equation Model (Wooldridge s Book Chapter 16)

Bootstrapping the Grainger Causality Test With Integrated Data

Vector Autogregression and Impulse Response Functions

G. S. Maddala Kajal Lahiri. WILEY A John Wiley and Sons, Ltd., Publication

Cointegrated VAR s. Eduardo Rossi University of Pavia. November Rossi Cointegrated VAR s Fin. Econometrics / 31

The Linear Regression Model

2.5 Forecasting and Impulse Response Functions

1 Regression with Time Series Variables

Oil price and macroeconomy in Russia. Abstract

MA Advanced Macroeconomics: 4. VARs With Long-Run Restrictions

EC408 Topics in Applied Econometrics. B Fingleton, Dept of Economics, Strathclyde University

Økonomisk Kandidateksamen 2004 (I) Econometrics 2. Rettevejledning

Econometric Methods for Panel Data

Multivariate Models. Christopher Ting. Christopher Ting. April 19,

Computational Macroeconomics. Prof. Dr. Maik Wolters Friedrich Schiller University Jena

Lecture#17. Time series III

Predicting bond returns using the output gap in expansions and recessions

Motivation for multiple regression

07 Multivariate models: Granger causality, VAR and VECM models. Andrius Buteikis,

Vector Autoregression

Cointegration Lecture I: Introduction

1.2. Structural VARs

VAR Models and Cointegration 1

11. Further Issues in Using OLS with TS Data

Massachusetts Institute of Technology Department of Economics Time Series Lecture 6: Additional Results for VAR s

A Non-Parametric Approach of Heteroskedasticity Robust Estimation of Vector-Autoregressive (VAR) Models

MAT3379 (Winter 2016)

Questions and Answers on Unit Roots, Cointegration, VARs and VECMs

Time series: Cointegration

Econometrics I KS. Module 2: Multivariate Linear Regression. Alexander Ahammer. This version: April 16, 2018

Matrix Factorizations

End-Semester Examination MA 373 : Statistical Analysis on Financial Data

A. Recursively orthogonalized. VARs

Bayesian Graphical Models for Structural Vector AutoregressiveMarch Processes 21, / 1

News Shocks, Information Flows and SVARs

Variable Targeting and Reduction in High-Dimensional Vector Autoregressions

ξ t = Fξ t 1 + v t. then λ is less than unity in absolute value. In the above expression, A denotes the determinant of the matrix, A. 1 y t 1.

Introduction to Econometrics

Chapter 12: An introduction to Time Series Analysis. Chapter 12: An introduction to Time Series Analysis

(I AL BL 2 )z t = (I CL)ζ t, where

APPLIED TIME SERIES ECONOMETRICS

Transcription:

Lecture 7a: Vector Autoregression (VAR) 1

2 Big Picture We are done with univariate time series analysis Now we switch to multivariate analysis, that is, studying several time series simultaneously. VAR is one of the most popular multivariate models

3 VAR(1) Consider a bivariate system (y t,x t ). For example, y t is the inflation rate, and x t is the unemployment rate. The relationship between them is Phillips Curve. The first order VAR for this bivariate system is y t = ϕ 11 y t 1 + ϕ 12 x t 1 + u t (1) x t = ϕ 21 y t 1 + ϕ 22 x t 1 + v t (2) So each variable depends on the first lag of itself and the other variable.

4 Matrix Form The matrix form for VAR(1) is y t x t = ϕ 11 ϕ 12 ϕ 21 ϕ 22 y t 1 x t 1 + u t v t (3) or z t = ϕz t 1 + w t (Reduced Form) (4) where z t = y t x t, ϕ = ϕ 11 ϕ 12 ϕ 21 ϕ 22, and w t = u t v t

5 Spectral Decomposition Let λ i and c i be the eigenvalue and corresponding eigenvector of ϕ. Consider the spectral decomposition (assuming λ 1 λ 2 ): ϕ = CΛC 1, (spectral decomposition), C = (c 1,c 2 ),Λ = Diag(λ 1,λ 2 ) (5) Let η t = C 1 z t, we can rewrite the VAR(1) as η t = Λη t 1 +C 1 w t (6) 1. If λ 1 and λ 2 are both less than unity in absolute value, then η 1t,η 1t, y t and x t are all I(0) 2. If λ 1 is unity and λ 2 is less than unity in absolute value, then η 1t is I(1), and η 2t is I(0). Now y t and x t are both I(1), but a linear combination of them is I(0) 3. If λ 1 and λ 2 are both unity, Jordan Form is needed. Then y t and x t are both I(2), but a linear combination of them is I(1)

6 Stationarity Condition 1. (y t,x t ) are both stationary when the eigenvalues of ϕ are less than one in absolute value. 2. (y t,x t ) are both integrated of order one, and y t and x t are cointegrated when one eigenvalue is unity, and the other eigenvalue is less than one in absolute value. 3. (y t,x t ) are both integrated of order two if both eigenvalues of ϕ are unity.

7 OLS Estimation 1. Each equation in the VAR can be estimated by OLS. 2. Then the variance covariance matrix for the error vector Ω = Ew t w t = σ 2 u σ u,v σ u,v σv 2 can be estimated by where û t and ˆv t are residuals. Ω = T 1 û 2 t û t ˆv t û t ˆv t ˆv 2 t

8 Granger Causality The Granger Causality (GC) test is concerned with whether lagged x t helps explain y t, and vice versa. The null hypotheses are H 0 : ϕ 12 = 0 (x does not Granger cause y) (7) H 0 : ϕ 21 = 0 (y does not Granger cause x) (8) We can test each null hypothesis using the F test. The null hypothesis is rejected when the p-value is less than 0.05. Warning: Granger Causality Causality. Granger causality is about in-sample fitting. It tells nothing about out-of-sample forecasting.

9 Impulse Response Using the lag operator we can show the MA( ) representation for the VAR(1) is z t = w t + ϕw t 1 + ϕ 2 w t 2 +... + ϕ j w t j +... (9) The coefficient in the MA representation measures the impulse response: ϕ j = dz t dw t j (10) Note ϕ j is a 2 2 matrix for a bivariate system.

10 Impulse Response II More generally, denote the (m,n)-th component of ϕ j by ϕ j (m,n) Then ϕ j (m,n) measures the response of m-th variable to the n-th error after j periods. For example, ϕ 3 (1,2) measures the response of first variable to the error of the second variable after 3 periods. We can plot the impulse response against j. That is, for a given impulse response plot, we let j varies while holding m and n constant. For a bivariate system, there are four impulse responses plots.

11 Impulse Response III In general u t and v t are contemporaneously correlated (not-orthogonal), i.e., σ u,v 0 Therefore we can not, say, hold v constant and let only u vary. However, we can always find a lower triangular matrix A so that Ω = AA (Cholesky Decomposition) (11) Then define a new error vector w t as (linear transformation of old error vector w t ) w t = A 1 w t (12) By construction the new error is orthogonal because its variance-covariance matrix is diagonal: var( w t ) = A 1 var(w t )A 1 = A 1 ΩA 1 = A 1 AA A 1 = I

Cholesky Decomposition 12 Let A = a 0 b c. The Cholesky Decomposition tries to solve a 0 b c a b 0 c = σ 2 u σ u,v σ u,v σ 2 v The solutions for a,b,c always exist and they are a = σu 2 (13) b = σ u,v σ 2 u (14) c = σ 2 v σ 2 u,v σ 2 u (15)

13 Positive Definite Matrix Note c is always a real number since Ω is a variance-covariance matrix, and so is positive definite (i.e., σv 2 σ u,v 2 is always positive because the determinant of Ω, or the second leading σu 2 principal minor, is positive).

14 Impulse Response to Orthogonal Errors Rewrite the MA( ) representation as z t = w t + ϕw t 1 +... + ϕ j w t j +... (16) = AA 1 w t + ϕaa 1 w t 1 +... + ϕ j AA 1 w t j +... (17) = A w t + ϕa w t 1 +... + ϕ j A w t j +... (18) This implies that the impulse response to the orthogonal error w t after j periods ( j = 0,1,2,...) is where A satisfies (11). j-th orthogonal impulse response = ϕ j A (19)

15 Reduced Form and Structural Form 1. (4) is called reduced form and the reduced form error w t is not orthogonal. 2. The so called structural form is a linear transformation of the reduced form: z t = ϕz t 1 + w t (20) A 1 z t = A 1 ϕz t 1 + A 1 w t (21) A 1 z t = A 1 ϕz t 1 + w t (22) where the structural form error w t is orthogonal.

16 Inverse of Matrix Let M = a c b d be a 2 2 matrix. The inverse of M, denoted by M 1, is M 1 = ( ) 1 d b ad bc c a where ad bc is the determinant of M : M = ad bc. You can check that MM 1 = M 1 M = I

Structural Form 17 1. The Structural Form VAR is A 1 z t = A 1 ϕz t 1 + w t (Structural Form) (23) 2. Note A 1 is lower triangular. So we have following recursive from (suggested by Sims (1980)) A 1 z t = 1/a 0 y t (1/a)y = t b/(ac) 1/c x t ( b/(ac))y t + (1/c)x t 3. That means x t will not appear in the regression for y t, whereas y t will appear in the regression for x t. 4. In words, x does not contemporaneously affect y, but y contemporaneously affects x. Example is that x is Hong Kong s interest rate, while y is US interest rate. 5. Sims method is limited in the sense that the result is sensitive to choice or rank of y and x.

Structural Form VAR I 18 1. In general, the reduced form VAR(1) is and the corresponding structural form is z t = ϕz t 1 + B w t (24) B 1 z t = B 1 ϕz t 1 + w t (25) 2. Because B 1 is generally not diagonal, y t and x t are related contemporaneously in the structural form. 3. Because we use B 1 to account for the contemporaneous correlation, we can always (safely) assume the structural error is orthogonal, i.e., var( w t ) = I. 4. The structural form error vector and reduced form error vector are related since B w t = w t

19 Why is it called structural form? 1. Because in the structural VAR there is instantaneous interaction between y t and x t. 2. Both y t and x t are endogenous, and the regressors include the current value of endogenous variables in the structural form. 3. The structural VAR is one example of the simultaneous equation model (SEM) 4. We cannot estimate the structural VAR using per-equation OLS, due to the bias of simultaneity. 5. We can estimate the reduced form using per-equation OLS. Then we recover the structural form from the reduced form, with (identification) restriction imposed.

20 Structural Form VAR II 1. Let Ω = E(w t w t) be the observed variance covariance matrix. It follows that BB = Ω 2. The goal of structural VAR analysis is to obtain B, which is not unique (for a bivariate system Ω has 3 unique elements, while B has 4 elements to be determined). 3. The Sims (1980) structural VAR, which is of the recursive form, imposes the restriction that B is lower triangular. 4. The Blanchard Quah structural VAR obtains B by looking at the long run effect of the w t.

21 MA Representation Consider a univariate AR(p) y t = ϕ 1 y t 1 +... + ϕ p y t p + e t Using the lag operator we can write (I ϕ 1 L... ϕ p L p )y t = e t We can obtain the MA representation by inverting (I ϕ 1 L... ϕ p L p ) : y t = (I ϕ 1 L... ϕ p L p ) 1 e t = e t + θ 1 e t 1 + θ 2 e t 2 +...

22 Long Run Effect The long run effect (LRE) of e t is LRE dy t de t + dy t+1 de t + dy t+2 de t +... (26) = I + θ 1 + θ 2 +... (27) = (I ϕ 1... ϕ p ) 1 (28) In words, we need to invert the lag polynomial (I ϕ 1 L... ϕ p L p ) and replace L with identity matrix I.

23 Blanchard Quah (BQ) Decomposition I 1. The long run effect of B w t in the structural VAR(1) is (I ϕ) 1 B Q 2. BQ assumes the long run effect is a lower triangular matrix. That is, Q is the Cholesky decomposition of QQ = (I ϕ) 1 Ω ( (I ϕ) 1) 3. Then B matrix can be solved as B = (I ϕ)q.

24 Blanchard Quah (BQ) Decomposition II In Blanchard and Quah (1989, AER) paper, the authors assume that the demand shock (the first structural error ũ t ) have zero long run effect on GDP, while the supply shock (the second structural error ṽ t ) has nonzero long run effect on GDP.

25 VAR(p) 1. More generally, a p-th order reduced-form VAR is z t = ϕ 1 z t 1 + ϕ 2 z t 2 +... + ϕ p z t p + w t (29) 2. For a bivariate system, z t is a 2 1 vector, and ϕ i,(i = 1,..., p), is 2 2 matrix 3. Rigorously speaking we need to choose a big enough p so that w t is serially uncorrelated (and the resulting model is dynamically adequate). 4. But in practice, many people choose p by minimizing AIC.

26 Simulate Impulse Response I 1. Consider a VAR(2) for a bivariate system z t = ϕ 1 z t 1 + ϕ 2 z t 2 + w t (30) 2. Suppose we want to obtain the impulse response to the first structural error. That is, we let w t = 1 0, w t+i = 0,(i = 1,2,...) 3. From (12) we can compute the corresponding reduced-form error as w t = A w t, which picks the first column of A. Denoted it by A(1c).

27 Simulate Impulse Response II Denote the impulse response after j periods by IR( j), which is a 2 1 vector. It can be computed recursively as IR(1) = A(1c) (31) IR(2) = ϕ 1 IR(1) (32) IR(3) = ϕ 1 IR(2) + ϕ 2 IR(1) (33)... =... (34) IR( j) = ϕ 1 IR( j 1) + ϕ 2 IR( j 2) (35) To get the impulse response to the second structural form error, just let w t = should change to A(2c). Everything else remains unchanged. 0 1 and A(1c)

28 Interpret Impulse Response For VAR, it is more useful to report the impulse response than the autoregressive coefficient Impulse response is useful for policy analysis. It can answer question like what will happen to GDP after j periods if a demand shock happens now?

Lecture 7b: VAR Application 29

30 Big Picture We will run VAR(1) using simulated data We know the true data generating process, and we can evaluate the preciseness of the estimate. Running VAR using real data will be left as exercise

31 Package vars First we need to download and install the package vars The PDF file of the manual for this package can be found at cran.r-project.org/web/packages/vars/vars.pdf Then we can load the package using library(vars)

32 Data Generating Process (DGP) The DGP is a bivariate VAR(1) with the coefficient matrix ϕ = 0.3 0 0.5 0.6 and z t = y t x t,w t = u t v t 1. The eigenvalues of ϕ are 0.3 and 0.6. Both are less than unity. So both series in this system are stationary. 2. By construction, x does not Granger cause y, but y Granger causes x. Here u and v are uncorrelated, but are usually correlated in reality.

33 R set.seed(1000) # so the simulation result can be duplicated n = 200 # sample size = 200 z = as.matrix(cbind(rep(0, n),rep(0, n))) w = as.matrix(cbind(rnorm(n), rnorm(n))) phi = as.matrix(cbind(c(0.3, 0.5), c(0, 0.6))) for (i in 2:n) { z[i,] = phi %*% z[i-1,] + w[i,] }

34 Unit Root Test In practice we always test unit roots for each series before running VAR. The commands are adf.test(z[,1], k = 1) adf.test(z[,1], k = 4) adf.test(z[,2], k = 1) adf.test(z[,2], k = 4) In this case, unit root is rejected (with p-value less than 0.05), so VAR can be applied. If unit roots cannot be rejected then 1. Running VAR using differenced data if series are not cointegrated 2. Running Error Correction Model if series are cointegrated

35 Selecting the Lag Number p In theory we should include sufficient lagged values so that the error term is serially uncorrelated. In practice, we can choose p by minimizing AIC VARselect(z) In this case, the VAR(1) has the smallest AIC -0.06176601, and so is chosen.

36 Estimate VAR var.1c = VAR(z, p=1, type = "both") summary(var.1c) var.1c = VAR(z, p=1, type = "none") summary(var.1c) 1. We start with a VAR(1) with both intercept term and trend term. Then we both terms are insignificant. 2. Next we run VAR(1) without intercept term or trend.

37 Result The estimation result for y (the first series) is Estimate Std.Error t value Pr(> t ) y1.l1 0.25493 0.06887 3.702 0.000278 *** y2.l1-0.05589 0.04771-1.171 0.242875 1. ˆϕ 11 = 0.25493, close to the true value 0.3 2. ˆϕ 12 = 0.05589, and is insignificant So the estimated regression for y t is y t = 0.25493y t 1 0.05589x t 1 Exercise: find the estimated regression for x t

38 Equation-by-Equation OLS Estimation We can get the same result by using these commands y = z[,1] ylag1 = c(na, y[1:n-1]) x = z[,2] xlag1 = c(na, x[1:n-1]) eqy = lm(y ylag1+xlag1-1) summary(eqy) # without intercept Exercise: What are the R commands that estimate the regression for x (the second series)?

39 Variance-Covariance Matrix I The true variance-covariance matrix (VCM) for the vector of error terms are identity matrix Ω = E(w t w t) = E u t ( ) u t v t = 1 0 0 1 v t The estimated VCM is Ω = 0.9104 0.0391 0.0391 0.9578 which is close to the true VCM.

40 Variance-Covariance Matrix II To get Ω we need to keep the residuals and then compute two variances and one covariance (with adjustment of degree of freedom) sigmau2 = var(resy)*(n-1)/(n-2) sigmav2 = var(resx)*(n-1)/(n-2) sigmauv = cov(resy,resx)*(n-1)/(n-2) omegahat = as.matrix(cbind(c(sigmau2, sigmauv), c(sigmauv, sigmav2)

41 Cholesky Decomposition of Ω The Cholesky Decomposition is Ω = AA where A is lower triangular matrix. But the R function chol returns A so we need to transpose it in order to get A : A = (A ) The R commands are Aprime = chol(omegahat) A = t(aprime) The matrix A will be used to construct impulse response to orthogonal (or structural form) errors

42 Impulse Response to Orthogonal Errors The responses of y and x to the one-unit impulse of the orthogonal (structural-form) the error for y can be obtained as wtilde = as.matrix(c(1,0)) A1c = A%*%wtilde # or A1c = A[,1] if1 = A1c if2 = phihat%*%if1 if3 = phihat%*%if2 if4 = phihat%*%if3

43 Impulse Response to Orthogonal Errors II You can get the same result using the R command var1c.11 = irf(var.1c, impulse = "y1", response="y1", boot=true) var1c.11 plot(var1c.11) var1c.21 = irf(var.1c, impulse = "y1", response="y2", boot=true) var1c.21 plot(var1c.21)

44 Granger Causality Test The R command is causality(var.1c, cause = c("y2")) causality(var.1c, cause = c("y1")) The results are consistent with the DGP Granger causality H0: y2 do not Granger-cause y1 F-Test = 1.372, df1 = 1, df2 = 394, p-value = 0.2422 Granger causality H0: y1 do not Granger-cause y2 F-Test = 69.3042, df1 = 1, df2 = 394, p-value = 1.443e-15