Identifying Causal Effects in Time Series Models Aaron Smith UC Davis October 20, 2015 Slides available at http://asmith.ucdavis.edu 1
Identifying Causal Effects in Time Series Models If all the Metrics I Understand is in Mostly Harmless Econometrics, How Should I Think About Time Series Analysis? Aaron Smith UC Davis October 20, 2015 Slides available at http://asmith.ucdavis.edu 2
3 Outline 1. Potential Outcomes and Ideal Experiments Internal validity vs external validity Single discrete events Multiple discrete events 2. Potential events every time period Everything is autocorrelated and everything is endogenous The impulse response as an average treatment effect Identification 3. Conclusion
4 Effect of a Carbon Tax on the Demand for Gasoline? y t = α + βp t + ε Two requirements of a good estimate 1. Internal validity Is β the predicted change in y t if price had not changed the way it did in this sample? Need exogenous or random variation in p t 2. External validity Is β the predicted change in y t if we invoke a carbon tax? Did we estimate β based on temporary or persistent price changes? Does β represent the short-run or long-run response to a persistent price?
Effect of a Carbon Tax on the Demand for Gasoline? y t = α + βp t + ε Two requirements of a good estimate 1. Internal validity Is β the predicted change in y t if price had not changed the way it did in this sample? Need exogenous or random variation in p t 2. External validity Is β the predicted change in y t if we invoke a carbon tax? Did we estimate β based on temporary or persistent price changes? Does β represent the short-run or long-run response to a persistent price? 5
6 Case 1: Single Discrete Event y t (0) if D t = 0 (untreated) y t (D t ) = y t (1) if D t = 1 (treated) D t is the treatment variable Observation t has two potential outcomes depending on whether the treatment is on or off. Average treatment effect is ATE = E [y t (1) y t (0)]
7 StarLink Example Case 1: Single Discrete Event 4.15 Cash Prices: log(corn)-log(sorghum) 4.1 4.05 4 3.95 3.9 3.85 3.8 3.75 3.7 Jan-99 Apr-99 Jul-99 Oct-99 Jan-00 Apr-00 Jul-00 Oct-00 Jan-01 Apr-01 Jul-01 Oct-01 StarLink is a variety of GMO corn that was not approved for human consumption or for export to some markets. It was found in the food supply in 2000. Carter and Smith (2007) estimate a 6.8% drop in corn price.
8 Estimating the ATE Case 1: Single Discrete Event Simplest Approach: Use pre-treatment data to estimate the expected value in the absence of treatment ÂTE = 1 τ τ y t 1 T T τ y t t=1 t=τ+1 What if other explanatory variables differ before and after τ? y t = D t β + X tγ + ε t D t {0, 1} is treatment dummy X t contains conditioning variables Need E[D t ε t X t ] = 0 (White, 2006) (c.f. selection on observables) Parallels to event study and regression discontinuity literatures
Common Specification: Lagged y t as a Control Case 1: Single Discrete Event 4.15 Cash Prices: log(corn)-log(sorghum) 4.1 4.05 4 3.95 3.9 3.85 3.8 0.13 3.75 3.7 Jan-99 Apr-99 Jul-99 Oct-99 Jan-00 Apr-00 Jul-00 Oct-00 Jan-01 Apr-01 Jul-01 Oct-01 y t = 0.63 0.02D t + 0.84y t 1 + ε t Why is β coefficient 0.02 and not 0.13? 9
10 Common Specification: Lagged y t as a Control Case 1: Single Discrete Event 4.15 Cash Prices: log(corn)-log(sorghum) 4.1 4.05 4 3.95 3.9 3.85 3.8 0.13 3.75 3.7 Jan-99 Apr-99 Jul-99 Oct-99 Jan-00 Apr-00 Jul-00 Oct-00 Jan-01 Apr-01 Jul-01 Oct-01 y t = 0.63 0.02D t + 0.84y t 1 + ε t Why is β coefficient 0.02 and not 0.13? single-period effect is 0.02 mean effect is 0.02/(1 0.84) = 0.13
11 Case 2: Multiple Discrete Events y t (D t ) = y t (0) if D t = 0 (untreated) y t (d 1 ) if D t = d 1 (treated with dose d 1 ). y t (d J ) if D t = d J (treated with dose d J ) Observation t has J potential outcomes depending on dose Average treatment effect for dose j is ATE j = E [ y t (d j ) y t (0) ] Overall average treatment effect is [ ] ATEj ATE = E dj d j Angrist, Jorda, and Kuersteiner (2013) estimate average effects of discrete changes in Federal Funds Rate
12 Case 3: A Potential Event Every Period Example: estimating an elasticity of demand Potential outcomes in period t are y t ( p) if p t = p (untreated) y t (p t ) = y t ( p + v t ) if p t = p + v t (treated) Think of v t as this year s yield shock Average treatment effect in period t is [ ] yt ( p + v t ) y t ( p) ATE t = E v t v t We can t estimate this because we have only one observation t
13 Average Treatment Effect Over Time Case 3: A Potential Event Every Period [ ]] yt ( p t + v t ) y t ( p t ) ATE = E v [E v t v t Demand example y t = α + βp t + ε t Suppose p t = p + v t. Then [ ] (α + β( p + vt )) (α + β p) ATE = E v = β v t BUT not all price moves are supply shocks
14 Endogeneity Case 3: A Potential Event Every Period Demand example y t = α + βp t + ε t p t = p + v t + γε t Could use an instrumental variable z t with the properties E[z t ε t ] = 0 and E[z t v t ] = 0 BUT instrument typically has persistent effect on v t {zt, z t 1, z t 2,...} all affect v t e.g., poor growing-season weather this year may affect prices for a few years AND instrument may be autocorrelated We aren t getting a new, clean experiment every period
15 Everything is Autocorrelated Case 3: A Potential Event Every Period Even if we have a good instrument, we don t have an independent experiment every period This raises questions Are we estimating the demand response to short-lived or long-lived price changes? Are we estimating the single-period or long-run demand response to price shocks? How much of the variation in our data does the instrument explain? The Mostly Harmless answer: I don t care. I will correct my standard errors A time series analyst s answer: I will try to answer these questions
16 The Impulse Response as an Average Treatment Effect Case 3: A Potential Event Every Period Estimate the average treatment effect of a forecast error Estimate this object at different horizons Demand example (q t is log quantity, p t is log price, z t is supply shifter (instrument)) [ ]] zt+k ( z t + v zt ) z ATE(z t z t+k ) = E v [E t+k ( z t ) v zt v zt [ ]] pt+k ( z t + v zt ) p ATE(z t p t+k ) = E v [E t+k ( z t ) v zt v zt [ ]] yt+k ( z t + v zt ) y ATE(z t y t+k ) = E v [E t+k ( z t ) v zt v zt
Linear Vector Autoregression (VAR) Models X t = Φ 1 X t 1 + Φ 2 X t 2 +... + Φ p X t p + c 0 + c 1 t + ε t ε t WN(0, Ω) Multivariate system X t may include time series on production, consumption, inventory, demand and supply shifters, and futures WN white noise no autocorrelation Everything may be endogenous How to identify causal effects? 1. Estimate the average treatment effect of forecast errors requires assumptions on meaning of contemporaeous correlations, i.e., off-diagonal elements of Ω If E[ε 1t ε 2t ] = 0, did ε 1t cause ε 2t or the other way around? 2. Granger causality, which is another word for predictability requires assumption that effects occur after causes 17
18 VAR Identification Strip the problem down to it s most basic form X t = ε t, ε t WN(0, Ω) Define structural errors ν t = Aε t, and write AX t = ν t Example: commodity supply and demand with temperature demand equation supply equation temperature equation 1 α 12 α 13 α 21 1 α 23 α 31 α 32 1 p t q t w t σ E[ν t ν t] 1 2 0 0 = 0 σ2 2 0 0 0 σ3 2 Identification problem: which variable causes which? With 3 variables, the data give us 3 covariances, so we can identify 3 parameters = ν t
19 VAR Identification: Triangular system AX t = ν t, ν t WN(0, Σ) Impose zeros in lower triangle of A Direction of causation: temperature quantity price demand equation supply equation temperature equation E[ν t ν t] = 1 α 12 α 13 0 1 α 23 0 0 1 σ 2 1 0 0 0 σ 2 2 0 0 0 σ 2 3 p t q t w t = ν 1t ν 2t ν 3t Identification assumption: Short-run supply perfectly inelastic
20 VAR Identification: Triangular system AX t = ν t, ν t WN(0, Σ) demand equation supply equation temperature equation 1 α 12 α 13 0 1 α 23 0 0 1 p t q t w t = ν 1t ν 2t ν 3t [ ]] w + v3t w ATE(w t w t ) = E v [E v 3t v 3t = 1 [ ]] qt ( w + v ATE(w t q t ) = 3t ) q t ( w) E v [E v 3t v 3t = α 23 [ ]] pt ( w + v ATE(w t p t ) = 3t ) p t ( w) E v [E v 3t = α 13 Add lags back in to get ATE(w t p t+k ) etc for k > 0. v 3t
21 VAR Identification: Known Supply Elasticity AX t = ν t, ν t WN(0, Σ) Impose a known value in A Could also get partial identification by specifying a range for α 21 demand equation supply equation temperature equation E[ν t ν t] = 1 α 12 α 13 0.1 1 α 23 0 0 1 σ 2 1 0 0 0 σ 2 2 0 0 0 σ 2 3 p t q t w t = ν t Identification assumption: Short-run supply elasticity equals 0.1
22 VAR Identification: Instrumental Variables AX t = ν t, ν t WN(0, Σ) Assume that weather does not shift demand Standard regression IV would allow ν 1t to contain some supply shocks, i.e., σ 2 12 = 0 demand equation supply equation temperature equation E[ν t ν t] = 1 a 12 0 a 21 1 a 23 0 0 1 σ 2 1 σ 2 12 0 σ 2 12 σ 2 2 0 0 0 σ 2 3 p t q t w t = ν t System is not identified, even though a 12 is identified
Or identify system by adding an independent demand shifter 23 VAR Identification: Instrumental Variables AX t = ν t, ν t WN(0, Σ) Assume that weather does not shift demand Get system identification if assume either 1. σ 2 12 = 0 all supply shocks come from w t, or 2. a 21 = 0 supply is perfectly inelastic demand equation supply equation temperature equation E[ν t ν t] = 1 a 12 0 a 21 1 a 23 0 0 1 σ 2 1 σ 2 12 0 σ 2 12 σ 2 2 0 0 0 σ 2 3 p t q t w t = ν t
A Common Difference Between IV and VAR IV: Focus on a 12 demand equation supply equation temperature equation E[ν t ν t] = VAR: Focus on α 13 and α 23 demand equation supply equation temperature equation E[ν t ν t] = 1 a 12 0 0 1 a 23 0 0 1 σ 2 1 σ 2 12 0 σ 2 12 σ 2 2 0 0 0 σ 2 3 1 α 12 α 13 0 1 α 23 0 0 1 σ 2 1 0 0 0 σ 2 2 0 0 0 σ 2 3 p t q t w t p t q t w t = ν t = ν t But, it turns out that a 12 = α 13 /α 23 24
25 I still don t get it IV: Focus on a 12 demand 1 a 12 0 supply 0 1 a 23 temp 0 0 1 p t q t w t = ν t, E[ν t ν t] = σ 2 1 σ 2 12 0 σ 2 12 σ 2 2 0 0 0 σ 2 3 VAR: Focus on α 13 and α 23 demand 1 α 12 α 13 p t supply 0 1 α 23 q t temp 0 0 1 w t = ν t, E[ν t ν t] = σ 2 1 0 0 0 σ 2 2 0 0 0 σ 2 3 Let s look at some pictures...
26 A Weather Shock v 3t Temp. Price Supply v 2t Quant. v 1t Price Demand Quantity
27 A Weather Shock Changes Observed Temperature v 3t 3 Temp. Price Supply v 2t Quant. v 1t Price Demand Quantity
A Weather Shock Changes Observed Temperature v 3t 3 Temp. Price Supply 23 v 2t Quant. 13 13 v 1t Price Demand 23 Quantity VAR: Temperature shock increases quantity by α 23 and decreases price by α 13. demand supply temp 1 α 12 α 13 0 1 α 23 0 0 1 p t q t w t = ν t, E[ν t ν t] = σ1 2 0 0 0 σ2 2 0 0 0 σ3 2 28
A Weather Shock Changes Observed Temperature v 3t 3 Temp. Price Supply a 23 v 2t Quant. a 12 a 12 a 13 v 1t Price Demand a 23 Quantity IV: Temperature shock identifies demand slope of a 12. demand supply temp 1 a 12 0 0 1 a 23 0 0 1 p t q t w t = ν t, E[ν t ν t] = σ1 2 σ12 2 0 σ12 2 σ2 2 0 0 0 σ3 2 29
30 A Weather Shock and a Quantity Shock v 3t Temp. Price Supply v 2t Quant. v 1t Price Demand Quantity
31 A Weather Shock and a Quantity Shock v 3t 3 Temp. Price Supply 2 23 v 2t Quant. v 1t Price Demand 23 Quantity
A Weather Shock and a Quantity Shock v 3t 3 Temp. Price Supply 2 23 v 2t Quant. 13 12 13 12 Demand v 1t Price 23 Quantity VAR: Other shocks to quantity (i.e., those uncorrelated with temperature) decrease price by α 12. demand supply temp 1 α 12 α 13 0 1 α 23 0 0 1 p t q t w t = ν t, E[ν t ν t] = σ1 2 0 0 0 σ2 2 0 0 0 σ3 2 32
All Three Shocks v 3t 3 Temp. Price Supply 2 23 v 2t Quant. 13 13 12 1 v 1t 1 12 Price Demand 23 Quantity VAR: Each time period, we decompose observed price change into component coming from each of three sources. demand supply temp 1 α 12 α 13 0 1 α 23 0 0 1 p t q t w t = ν t, E[ν t ν t] = σ1 2 0 0 0 σ2 2 0 0 0 σ3 2 33
All Three Shocks v 3t 3 Temp. Price Supply a 23 v 2t Quant. a 12 a 13 a 12 Demand v 1t Price a 23 Quantity IV: Temperature shock identifies demand slope of a 12. demand supply temp 1 a 12 0 0 1 a 23 0 0 1 p t q t w t = ν t, E[ν t ν t] = σ1 2 σ12 2 0 σ12 2 σ2 2 0 0 0 σ3 2 34
changes in the real price of oil into mutually orthogonal components with a structural economic Example: interpretation. Effect This decomposition of Aggregate has immediate implications for how macroeconomists Demand on Oil Prices and policymakers should think about oil price fluctuations. Kilian (AER 2009 and JAAE 2012) A. The Structural VAR Model Consider a VAR model based on monthly data for zt = (Aprodt,reat,rpot)', where Aprodt is the percent change in global crude oil production, reat denotes the index of real economic activ ity constructed in Section I, and rpot defers to the real price of oil. The reat and rpot series are expressed in logs. The sample period is 1973:1-2007:12.4 The structural VAR representation is 24 (1) A0z, = a +? AiZt_i + et, i=i where et denotes the vector of serially and mutually uncorrelated structural innovations. I pos tulate that A"0! has a recursive structure such that the reduced-form errors e, can be decomposed according to e, = A~o et: AA/^A ^^ q q eoil supply shock \ I 1= a2l a22 0 demand shock I et=[er segregate \ r, rp? I n r, r, \ t~?m specific-demand shock! J \et j ^a3l a32 a33j \et y 4 The starting date is dictated by the availability of the oil production data from the US Department of Energy. I Estimate the effect of production surprises on oil price compute the log differences of world crude oil production in millions of barrels pumped per day (averaged by month). The real oil price series is obtained based on the refiner acquisition cost of imported crude oil, as provided by the US Estimate Department of Energy the since effect 1974:1 and of extended REAbackward surprises as in Barsky uncorrelated and Kilian (2002). with The nominal oil price has been deflated by the US CPI. production surprises 35
Example: Impulse Responses a.k.a. ATE Kilian (AER 2009 and JAAE 2012) 1980 1975 1985 1990 1995 2000 2005 Figure 2. Historical Evolution of the Structural Shocks, 1975-2007 Note: Structural residuals implied by model (1), averaged to annual frequency. Oil supply shock 15 I-i 10 i-1 1-1 Oil supply shock Oil supply shock 10 10 3 o. * f 5. 5 g 5 #. s. 8-20*5*'?-...---- i _25 I-.-.-.-1 _5 I-.-,-.-1 1-.-1-1 50 10 15 0 5 10 15 0 5 10 15 Aggregate demand shock i-1-1 15 i-1-1 I-1 10 Aggregate demand shock Aggregate demand shock 10 10 S?. =... 5?? *-.. ----? *". O -15 DC? -20 I i _5 _25 I-.-1 _5 I-.-.-.-1 I-1-.-I 10 50 015 5 10 15 5 100 15 Oil-specific demand shock Oil-specific demand shock Oil-specific demand shock 15-10 -,-1 I-,-1 10? 10 J>'-t'-Z.., 6-15 oc "***~^t $ -20. _5 50 10 15 0 5 10 15 0 5 10 15 Months Months Months Figure 3. Responses to One-Standard-Deviation Structural Shocks Demand has large persistent effect on prices 36
Example: Allowing SR Supply Response to be Positive Kilian (AER 2009 and JAAE 2012) 37
38 Conclusion Time series analysts tend to ask questions that are less clean, perhaps because they have few clean experiments Rather than what is the effect of X and Y, ask What is the response of Y to an unexpected change in X? How long does the response last? How does X vary? How much of the variation in Y does X explain? Think of the impulse respone as an average treatment effect The treatment is a forecast error Track the response at various horizons