L_II_10 (1)
L_II_10 (1)
Otto Toivanen
8 how to estimate a VAR how to and interpret the results of a VAR model
• Example: The effect of a change in the ECB interest rate on inflation next month, in 6
months, in 12, in 24,... months.
• Often, we only have one ”subject”, say the country affected by ECB decisions.
• If the different times are drawn from the same distribution (i.e., Yy , Xt is stationary),
then we can estimate the dynamic causal effects from an OLS regression of Yt on Xt and
its lags.
• Such an estimator is called a distributed lag estimator.
A2 i) Y , X are stationary and ii) (Yt , Xt ) and (Yt−j , Xt−j ) become independent as j grows
large.
• Assumption 3 is familiar otherwise, but now need 8 finite moments. This is to ensure
”good” (=HAC) standard errors.
• Assumption 2.ii
1 enables the use of a version of CLT
2 This is the time series equivalent of the ”independently distributed” of the cross-section i.i.d
assumption
• The intuition is that when the time periods are sufficiently separated, we have
independent experiments.
• Under the above assumptions a distributed lag model, estimated via OLS, yields
consistent estimates of the coefficients βk .
• What about the standard errors? The variance of the sampling distribution is different as
Xt and ut may be autocorrelated (think of what the equivalent would mean in a
cross-section context).
• → need standard errors that are robust not only to heteroskedasticity but also to
autocorrelation.
σu2
var (βˆ1 ) =
T (σX2 )2
T
!
1 X
var ut =var [0.5(u1 + u2 )]
T t=1
=0.25[var (u1 ) + var (u2 ) + 2cov (u1 , u2 )]
=0.5(σu2 + ρ)
• Autocorrelation means that the usual variance formula for the error term does not apply.
Stata code
1 regr infl ue if time ind >= 13 & year <= 1965, robust estimates store est50s
Stata code
1 newey infl ue if time ind >= 13 & year <= 1965, lag(0) estimates store est50s
• You directly get the impact effect of X and the k-period dynamic multipliers & their
standard errors
• You do not get the cumulative multipliers directly, nor their standard errors.
• Option 1: you estimate the above specification and then use post-estimation commands
to calculate the cumulative dynamic multipliers and their standard errors.
Newey–West
infl Coefficient std. err. t P>|t| [95% conf. interval]
ue
--. -.0007707 .0002407 -3.20 0.001 -.0012431 -.0002983
L1. .0008116 .0002206 3.68 0.000 .0003787 .0012445
chi2(1) = 0.20
Prob > chi2 = 0.6534
• Option 2: Transform the model to yield direct estimates of the cumulative dynamic
multipliers.
• Example: A 1-lag distributed lag model:
Yt =β0 + β1 Xt + β2 Xt−1 + ut
=β0 + β1 Xt − β1 Xt−1 + β2 Xt−1 + β1 Xt−1 + ut
=β0 + β1 (Xt − Xt−1 ) + (β2 + β1 )Xt−1 + ut
=β0 + β1 ∆Xt + (β2 + β1 )Xt−1 + ut
Newey–West
infl Coefficient std. err. t P>|t| [95% conf. interval]
ue
L1. .0000409 .0000912 0.45 0.653 -.000138 .0002199
Yt =β0 + β1 Xt + β2 Xt−1 + ut
Yt − φYt−1 =β0 + β1 Xt + β2 Xt−1 + ut − φYt−1
=β0 + β1 Xt + β2 Xt−1 + ut
− φ (β0 + β1 Xt−1 + β2 Xt−2 + ut−1 )
| {z }
=Yt−1
• What if they interact, i.e., the past values of Y affect current value of X and vice versa?
Yt =β10 + β11 Yt−1 + β12 Yt−2 + γ11 Xt−1 + γ12 Xt−2 + u1t
Xt =β20 + β21 Xt−1 + β22 Xt−2 + γ21 Yt−1 + γ22 Yt−2 + u2t
• Without any constraints on the coefficients, one could estimate the VAR equation by
equation.
• Often, theory suggests some constraints on the coefficients, e.g., in macroeconomic
models.
• Example of VAR: US Phillips curve.
Stata code
1 twoway s c a t t e r i n f l ue i f y e a r <= 1965 | | s c a t t e r i n f l ue i f y e a r > 1960 & y e a r <= 1980 | | ///
2 s c a t t e r i n f l ue i f y e a r > 1980 & y e a r <= 2000 | | s c a t t e r i n f l ue i f y e a r > 2000 , ///
3 t i t l e ( ”US P h i l l i p s c u r v e ” ) ///
4 s u b t i t l e ( ” 1949m1 − 2024m2” ) ///
5 l e g e n d ( l a b ( 1 ” 1949 − 1965 ” ) l a b ( 2 ” 1966 − 1980 ” ) l a b ( 3 ” 1981 − 2000 ” ) l a b ( 4 ” 2001− ” 2024m2 ) ) ///
6 graphregion ( color ( white )) bgcolor ( white )
7
8 graph expor t ” L I I 1 0 4 p h i l l i p s . pdf ” , r e p l a c e
US Phillips curve
1949m1 - 2024m2
.02
.01
1949 - 1965
1966 - 1980
inflation
0 1981 - 2000
2001-
2024m2
-.01
-.02
0 5 10 15
UE rate
.01
inflation
-.01
-.02
0 200 400 600 800 1000
time
10
UE rate
0
0 200 400 600 800 1000
time
5
UE rate, D
-5
0 200 400 600 800 1000
time
Stata code
1
2 forvalues t = 1/10{
3 dfuller ue i f t i m e i n d >= 1 3 , l a g s ( ‘ t ’ )
4 }
5 forvalues t = 1/10{
6 dfuller d . ue i f t i m e i n d >= 1 3 , l a g s ( ‘ t ’ )
7 }
8 forvalues t = 1/10{
9 dfuller i n f l i f t i m e i n d >= 1 3 , l a g s ( ‘ t ’ )
10 }
. forvalues t = 1/10{
2. dfuller d.ue if time_ind >= 13, lags(`t')
3. }
Dickey–Fuller
Test critical value
statistic 1% 5% 10%
. forvalues t = 1/10{
2. dfuller infl if time_ind >= 13, lags(`t')
3. }
Dickey–Fuller
Test critical value
statistic 1% 5% 10%
Vector autoregression
infl
infl
L1. .5831457 .0334794 17.42 0.000 .5175274 .648764
L2. .0345948 .0334775 1.03 0.301 -.03102 .1002096
ue
LD. .0001338 .0002278 0.59 0.557 -.0003127 .0005803
L2D. .0003456 .0002261 1.53 0.126 -.0000974 .0007887
D_ue
infl
L1. -5.43021 4.932801 -1.10 0.271 -15.09832 4.237903
L2. 7.239596 4.932536 1.47 0.142 -2.427996 16.90719
ue
LD. .0475497 .033565 1.42 0.157 -.0182365 .1133359
L2D. -.0497456 .0333062 -1.49 0.135 -.1150245 .0155333
• H0: the coefficients on all the lagged values of X in the Y regression are jointly
insignificant.
• Granger causality 6= causality.
• Does it make sense to assume the future does not affect the past?
Stata code
1 v a r i n f l d . ue i f t i m e i n d >= 13
2 vargranger
. vargranger