You are on page 1of 24

Vector Autoregression

Jamie Monogan
Washington University in St. Louis

November 15 & 17, 2010

Jamie Monogan (WUStL)

Vector Autoregression

November 15 & 17, 2010

1 / 24

Objectives

By the end of these meetings, participants should be able to: Explain the relationship between VAR and Granger causality. Weigh the advantages and disadvantages of the VAR approach. Specify and estimate a VAR model with OLS. Interpret a VAR model in terms of causal tests and impulse response analysis.

Jamie Monogan (WUStL)

Vector Autoregression

November 15 & 17, 2010

2 / 24

Granger and VAR

The direct Granger test is a bivariate case of vector autoregression. That is, it considers a vector (length 2) of all possible endogenous variables in a system of 2 variables and it controls expected autoregression in y (and x) by introducing lags of the dependent variables on the right hand side. The VAR setup is an extension of the idea to a system of k variables. We still consider each of the k variables from the system as a function of their own lags and lags of the other k-1 variables. We still do causal testing with F -ratios.

Jamie Monogan (WUStL)

Vector Autoregression

November 15 & 17, 2010

3 / 24

The Attitude of VAR Modeling


Equally good theory published side by side in the best journals is strikingly contradictory. But all developed and tested according to accepted econometric practice. Maybe we have to step back from the presumption that it is possible to specify the interrelationships of a group of variables and say, instead: What really matters, the question above all other questions, is causal ordering. We have no condence in the evidence we bring to bear on this issue because it is so deeply embedded in assumptions about multivariate relationships that the data are not allowed to speak. Let us instead assume that we really know nothing about the structure of a set of variableswhich may even be unknowableand proceed modestly to a means to let the data tell us.
Jamie Monogan (WUStL) Vector Autoregression November 15 & 17, 2010 4 / 24

The Controversy over VAR Modeling

VAR: Structural models, while desirable, are impossible for complex systems. Reduced form models telling us about causal ordering is the most that we can hope for. In fact, in a world of endogenous relationships, structural models may be horribly misspecied. Anti-VAR: Structurewhich is to say, theoryis all that matters, and VAR cannot produce structural estimates.

Jamie Monogan (WUStL)

Vector Autoregression

November 15 & 17, 2010

5 / 24

Problems of VAR Analysis

VAR models require the estimation of very large numbers of parameters (because they impose no theoretical restrictions). They are therefore radically inecient. Like the Granger case, VAR coecients should never be interpreted. (We estimate with OLS, so this is well known.) But it is useful as a theoryfree way to let the data speak to order of causality questions, as well as subsidiary questions like required lag length.

Jamie Monogan (WUStL)

Vector Autoregression

November 15 & 17, 2010

6 / 24

The VAR Model

yt = c +
s=1

Bs yts + ut

In eect, written entirely in terms of y because everything in the system is presumed to be jointly endogenous. This is a system of equations, where there are as many equations as variables, k. yt is understood to be a vector (hence, the name vector autoregression), the value of each of the variables at time t. Bs is a matrix of regression parameters, k by k. (Note, this notion diers from how B has been used in this course.)

Jamie Monogan (WUStL)

Vector Autoregression

November 15 & 17, 2010

7 / 24

Vector Notation
Note: Brandt & Williams use row-vector notation; Enders and I use column-vector notation. Consider the case of a three-variable system. We therefore wish to estimate the (s) 11 L c1 y1t (s) y2t = c2 + 21 (s) s=1 c3 y3t 31 following model: (s) (s) 12 13 u1t y1ts (s) (s) 22 23 y2ts + u2t (s) (s) u3t y3ts
32 33

Notice that the ut vector does not allow specify disturbance covariances, so we can estimate this system with OLS equations. Break to board: the case when L = 2

Jamie Monogan (WUStL)

Vector Autoregression

November 15 & 17, 2010

8 / 24

Determining Lag Length


E (ut ut ) = To test restrictions such as lag specication: Consider a model, UR, with s lags and a restricted model, a proper subset, with s-1. Then: = (T c)(log |R | log | |) UR is a likelihood ratio test, distributed as 2 where log|R | is the log of the determinant of the error covariance of the restricted model and c = ks + 1 is a degrees of freedom correction, based on the number of variables times the number of lags in the unrestricted model. You also may want to evaluate your specication my plotting predicted values against the true series.
Jamie Monogan (WUStL) Vector Autoregression November 15 & 17, 2010 9 / 24

The Moving Average Representation


Instead of a Vector Autoregression (VAR) representation of our model, how about a Vector Moving Average (VMA) representation? Recall: A low order AR process MA() We use a low-order AR specication (remember, column notation): yt yt = c + B1 yt1 + B2 yt2 + et = c + (B1 L + B2 L2 )yt + et

Hence, we can redene our VAR model in terms of an MA(): yt = d + (I + C1 L + C2 L2 + . . .)et where (I + C1 L + C2 L2 + . . .) = (I B1 L B2 L2 . . . Bp )1 .

Jamie Monogan (WUStL)

Vector Autoregression

November 15 & 17, 2010

10 / 24

Interpretation from the VMA model


The individual moving average coecients are dened as: C1 = B1 C2 = B1 C1 + B2 C3 = B1 C2 + B2 C1 + B3 . . . C = B1 C
1

+ B2 C

+ + Bp C

Now we can estimate an empirical impulse response function from each of the innovations series to each of the variables in the system. If we then shock the innovations, a process called innovation accounting, we can then observe the multivariate causal ow. Break to board.
Jamie Monogan (WUStL) Vector Autoregression November 15 & 17, 2010 11 / 24

Impulse Response Analysis

With impulse rseponse analysis we ask: For a one unit pulse shock to variable A, what are the expected dynamic consequences in the system? The right hand side of a VMA model consists of disturbances of various terms multiplied by coecients. Each MA coecient gives us the expected impact on the LHS variable for a shock at a particular lag of a particular variable. Simply plotting the coecients will graphically display what we expect to happen over time. Break to board to illustrate.

Jamie Monogan (WUStL)

Vector Autoregression

November 15 & 17, 2010

12 / 24

Causal Testing

The clearest technique is to do F -tests on separate equations. (I would advise this.) Language: null hypothesis of exogeneity or noncausality. The vars package in R does a multi-equation F -test that asks if all coecients for one variable are zero in the equations for all other variables. (Comparable to an F -test of coecient equality in a seemingly unrelated regression.) The advantage to the multi-equation F is it evaluates whether a variable has any consequence in the whole system. The disadvantage is it does not speak to which other variables it causes.

Jamie Monogan (WUStL)

Vector Autoregression

November 15 & 17, 2010

13 / 24

Testing for Serial Correlation


Visual Inspections
Residuals plots ACF / PACF Both produced by default in R

Portmanteau tests (multivariate)


Breusch-Godfrey Box-Ljung
h

Qh = T
j=1

tr (j 1 j 1 ) 0 0

where Q 2 (k 2 (h p)) where k is the number of endogenous variables, h the the number of lags for which autocorrelation is considered, and p is the order of the VAR model (i.e., number of lags of each variable on the right-hand side). j is the covariance matrix of residuals at time t with those at time t j. We also might do a small-sample correction.
Jamie Monogan (WUStL) Vector Autoregression November 15 & 17, 2010 14 / 24

More on Lag Length

For a VAR(p) model with T observations, k variables, and || the determinant of the error covariance matrix: AIC (p) = T log || + 2(k 2 p + k) BIC (p) = T log || + log(T )(k 2 p + k) HQ(p) = T log || + 2 log(log (T ))(k 2 p + k) These t indices can be calculated for any model with a log-likelihood function. They allow for a probabilistic view of model selection.

Jamie Monogan (WUStL)

Vector Autoregression

November 15 & 17, 2010

15 / 24

Software
Stata var varlist, lags(#) exogenous(list2) R vars library var.model < VAR(dataSet, p=#, type=const, exogen=vectorName) plot(var.model) causality(var.model, cause=variable.name) var.model.irf < irf(var.model, impulse = variable.name, response = c(var1, var2, var3)) plot(var.model.irf)
Jamie Monogan (WUStL) Vector Autoregression November 15 & 17, 2010 16 / 24

Basic Introduction to Bayesian Methods


Likelihood-based inference assumes that population parameters are xed, and the data are randomly observed given the parameters.
From the data, we estimate which parameters are most likely to have produced the data we have observed.

Bayesian inference assumes that the data are xed, and the population parameters are random.
Consider: much of classical inference relies on repeated-sample theory. Could you repeat a sample of what you are studying? If you are Gregor Mendel, then yes you can nd more pea pods. If you are studying the time series of Bushs approval rating, then no.

So if the parameters are random, what is their distribution? For the parameters and D the data, Bayes law tells us: p(|D) = p()p(D|) p(D)
November 15 & 17, 2010 17 / 24

Jamie Monogan (WUStL)

Vector Autoregression

Priors, Likelihoods, & Posteriors


Using this rule, we can dene our posterior distribution with the prior distribution and likelihood function: (|D) = p()L(|D) p()L(|D) p()L(|D)d

A few approaches to priors (non-exhaustive list):


Flat Conjugate Elicited

(|D) may be complex and hard to marginalize (w.r.t. each parameter). Hence, we turn to MCMC to numerically give us the distribution of our posterior. Short-term memory: useful because it will wander around values with the highest density.
Jamie Monogan (WUStL) Vector Autoregression November 15 & 17, 2010 18 / 24

Bayesian Vector Autoregression: Advantages

Imposes structure through priors: coecients diminishing to zero. Greater ability to account for unit roots. Easier and more accurate assessment of uncertainty. Fairer assumptions about data. The Sims-Zha Model q(A) L(Y |A)(a0 )(a+ , )

Jamie Monogan (WUStL)

Vector Autoregression

November 15 & 17, 2010

19 / 24

Sims-Zha Priors
How do we dene ? Diagonal elements dene variance of VAR parameters: ,j,i = 0 1 j 3
2

Since represents lag length, a larger lag implies a smaller variance. (Parameters are converging to zero.) 0 speaks to overall parameter variance, 1 speaks to the standard deviation one lag out, and 3 speaks to the rate of decay. Additional hyperparameters:
2 = 1, were it any dierent, then a variables own lags would carry dierent relative weight. The variance of the constant is dened as (0 4 )2 . The variance of exogenous variables is dened as (0 5 )2 . 5 & 6 not addressed in reading: techniques for allowing cointegration.
Jamie Monogan (WUStL) Vector Autoregression November 15 & 17, 2010 20 / 24

Uncertainty in Impluse Response Analysis

Typical form for a condence band: cij (t) ij (t) We can easily get an estimate of cij (t) in a frequentist perspective. is less straightforward. With Bayesian methods, we can sample from the posteriors of our estimates.
Gaussian approximation: cij (t) z ij (t) ( from posterior of c) Pointwise quantiles: [cij./2 (t), cij.(1)/2 (t)] Likelihood-based eigenvector: cij + k,low , cij + k,high (accounts for serial correlation)

Jamie Monogan (WUStL)

Vector Autoregression

November 15 & 17, 2010

21 / 24

For November 17

Read: Brandt & Williams chapter 3; Freeman, Lin & Williams. 1989. Vector Autoregression and the Study of Politics. American Journal of Political Science 33:842-877. Suppose you estimated the following VAR model (the constants are zero): y1t y2t = .5 .6 .7 .8 y1t1 y2t1 + .1 .2 .3 .4 y1t2 y2t2 + e1t e2t

Write down the VMA model through at least two lags.

Jamie Monogan (WUStL)

Vector Autoregression

November 15 & 17, 2010

22 / 24

For November 22

Read: Enders 4.1-4.7 Using the le QUARTERLY.csv, estimate a VAR and conduct a Granger causality test as well as an impulse response analysis for one variable.

Jamie Monogan (WUStL)

Vector Autoregression

November 15 & 17, 2010

23 / 24

For More on Bayesian VAR

Read: Brandt & Freeman. 2006. Advances in Bayesian Time Series Modeling and the Study of Politics. Political Analysis 14(1):1-36. Estimate a Bayesian VAR with QUARTERLY.csv and plot the impulse response functions. See the example on the website for code to properly load-in the data le.

Jamie Monogan (WUStL)

Vector Autoregression

November 15 & 17, 2010

24 / 24