s Lecture 4: Bayesian VAR Hedibert Freitas Lopes The University of Chicago Booth School of Business 5807 South Woodlawn Avenue, Chicago, IL 60637 http://faculty.chicagobooth.edu/hedibert.lopes hlopes@chicagobooth.edu
s 1 VAR s 2 3 4 5 Outline
s Del Negro and Schorfheide (2011) says VAR at a glance VARs appear to be straightforward multivariate generalizations of univariate autoregressive models. They turn out to be one of the key empirical tools in modern macroeconomics. Sims (1980) proposed that VARs should replace large-scale macroeconometric models inherited from the 1960s, because the latter imposed incredible restrictions, which were largely inconsistent with the notion that economic agents take the effect of todays choices on tomorrows utility into account. VARs have been used for macroeconomic forecasting and policy analysis to investigate the sources of business-cycle fluctuations and to provide a benchmark against which modern dynamic macroeconomic theories can be evaluated.
s Let y t = (y t1,..., y tq ) contain q (macroeconomic) time series observed at time t. The (basic) VAR(p) can be written as where y t = B 1 y t 1 +... + B p y t p + u t u t i.i.d. N(0, Σ) and B 1,..., B p are (q q) autoregressive matrices Σ is an (q q) variance-covariance matrix
s Multivariate regression More compactly, y t = Bx t + u t u t N(0, Σ), where B = (B 1,..., B p ) is the (q qp) autoregressive matrix, x t = (y t 1,..., y t p) is qp-dimensional.
s Let Y = (y 1,..., y n ) is n q, X = (x 1,..., x n ) is n qp, U = (y 1,..., u n ) is n q. Matrix normal Then Y = XB + U U N(0, I n, Σ).
s Multivariate normal Let y i = (y 1i,..., y ni ) be the n-dimensional vector with the observations for time series i, for i = 1,..., q. Let y = vec(y ) = (y 1, y 2,..., y q). Similarly, β = vec(b ) and u = vec(u). Then y = (I q X )β + u u N(0, Σ I n ).
s or 0 B @ y t y t 1 y t 2. y t p+1 h-step ahead forecast 1 0 1 0 B 1 B 2 B p 1 B p I q 0 0 0 = 0 I q 0 0 C B A @......... C B.. A @ 0 0 I q 0 y t = Ay t 1 + u t. y t 1 y t 2 y t 3. y t p 1 0 + C B A @ u t u t 1 u t 2. u t p+1 1 C A Therefore, the h-step ahead forecast is Z y t(h) = F (A, yt, h)p(b, Σ data)d(b, Σ), where the forecast function F (A, y t, h) = A h y t is a highly nonlinear function of B 1,..., B p.
s A VAR(p) is covariance-stationary if all values of z satisfying lie outside the unit circle. I q B 1 z B 2 z 2 B p z p = 0 This is equivalent to all eigenvalues of A lying inside the unit circle.
s Vector MA( ) representation If all eigenvalues of A lie inside the unit circle, then with y t = Ψ i u t i, i=0 Ψ 0 = I q Ψ s = B 1 Ψ s 1 + B 2 Ψ s 2 + + B p Ψ s p for s = 1, 2,... Ψ s = 0 for s < 0
s Variance Decomposition The mean square error (MSE) of the h-step ahead forecast is Σ + Ψ 1 ΣΨ 1 + + Ψ h 1 ΣΨ h 1. The error u t N(0, Σ) can be orthogonalized by ε t = A 1 u t N(0, D) where Σ = ADA and D is diagonal (for instance, via singular value decomposition or Cholesky decomposition). The MSE of the h-step ahead forecast can be rewritten as The conbribution of the jth orthogonalized innovation to the MSE is d j (a j a j + Ψ 1 a j a jψ 1 + + Ψ h 1 a j a jψ h 1 )
s Impulse-response function The matrix Ψ s has the interpretation y t+s u s = Ψ s, that is, the (i, j) element of Ψ s identifies the consequences of a one-unit increase in the innovation of variable j at time t for the value of variable i at time t + s, holding all other innovations at all dates constant. A plot of the (i, j) element of Ψ s, y t+s,i u s,i, as a function of s is called the impulse-response function. Similar to the forecast function, the impulse-response function is also highly nonlinear on B 1,..., B q.
s Simulated example 1 Simulating 1000 observations from a trivariate VAR(2) 2 0.7 0.1 0.0 0.2 0.0 0.0 µ = 1 B 1 = 0.0 0.4 0.1 B 2 = 0.0 0.1 0.1 0 0.9 0.0 0.8 0.0 0.0 0.0 and 0.26 0.03 0.00 Σ = 0.03 0.09 0.00. 0.00 0.00 0.81 Posterior summaries based on 1000 draws. 1 Based on Lütkepohl s (2007) Problem 2.3 and using Sims code (later slides).
p(µ data) VAR s 0.0 0.5 1.0 1.5 mu(1) 0.0 0.5 1.0 1.5 2.0 mu(2) 0.0 0.2 0.4 0.6 0.8 mu(3) 1.0 1.5 2.0 2.5 0.5 0.0 0.5 1.0 1.0 0.5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2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0
s Response of Y1 Response of Y1 0.2 0.3 0.4 0.10 0.00 0.05 0.10 0.15 0.20 0.0 0.1 0.5 Shock on Y1 0 10 20 30 40 50 Steps Shock on Y2 Response of Y2 Response of Y2 0.05 0.10 0.0 0.1 0.2 0.3 0.4 0.00 0.15 Shock on Y1 0 10 20 30 40 50 Steps Shock on Y2 Impulse response Response of Y3 Response of Y3 0.10 0.05 0.05 0.00 0.05 0.10 0.15 0.20 0.15 0.00 0.05 Shock on Y1 0 10 20 30 40 50 Steps Shock on Y2 0 10 20 30 40 50 Steps 0 10 20 30 40 50 Steps 0 10 20 30 40 50 Steps Shock on Y3 Shock on Y3 Shock on Y3 Response of Y1 0.0 0.2 0.4 0.6 0.8 Response of Y2 0.3 0.2 0.1 0.0 0.1 Response of Y3 0.0 0.2 0.4 0.6 0.8 1.0 0 10 20 30 40 50 Steps 0 10 20 30 40 50 Steps 0 10 20 30 40 50 Steps
s Real data example 2 Monthly real stock returns, real interest rates, real industrial production growth and the inflation rate (1947.1 1987.12) 2 Section 11.5 of Zivot and Wang (2003).
s Posterior means E(µ data) = ( 0.0074 0.0002 0.0010 0.0019 ) E(B 1 data) = 0.24 0.81 1.50 0.00 0.00 0.88 0.71 0.00 0.01 0.06 0.46 0.01 0.03 0.38 0.07 0.35 E(B 2 data) = 0.05 0.35 0.06 0.19 0.00 0.04 0.01 0.00 0.01 0.59 0.25 0.02 0.04 0.33 0.04 0.09
s Impulse-response functions
s Variance decomposition
s Recall that β = vec(b ). Prior shrinkage Let β i be column i of B : B = (β 1,..., β q ). Therefore, β = (β 1,..., β q) with β i a vector of dimension qp corresponding to all autoregressive coefficients from equation i. : q = 3, p = 2 b 1,11 b 1,12 b 1,13 b 2,11 b 2,12 b 2,13 B = b 1,21 b 1,22 b 1,23 b 2,21 b 2,22 b 2,23 = b 1,31 b 1,32 b 1,33 b 2,31 b 2,32 b 2,33 β 1 β 2 β 3
s Litterman s (1980,1986) advocates that β i N(β i0, V i0 ) with V i0 chosen to center the individual equations around the random walk with drift: y ti = µ i + y t 1,i + u ti. This amounts to: Shrinking the diagonal elements of B 1 toward one, Shrinking the remaining coefficients of B 1,..., B p toward zero, In addition: Shrinking the number of lags p towards one, Own lags should explain more of the variation than the lags of other variables in the equation.
s V i0 is diagonal with elements θ 2 λ 2 k 2 σ2 i σ 2 j for coefficients on lags of variable j i, and for coefficients on own lags. λ 2 k 2 Specifying V i0 The error matrix Σ is assumed to be diagonal, fixed and known Σ = diag(σ 2 1,..., σ 2 q).
s on (β, Σ) Kadiyala and Karlsson (1993,1997) extend the : Normal-Wishart prior N(β 0, Σ Ω)IW (Σ 0, α) Jeffreys prior p(β, Σ) Σ (q+1)/2 Normal-Diffuse prior β N(β 0, V 0 ) p(σ) Σ (q+1)/2 Extended Natural Conjugate (ENC) prior Kadiyala and Karlsson (1993) use MC integration. Kadiyala and Karlsson (1997) use Gibbs sampler.
s
s Kadiyala and Karlsson (1997) revisited Litterman (1986): Annual growth rates of real GNP (RGNPG), Annual inflation rates (INFLA), Unemployment rate (UNEMP) Logarithm of nominal money supply (M1) Logarithm of gross private domestic investment (INVEST), Interest rate on four- to six-month commercial paper (CPRATE) Change in business inventories (CBI). Quarterly data from 1948:1 to 1981:1 (133 observations). Out-of-sample forecast: 1980:2 to 1986:4 q = 7, p = 6 7 + 6(7 2 ) = 301 parameters.
s Time series
s Root mean square error
s They argue that and... our preferred choice is the Normal-Wishart when the prior beliefs are of the Litterman type. For more general prior beliefs... the Normal-Diffuse and EN priors are strong alternatives to the Normal-Wishart.
s Rubio-Ramírez, Waggoner and Zha (2010) say that Since the seminal work by Sims (1980), identification of structural vector autoregressions (SVARs) has been an unresolved theoretical issue. Filling this theoretical gap is of vital importance because impulse responses based on SVARs have been widely used for policy analysis and to provide stylized facts for dynamic stochastic general equilibrium (DSGE) models.
s Let P c,t is the price index of commodities. Y t is output. R t is the nominal short-term interest rate. Trivariate SVAR(1) representation: a 11 log P c,t + 0.0 log Y t + a 31 R t = c 1 + b 11 log P c,t 1 + b 21 log Y t 1 + b 31 R t 1 + ε 1,t a 12 log P c,t + a 22 log Y t + 0.0R t = c 2 + b 12 log P c,t 1 + b 22 log Y t 1 + b 32 R t 1 + ε 2,t a 13 log P c,t + a 23 log Y t + a 33 R t = c 3 + b 13 log P c,t 1 + b 23 log Y t 1 + b 33 R t 1 + ε 3,t 1st eq. monetary policy equation. 2nd eq. characterizes behaviour of finished-goods producers. 3rd eq. commodity prices are set in active competitive markets.
s The (basic) SVAR(p) can be written as A 0 y t = A 1 y t 1 +... + A p y t p + u t u t i.i.d. N(0, I q ), where A = (A 1,..., A p ) B i = A 1 0 A i i = 1,..., p B = A 1 0 A Σ = (A 0 A 0 ) 1 Much of the SVAR literature involves exactly identified models.
s Exact identification Define g such that g(a 0, A) = (A 1 0 A, (A 0A 0 ) 1 ). Consider an SVAR with restrictions represented by R. Definition: The SVAR is exactly identified if and only if, for almost any reduced-form parameter point (B, Σ), there exists a unique structural parameter point (A 0, A) R such that g(a 0, A) = (B, Σ). Waggoner and Zha (2003) developed an efficient MCMC algorithm to generate draws from a restricted A 0 matrix.
s 0 A 0 = B @ Illustration 1 PS PS MP MD Inf log Y a 11 a 12 0 a 14 a 15 log P 0 a 22 0 a 14 a 25 R 0 0 a 33 a 34 a 35 log M 0 0 a 43 a 44 a 45 log P c 0 0 0 0 a 15 where log Y : log gross domestic product (GDP) log P: log GDP deflator R: nominal short-term interest rate log M: log M3 log P c: log commodity prices and MP: monetary policy (central bank s contemporaneous behavior) Inf: commodity (information) market MD: money demand equation PS: production sector 1 C A
s 0 A 0 = B @ Illustration 2 PCOM M2 R Y CPI U Inform X X X X X X MP 0 X X 0 0 0 MD 0 X X X X 0 Prod 0 0 0 X 0 0 Prod 0 0 0 X X 0 Prod 0 0 0 X X X where PCOM: Price index for industrial commodities M2: Real money R: Federal funds rate (R) Y: real GDP interpolated to monthly frequency CPI: Consumer price index (CPI) U: Unemployment rate (U) Inform: Information market MP: Monetary policy rule MD: Money demand Prod: Production sector of the economy 1 C A
s Monetary Policy Shock
s Pelloni and Polasek (2003) introduce the VAR model with GARCH errors as where and vech(σ t ) = α 0 + y t = p B i y t i + u t i=1 u t N(0, Σ t ) r A i vech(σ t i ) + i=1 s Θ i vech(u t i u t i) i=1
s German, U.S., and U.K. quarterly data sets over the period 1968-1998. Variables are logs of aggregate employment and of the employment shares of the manufacturing, finance, trade, and construction sectors for U.S. and U.K.
s Uhlig (1997) introduced stochastic volatility (SV) for the error term in BVARs: p y t = B i y t i + u t, where and dynamics i=1 u t N(0, Σ t ) and Σ 1 t = L t L t, Σ 1 t+1 = L tθ t L t λ ( ν + pq Θ t B q, 1 2 2 ).
s Primiceri (2005) discusses VARs with time varying coefficients and stochastic volatility with y t = p B it y t i + u t u t N(0, Σ t ) i=1 Σ t = (A t ) 1 D t (A t) 1, and 1 0 0 σ 2 1,t 0 0 α 21,t 1 0 A t =........ D 0 σ2,t 2 0 t =......... α q1,t α q,q 1,t 1 0 0 σq,t 2
s Dynamics VAR coefficients: B t = B t 1 + ν t ν t N(0, Q) Cholesky coefficients: α t = α t 1 + ξ t ξ t N(0, S) Stochastic volatility: log σ t = log σ t 1 + η t η t N(0, W )
s
s See Nakajima, Kasuya and Watanabe (2011) for an application to the Japanese economy.
s VAR(1) case 3 Small: q = 3 15 parameters Medium: q = 20 610 parameters Large: q = 131 25,807 parameters Curse of dimensionality 3 Small, Medium and Large are based on the VAR specifications of Bańura, Giannone and Reichlin (2010).
s References Ahmadi and Uhlig (2009) Measuring the Dynamic Effects of Monetary Policy Shocks: A Bayesian FAVAR Approach with Sign Restriction. Technical Report. Bańbura, Giannone and Reichlin (2010) Large Bayesian vector auto regressions. JAE, 25, 71-92. Brandt and Freeman (2006) Advances in Bayesian Time Series Modeling and the Study of Politics: Theory Testing,, and Policy Analysis. Political Analysis, 14, 1-36. Carriero, Kapetanios, Marcellino (2009) exchange rates with a large Bayesian VAR. International Journal of, 25, 400-417. Del Negro and Schorfheide (2011) Bayesian Macroeconometrics. In Handbook of Bayesian Econometrics, Chapter 7, 293-387. Oxford University Press. Doan, Litterman and Sims (1984) and conditional projection using realistic prior distributions (with discussion). Econometric Reviews, 3, 1-144. Garratt, Koop, Mise and Vahey (2009) Real-Time Prediction With U.K. Monetary Aggregates in the Presence of Model Uncertainty. Journal of Business & Economic Statistics, 27, 480-491. Jochmann, Koop, Leon-Gonzalez and Strachan (2011) Stochastic search variable selection in vector error correction models with application to a model of the UK macroeconomy. JAE. Jochmann, Koop and Strachan (2010) Bayesian forecasting using stochastic search variable selection in a VAR subject to breaks. International Journal of, 26, 326-347. Kadiyala and Karlsson (1993) with generalized Bayesian vector autoregressions. Journal of, 12, 365-78. Kadiyala and Karlsson (1997). Numerical methods for estimation and inference in Bayesian VAR-models. Journal of Applied Econometrics, 12, 99-132.
s Refences (cont.) Koop and Korobilis (2009). Bayesian multivariate time series methods for empirical macroeconomics. Foundations and Trends in Econometrics, 3, 267-358. Koop and Korobilis (2012) Large Time-Varying Parameter VARs. Technical Report. Korobilis (2008) in vector autoregressions with many predictors. Technical Report, University of Strathclyde. Korobilis (2012) VAR forecasting using Bayesian variable selection. Journal of Applied Econometrics, forthcoming. Litterman (1980) A Bayesian procedure for forecasting with vector autoregressions. Technical Report, MIT. Litterman (1986) with Bayesian vector autoregressions five years of experience. Journal of Business & Economic Statistics, 4, 25-38. Lütkepohl (2007) New Introduction to Multiple Time Series Analysis. Springer. Nakajima, Kasuya and Watanabe (2011) Bayesian analysis of time-varying parameter vector autoregressive model for the Japanese economy and monetary policy. Journal of The Japanese and International Economies, 25, 225-245. Pelloni and Polasek (2003) Macroeconomic Effects of Sectoral Shocks in Germany, the U.K. and, the U.S.: A -M Approach. Computational Economics, 21, 65-85. Pfaff (2008) VAR, SVAR and SVEC Models: Implementation within R Package vars. Journal of Statistical Software, 27, 1-32. Primiceri (2005). Time Varying Structural Vector Autoregressions and Monetary Policy, Review of Economic Studies, 72, 821-852.
s Refences (cont.) Rubio-Ramírez, Waggoner and Zha (2010) Structural Vector Autoregressions: Theory of Identification and Algorithms for Inference. Review of Economic Studies, 77, 665-696. Sims (1980) Macroeconomics and Reality. Econometrica, 48, 1-48. Sims (2007) Bayesian Methods in Applied Econometrics, or, Why Econometrics Should Always and Everywhere Be Bayesian. Technical Report, Princeton University. Sims and Zha (1998). Bayesian Methods for Dynamic Multivariate Models. International Economic Review, 39, 949-968. Stock and Watson (2005) Implications of dynamic factor models for VAR analysis. Technical Report. Uhlig (1997) Bayesian Vector Autoregressions with Stochastic Volatility. Econometrica, 65, 59-73. Villani (2009) Steady-state priors for vector autoregressions. Journal of Applied Econometrics, 24, 630-650. Waggoner and Zha (2003) A Gibbs Sampler for s. Journal of Economic Dynamics and Control, 28, 349-366. Zha (1999) Block recursion and structural vector autoregressions. Journal of Econometrics, 90, 291-316. Zivot and Wang (2003) Modeling Financial Time Series with S-plus. Springer.