Tutorial on VAR

Embed Size (px)

DESCRIPTION

VAR

Citation preview

  • Coming to Your Field Soon: A Primer on VARs and VECMsA time series methodology originating in macroeconomics [Sims 1980], now popular in finance soon to take over your field too!

    Dave Tufte's Primer on VAR's and VECM's

  • What do the acronyms stand for?VAR: vector autoregressionVector indicates the more than one variable will be predicted Thus, a set of regressions is run (simultaneously)Autoregression indicates that variables will be regressed on their own past values VECM: vector error correction modelSimply a VAR with a specific type of coefficient restriction imposedCointegration indicates whether those restrictions are useful

    Dave Tufte's Primer on VAR's and VECM's

  • Whats the practical benefit of a VAR?How do you capture a relationship that changes through time?Probably not with a linear regressionHowever, a VAR, which amounts to a set of inter-related linear regressions can do this

    Dave Tufte's Primer on VAR's and VECM's

  • Example 1 from MacroeconomicsFisher EffectSuppose the Federal Reserve pursues an expansionary monetary policy essentially they put new money into circulationInterest rates drop in the short-runSince the Fed buys bonds to get the money outInterest rates rise in the long-runBecause the additional money in circulation allows the prices of goods to be bid up

    Dave Tufte's Primer on VAR's and VECM's

  • Example 2 from MacroeconomicsThe J-CurveSuppose a country devalues their currency to improve their trade positionGDP goes down in the short-runSince prices of foreign intermediate products rise immediately, production fallsGDP goes up in the long-runUltimately, domestic producers are able to adjust quantities and export more at a low price

    Dave Tufte's Primer on VAR's and VECM's

  • Whats the benefit to a researcher of using a VAR?A VAR requires less restrictive (easier to justify) assumptions than other multi-variable methodsIt doesnt obviate the identification problem, but it does:Eliminate the linear algebra associated with itCouch the problem in terms that are simpler for the practitioner to apply

    Dave Tufte's Primer on VAR's and VECM's

  • What do you need to choose to set up a VAR?A (small) set of variablesSix is about the upper limitA decision on a lag lengthThe same length for each variableLonger is preferable with this methodA decision about whether you need to include any other deterministic variablesLike trends, dummies, or seasonal terms

    Dave Tufte's Primer on VAR's and VECM's

  • What would the resulting VAR look like?A system of equationsOne for each variable of interestThis VAR consists of two variables, 1 lag (of each variable on the right hand side), and a constantxt = a0 + a1xt-1 + a2yt-1 + erroryt = b0 + b1xt-1 + b2yt-1 + error

    Dave Tufte's Primer on VAR's and VECM's

  • How do you estimate the VAR?(It can be proved that) there are no gains to methods more complex than OLS, provided that each equation has the same set of right hand side variablesSo, you could estimate this in ExcelGenerally, you want to produce ancillariesA specialized time series package like RATS, TSP, or E-Views is worthwhile for this

    Dave Tufte's Primer on VAR's and VECM's

  • What do the estimates of the VAR look like?You dont carePersonally, I rarely if ever even look at them

    Dave Tufte's Primer on VAR's and VECM's

  • How is that justified?When you estimate a parameter in a regression, you estimate two thingsThe parameter itselfThe standard error of the parameterOmitting a relevant variable from the regression biases the parameter and standard error estimatesYou cant easily predict which wayAdding an irrelevant variable from the regression biases the standard error estimate (upward)But.the parameter estimate is fine

    Dave Tufte's Primer on VAR's and VECM's

  • How is that justified (contd)?With a VAR, when in doubt, you add extra lags to the right hand sideThis make sure that you dont omit anythingSo, your parameter estimates are fineHowever, you almost certainly included too muchSo, your standard errors go through the roofAs a result, your t-statistics are likely to indicate that your parameters are insignificant

    Dave Tufte's Primer on VAR's and VECM's

  • If youre not interested in the significance of the parameters, what is the point of estimating a VAR?VARs can be re-expressed as ancillariesImpulse response functions(Forecast error) variance decompositionsHistorical decompositionsThe last one is rarely used

    Dave Tufte's Primer on VAR's and VECM's

  • Why do we need VAR ancillaries?There is a lot more going on in a simple VAR system than meets the eyext = a0 + a1xt-1 + a2yt-1 + erroryt = b0 + b1xt-1 + b2yt-1 + errorSuppose y changes at t-1Then x and y change at tBoth of which will cause x and y to change again at t+1This process could continue forever, so you need a way to sort those effects out and organize them

    Dave Tufte's Primer on VAR's and VECM's

  • The math page 1Write the system more specificallyxt = a0 + a1xt-1 + a2yt-1 + etyt = b0 + b1xt-1 + b2yt-1 + htNote that you can backshift the equationsxt-1 = a0 + a1xt-2 + a2yt-2 + et-1yt-1 = b0 + b1xt-2 + b2yt-2 + ht-1

    Dave Tufte's Primer on VAR's and VECM's

  • The math page 2Now substitute the right hand sides of the backshifted equations for the right hand side variables in the original equations to get:xt = a0 + a1[a0 + a1xt-2 + a2yt-2 + et-1] + a2[b0 + b1xt-2 + b2yt-2 + ht-1] + etyt = b0 + b1[a0 + a1xt-2 + a2yt-2 + et-1] + b2[b0 + b1xt-2 + b2yt-2 + ht-1] + ht

    Dave Tufte's Primer on VAR's and VECM's

  • The math page 3These equations are a mess, but we can gather terms to get:xt = [a0 + a1a0 + a2b0] + [(a1)2 + a2b1]xt-2 + [a1a2 + a2b2]yt-2 + [et + a1et-1 + a2ht-1] yt = [b0 + b1a0 + b2b0] + [(b1a1 + b1b2]xt-2 + [b1a2 + (b2)2]yt-2 + [et + b1et-1 + b2ht-1] This is still a mess, but the essential point is that each variable still depends on lags of both variables, and a more complex set of errors

    Dave Tufte's Primer on VAR's and VECM's

  • The math page 4If we kept backshifting each equation and substituting back in, wed ultimately get equations that looked like this:xt = constant + gxxt-n + gyyt-n + lots of errorsyt = constant + dxxt-n + dyyt-n + lots of errorsNote that the gs and ds, as well as the errors would be big functions of all of the as and bs from the original equations

    Dave Tufte's Primer on VAR's and VECM's

  • How do we sort out whats going on here?One result that you can count on is that most of the as and bs will be less than one in absolute valueOnly unstable processes will have a lot of as and bs that are outside of this rang and we dont usually think of our world as unstableThis is important because:The gs and ds are composed of products of as and bs which go to zero the more we backshiftThe lots of errors are composed of sums of as and bs weighting the errors which dont go to zero

    Dave Tufte's Primer on VAR's and VECM's

  • The significance of the mathIf we backshift enough, each series can be shown to be equal toA constant Which is the mean of the variableA (weighted) sum of past errors These come from all variablesThese are the shocks that buffet the variables

    Dave Tufte's Primer on VAR's and VECM's

  • What do we do with this result?We construct two VAR ancillaries to summarize how and why a variable gets away from its meanImpulse response functionsThese trace out how typical shocks will affect a variable through timeVariance decompositionsShow which shocks are most important in explaining a variable through time

    Dave Tufte's Primer on VAR's and VECM's

  • Whats an impulse response function?Recall the error term obtained for xt on slide 17 (after one backshift and substitution had been made) et + a1et-1 + a2ht-1The impulse response function is the pattern of how a shock affects x it can be read off the coefficientsA shock to x (an e) affects x immediately, and continues to affect x next period (the weight, a1 may amplify or diminish the shock), and stops affecting x after thatA shock to y (an h), does not affect x at all right away, affects it with a weight of a2 the next period, and stops affecting x after that

    Dave Tufte's Primer on VAR's and VECM's

  • Whats a variance decomposition?Once were done backshifting and substituting, whats left is a constant plus errorsAny variance of the variable must come from those errorsBut.the errors have a variance that we already know because it gets estimated when we run the regressionAgain, for x (after one backshift and substitution):Var(x) = E[(et + a1et-1 + a2ht-1)(et + a1et-1 + a2ht-1)]Var(x) = (se)2 + (a1)2(se)2 + (a2)2(sh)2Note that the first term is from t, and the last two are notSo, 100% of the variance of x at t comes from shocks to x (es)However, the variance of x at t+1 comes from 2 sources{(a1)2(se)2/[(a1)2(se)2 + (a2)2(sh)2]} from x{(a2)2(sh)2/[(a1)2(se)2 + (a2)2(sh)2]} from y

    Dave Tufte's Primer on VAR's and VECM's

  • Reporting VAR ancillariesTypically, the software produces a ton of numbers in tabular form when you ask for theseThe numbers are rarely reportedGenerally, authors provide plots of bothAn impulse response function graph shows you whether a shock to one variable has:A positive or negative affect on another variable (or both)An effect the strengthens or diminishes through timeA variance decomposition graph shows you how the sources of variation underlying a variables movements wax and wane through time

    Dave Tufte's Primer on VAR's and VECM's

  • Whats the biggest problem with VAR ancillaries in published research?The ancillaries are non-linear combinations of a large number of underlying parameter estimatesUnfortunately, parameters estimates are point estimatesThey are correct with probability zeroSo, all VAR ancillaries are also point estimatesHow do we get around this?It isnt very hard, and most programs can produce confidence intervals for VAR ancillariesSo . whats the beef?Many articles dont include these confidence intervals because they are very wide indicating a lot of uncertainty in the results

    Dave Tufte's Primer on VAR's and VECM's

  • Whats the catch?At first glance, it seems like applying a VAR is nothing more than applying some (time consuming) arithmetic to plain old OLS regressionsThis isnt the case. All multi-variable estimation problems require the researcher to address something called the identification problemPrior to VARs (and still with other methods) this required solving a sophisticated linear algebra problemThe difficulty of this problem goes up geometrically with the size of the model youre working withVARs still require that the identification issue be addressed, but the question is couched in a form that is easier to tackleThe difficulty of this problem need not go up too quickly

    Dave Tufte's Primer on VAR's and VECM's

  • Whats the identification problem?Consider a basic microeconomic situationWe dont observe demand and supplyWhat we do observe is a quantity sold and a priceThis is just one point on the standard microeconomics graphAt some other time, we may observe a different quantity sold at a different priceThis again is just another point on the graphHow did we get to that new point?Did supply shift?Did demand shift?Did both shift?This is the identification problem

    Dave Tufte's Primer on VAR's and VECM's

  • How do we (conceptually) identify a supply or a demand?This is actually pretty easyIf only one of the curves shifts, the equilibrium will move along the other curve tracing it outIn order to get only one curve to shift, it must be pushed by some variable that only affects that curve, and not the other one. For example:Changes in personal income will cause demand to shift, but are often irrelevant to the firms supply decisionsChanges in input prices will cause supply to shift but are often irrelevant to the households demand decisions

    Dave Tufte's Primer on VAR's and VECM's

  • How do we (mathematically) identify a supply and a demand?Write out an equation for each one. I assume that they each relates prices and quantities, along with two other (shift) variables R and S. For now, it is important to include both of those variables in both equationsD: P = a0 + a1Q + a2R + a3S + demand errorS: P = b0 + b1Q + b2R + b3S + supply errorIdentification amounts to saying that only one of R or S affects demand, and the other one affects supply. This amounts to the following restrictions:a2 = b3 = 0, or alternativelyb2 = a3 = 0Justifying restricting a whole bunch of parameters to zero before you even start running regressions makes this tough

    Dave Tufte's Primer on VAR's and VECM's

  • How does identification differ in VARs? Part 1Suppose you are trying to get information about how 2 variables, Y and Z, behave. First, you would right down a system of 2 structural equations:Yt = c0 + c1Zt + c2Yt-1 + c3Zt-1 + mtZt = d0 + d1Yt + d2Yt-1 + d3Zt-1 + ntThese equations are similar to those on the previous slide I just replaced R and S with past values of Y and ZThese equations are structural in the sense that they contain contemporaneous values of both variables of interest in each equationAlso, because we are claiming that these represent some underlying structure, we assume that the two errors are uncorrelated

    Dave Tufte's Primer on VAR's and VECM's

  • How does identification differ in VARs? Part 2All multi-variable estimations require that the structural equations be estimated by first obtaining and estimating the systems reduced form equationsReduced forms are what is meant in algebra when you solve equations two equations can be solved for two variables, in this case yt and zt, in each case by eliminating the other variable from the right hand side to get:Yt = e0 + e2Yt-1 + e3Zt-1 + a function of both errorsZt = f0 + f2Yt-1 + f3Zt-1 + another function of both errorsThe es and fs will be some messy combination of the underlying cs and ds from the structural equations

    Dave Tufte's Primer on VAR's and VECM's

  • How does identification differ in VARs? Part 3We now have the original structural system:Yt = c0 + c1Zt + c2Yt-1 + c3Zt-1 + mtZt = d0 + d1Yt + d2Yt-1 + d3Zt-1 + nt10 things need to be estimated here: four cs, four ds and the variances of the two errors (recall that their covariance is zero)We also have the equivalent reduced form system:Yt = e0 + e2Yt-1 + e3Zt-1 + a function of both errorsZt = f0 + f2Yt-1 + f3Zt-1 + another function of both errorsWhen we estimate this we get 9 pieces of information about the 10 that we are trying to estimate above (three 3s, three fs, variances of two errors, and one covariance between the - now related - errors)

    Dave Tufte's Primer on VAR's and VECM's

  • How does identification differ in VARs? Part 4An alternative way of thinking about identification is that we can only estimate as many structural parameters as we have pieces of information from the reduced formsThus, we have to eliminate one thing of interest in the structural systemThis may seem somewhat egregious, but recall that in the economic example I gave that we had to restrict two parameters to zero so we are already better off here!

    Dave Tufte's Primer on VAR's and VECM's

  • How does identification differ in VARs? Part 5We can safely eliminate any of the ten parameters in the structural system but we must eliminate some of them to achieve identificationHeres where a VAR makes your life easierRather than constraining a parameter on two of the lags to zero, we constrain one of the parameters on the contemporaneous terms to zeroThe former is tantamount to saying that particular variables from the past do not cause other variables todayThe latter is saying something less egregious that certain variables dont affect other ones right away. This is an easier thing to explain and justify.

    Dave Tufte's Primer on VAR's and VECM's

  • How does VAR identification work in practice?Identifying a VAR amounts to choosing an ordering for your variablesIf you have n dependent variables, they can be rearranged into n! ordersThe researchers job is to pick one of those ordersWhat makes a good order?An argument that one variable (say X) is likely to affect some other variable (say Y) before Y can feed back and affect X

    Dave Tufte's Primer on VAR's and VECM's

  • An example of VAR identificationA common set of variables in a macroeconomic VAR includes output, money, prices, and interest rates (Y, M, P, and r)There are 24 possible orderingsYMPr, YMrP, YPMr, YPrM, rPMY, and so onA plausible ordering would be M, r, Y, PThe Federal Reserve controls M, and isnt likely to respond quickly to the other variablesThe Federal Reserve is trying to influence rBy influencing r, the Federal Reserve hopes to influence Y and PMost first adjust quantities faster than prices, so I put Y before P

    Dave Tufte's Primer on VAR's and VECM's

  • How sensitive are VARs to ordering?This question doesnt have a good answerThere are big differences across the set of possible orderings, but a good researcher knows that most of those orderings arent justifiableA good convention to go by is that if you have trouble figuring out which variable should precede and which should follow, it probably wont make much difference to the VAR ancillaries either

    Dave Tufte's Primer on VAR's and VECM's