1、Dave Tuftes Primer on VARs and VECMs1Coming 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 Tuftes Primer on VARs and VECMs2What do the acronyms stand for?VAR:vector autoregres
2、sion Vector 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 model Simply a VAR with a specific type of coefficient restriction impose
3、d Cointegration indicates whether those restrictions are usefulDave Tuftes Primer on VARs and VECMs3Whats the practical benefit of a VAR?How do you capture a relationship that changes through time?Probably not with a linear regression However,a VAR,which amounts to a set of inter-related linear regr
4、essions can do thisDave Tuftes Primer on VARs and VECMs4Example 1 from Macroeconomics Fisher Effect Suppose the Federal Reserve pursues an expansionary monetary policy essentially they put new money into circulation Interest rates drop in the short-run Since the Fed buys bonds to get the money out I
5、nterest rates rise in the long-run Because the additional money in circulation allows the prices of goods to be bid upDave Tuftes Primer on VARs and VECMs5Example 2 from Macroeconomics The J-Curve Suppose a country devalues their currency to improve their trade position GDP goes down in the short-ru
6、n Since prices of foreign intermediate products rise immediately,production falls GDP goes up in the long-run Ultimately,domestic producers are able to adjust quantities and export more at a low priceDave Tuftes Primer on VARs and VECMs6Whats the benefit to a researcher of using a VAR?A VAR requires
7、 less restrictive(easier to justify)assumptions than other multi-variable methods It doesnt obviate the identification problem,but it does:Eliminate the linear algebra associated with it Couch the problem in terms that are simpler for the practitioner to applyDave Tuftes Primer on VARs and VECMs7Wha
8、t do you need to choose to set up a VAR?A(small)set of variables Six is about the upper limit A decision on a lag length The same length for each variable Longer is preferable with this method A decision about whether you need to include any other deterministic variables Like trends,dummies,or seaso
9、nal termsDave Tuftes Primer on VARs and VECMs8What would the resulting VAR look like?A system of equations One for each variable of interest This VAR consists of two variables,1 lag(of each variable on the right hand side),and a constant xt=a0+a1xt-1+a2yt-1+error yt=b0+b1xt-1+b2yt-1+errorDave Tuftes
10、 Primer on VARs and VECMs9How 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 variables So,you could estimate this in Excel Generally,you want to produce ancillaries A specialized time
11、series package like RATS,TSP,or E-Views is worthwhile for thisDave Tuftes Primer on VARs and VECMs10What do the estimates of the VAR look like?You dont care Personally,I rarely if ever even look at themDave Tuftes Primer on VARs and VECMs11How is that justified?When you estimate a parameter in a reg
12、ression,you estimate two things The parameter itself The standard error of the parameter Omitting a relevant variable from the regression biases the parameter and standard error estimates You cant easily predict which way Adding an irrelevant variable from the regression biases the standard error es
13、timate(upward)But.the parameter estimate is fineDave Tuftes Primer on VARs and VECMs12How is that justified(contd)?With a VAR,when in doubt,you add extra lags to the right hand side This make sure that you dont omit anything So,your parameter estimates are fine However,you almost certainly included
14、too much So,your standard errors go through the roof As a result,your t-statistics are likely to indicate that your parameters are insignificantDave Tuftes Primer on VARs and VECMs13If youre not interested in the significance of the parameters,what is the point of estimating a VAR?VARs can be re-exp
15、ressed as ancillaries Impulse response functions(Forecast error)variance decompositions Historical decompositions The last one is rarely usedDave Tuftes Primer on VARs and VECMs14Why do we need VAR ancillaries?There is a lot more going on in a simple VAR system than meets the eye xt=a0+a1xt-1+a2yt-1
16、+error yt=b0+b1xt-1+b2yt-1+error Suppose y changes at t-1 Then x and y change at t Both of which will cause x and y to change again at t+1 This process could continue forever,so you need a way to sort those effects out and organize themDave Tuftes Primer on VARs and VECMs15The math page 1 Write the
17、system more specifically xt=a0+a1xt-1+a2yt-1+et yt=b0+b1xt-1+b2yt-1+ht Note that you can“backshift”the equations xt-1=a0+a1xt-2+a2yt-2+et-1 yt-1=b0+b1xt-2+b2yt-2+ht-1Dave Tuftes Primer on VARs and VECMs16The math page 2 Now substitute the right hand sides of the backshifted equations for the right h
18、and side variables in the original equations to get:xt=a0+a1a0+a1xt-2+a2yt-2+et-1+a2b0+b1xt-2+b2yt-2+ht-1+et yt=b0+b1a0+a1xt-2+a2yt-2+et-1+b2b0+b1xt-2+b2yt-2+ht-1+htDave Tuftes Primer on VARs and VECMs17The math page 3 These equations are a mess,but we can gather terms to get:xt=a0+a1a0+a2b0+(a1)2+a
19、2b1xt-2+a1a2+a2b2yt-2+et+a1et-1+a2ht-1 yt=b0+b1a0+b2b0+(b1a1+b1b2xt-2+b1a2+(b2)2yt-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 errorsDave Tuftes Primer on VARs and VECMs18The math page 4 If we
20、 kept backshifting each equation and substituting back in,wed ultimately get equations that looked like this:xt=constant+gxxt-n+gyyt-n+lots of errors yt=constant+dxxt-n+dyyt-n+lots of errors Note that the gs and ds,as well as the errors would be big functions of all of the as and bs from the origina
21、l equationsDave Tuftes Primer on VARs and VECMs19How 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 value Only unstable processes will have a lot of as and bs that are outside of this rang and we dont usually think
22、of our world as unstable This is important because:The gs and ds are composed of products of as and bs which go to zero the more we backshift The“lots of errors”are composed of sums of as and bs weighting the errors which dont go to zeroDave Tuftes Primer on VARs and VECMs20The significance of the m
23、ath If we backshift enough,each series can be shown to be equal to A constant Which is the mean of the variable A(weighted)sum of past errors These come from all variables These are the shocks that buffet the variablesDave Tuftes Primer on VARs and VECMs21What do we do with this result?We construct
24、two VAR ancillaries to summarize how and why a variable gets away from its mean Impulse response functions These trace out how typical shocks will affect a variable through time Variance decompositions Show which shocks are most important in explaining a variable through timeDave Tuftes Primer on VA
25、Rs and VECMs22Whats 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-1 The impulse response function is the pattern of how a shock affects x it can be read off the coefficients A shock to x(an e)affects x
26、 immediately,and continues to affect x next period(the weight,a1 may amplify or diminish the shock),and stops affecting x after that A 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 thatDave Tuftes Primer on VARs and VE
27、CMs23Whats a variance decomposition?Once were done backshifting and substituting,whats left is a constant plus errors Any variance of the variable must come from those errors But.the errors have a variance that we already know because it gets estimated when we run the regression Again,for x(after on
28、e 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)2 Note that the first term is from t,and the last two are not So,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
29、)2+(a2)2(sh)2 from x(a2)2(sh)2/(a1)2(se)2+(a2)2(sh)2 from yDave Tuftes Primer on VARs and VECMs24Reporting VAR ancillaries Typically,the software produces a ton of numbers in tabular form when you ask for these The numbers are rarely reported Generally,authors provide plots of both An impulse respon
30、se 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 time A variance decomposition graph shows you how the sources of variation underlying a variables movements wax and wane through t
31、imeDave Tuftes Primer on VARs and VECMs25Whats the biggest problem with VAR ancillaries in published research?The ancillaries are non-linear combinations of a large number of underlying parameter estimates Unfortunately,parameters estimates are point estimates They are correct with probability zero
32、So,all VAR ancillaries are also point estimates How do we get around this?It isnt very hard,and most programs can produce confidence intervals for VAR ancillaries So.whats the beef?Many articles dont include these confidence intervals because they are very wide indicating a lot of uncertainty in the
33、 resultsDave Tuftes Primer on VARs and VECMs26Whats the catch?At first glance,it seems like applying a VAR is nothing more than applying some(time consuming)arithmetic to plain old OLS regressions This isnt the case.All multi-variable estimation problems require the researcher to address something c
34、alled the identification problem Prior to VARs(and still with other methods)this required solving a sophisticated linear algebra problem The difficulty of this problem goes up geometrically with the size of the model youre working with VARs still require that the identification issue be addressed,bu
35、t the question is couched in a form that is easier to tackle The difficulty of this problem need not go up too quicklyDave Tuftes Primer on VARs and VECMs27Whats the identification problem?Consider a basic microeconomic situation We dont observe demand and supply What we do observe is a quantity sol
36、d and a price This is just one point on the standard microeconomics graph At some other time,we may observe a different quantity sold at a different price This again is just another point on the graph How did we get to that new point?Did supply shift?Did demand shift?Did both shift?This is the ident
37、ification problemDave Tuftes Primer on VARs and VECMs28How do we(conceptually)identify a supply or a demand?This is actually pretty easy If only one of the curves shifts,the equilibrium will move along the other curve tracing it out In order to get only one curve to shift,it must be pushed by some v
38、ariable 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 decisions Changes in input prices will cause supply to shift but are often irrelevant to the households demand decisionsDave Tufte
39、s Primer on VARs and VECMs29How 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 equations D:P=a
40、0+a1Q+a2R+a3S+demand error S:P=b0+b1Q+b2R+b3S+supply error Identification 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 alternatively b2=a3=0 Justifying restricting a whole bunch of parameters to zero b
41、efore you even start running regressions makes this toughDave Tuftes Primer on VARs and VECMs30How does identification differ in VARs?Part 1 Suppose 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+
42、c3Zt-1+mt Zt=d0+d1Yt+d2Yt-1+d3Zt-1+nt These equations are similar to those on the previous slide I just replaced R and S with past values of Y and Z These equations are structural in the sense that they contain contemporaneous values of both variables of interest in each equation Also,because we are
43、 claiming that these represent some underlying structure,we assume that the two errors are uncorrelatedDave Tuftes Primer on VARs and VECMs31How does identification differ in VARs?Part 2 All multi-variable estimations require that the structural equations be estimated by first obtaining and estimati
44、ng the systems reduced form equations Reduced 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 errors
45、Zt=f0+f2Yt-1+f3Zt-1+another function of both errors The es and fs will be some messy combination of the underlying cs and ds from the structural equationsDave Tuftes Primer on VARs and VECMs32How does identification differ in VARs?Part 3 We now have the original structural system:Yt=c0+c1Zt+c2Yt-1+c
46、3Zt-1+mt Zt=d0+d1Yt+d2Yt-1+d3Zt-1+nt 10 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 errors Zt=f0+f2Yt-1+f3Zt-1+another function of both
47、 errors When 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 Tuftes Primer on VARs and VECMs33How does identification differ in VARs?Part 4 An alternativ
48、e way of thinking about identification is that we can only estimate as many structural parameters as we have pieces of information from the reduced forms Thus,we have to eliminate one thing of interest in the structural system This may seem somewhat egregious,but recall that in the economic example
49、I gave that we had to restrict two parameters to zero so we are already better off here!Dave Tuftes Primer on VARs and VECMs34How does identification differ in VARs?Part 5 We can safely eliminate any of the ten parameters in the structural system but we must eliminate some of them to achieve identif
50、ication Heres where a VAR makes your life easier Rather than constraining a parameter on two of the lags to zero,we constrain one of the parameters on the contemporaneous terms to zero The former is tantamount to saying that particular variables from the past do not cause other variables today The l