# Bayesian Estimation of the Panel VAR Model

To simplify the following exposition, we rewrite the panel VAR model as:

where *Y _{c}* is a matrix with

*N*endogenous variables in the columns and time-series observations in the rows, in country c, with the total number of countries

*C*?

*X*contains the lags of the variables in

_{c}*Y*and the interac-

_{c}*W L*

tion terms, i.e. *T^**Bw.k.Jca-kZZ* ^{in E}q. t^{8}-^{12}^ ^{and B}*c* ^{is the arra}y ^{of asso-}

*w=1 k=1*

ciated coefficients. *F* contains the common factors and the matrix *D _{c}* is the matrix of factor loadings, allowing each factor to affect each equation differently.

*Z*contains the economic structure variables in levels and the

_{c}*W W*

interaction terms for *Y** _{c},* i.e.

*^G*

_{w}Y

_{t}*cZW*and

_{t}*^H*

_{w}*Z*

*W*in (8.12), with

_{t}*GH*

*w=2 w=2*

containing the corresponding coefficients. *U** _{c}* is the matrix of the actual reduced form country-specific VAR innovations. This is assumed to be normally distributed with variance-covariance matrix

*Z*

*.*

Jarocinski (2010) shows that based on these assumptions, the joint posterior of the model can be written as:

where *X**c* = *I*_{N}*®X*_{a} *F**= **I*_{N}*, **Z**c* = *I*_{N}* Z* =

_{a}y

_{c}

*vec*

*(*

*Y*

*)*

*в*

*с*

*= vec*

*(*

*B*

*)*

*
*

*в = ** _{VeC}*(B),

*d*

*=*

_{c}*vec*

*(*

*D*

*and*

_{c})*gh*=

*vec*

*(*

*GH*

*).*Based on this posterior, it is

easy to derive the conditional distributions of the Gibbs sampler for this model:

The country-specific VAR coefficients *P** _{c}* are drawn from:
where ^ = Z-

^{1}®

*X'*

_{c}X_{c}+Г^{-}V_{c}

*X* is treated as a hyperparameter and drawn from the following inverse gamma 2 distribution:

A completely non-informative prior with *s* and *v* set to 0 results in an improper posterior in this case. We therefore set both of the quantities to very small positive numbers, which is equivalent to assuming a weakly informative prior. But it is important to point out that X is estimated from the total number of coefficients that this prior is applied to, namely the product of country (C), equations *(N)* and total number of coefficients in each equation (K). Given this large number of effective units, any weakly informative prior will be dominated by the data. Finally, the variance matrix of the residuals, *Z,* is drawn from an inverse-Wishart distribution:

where *U _{c} = y_{c} - X_{c}P_{c} - Fd_{c}, U* is an

*Txn*matrix stacking all of the U

_{c}’s and

*T*is the number of observations for each country.

As in Lopes and West (2004), each individual factor, f, for can be drawn from:

where K is an Cx1 vector the associated factor loadings, made up from the elements in d_{c}. Z is an *CxC* diagonal matrix of variances associated with equation *n* in country *c* that the factor loads on. The coefficients associated with the factors are drawn from:

Finally, we draw the coefficients contained in *GH* equation by equation from:

where the subscript *n* refers to equation *n* in (8.12).This is to capture the asymmetric nature of *GH* across both of the equations. For the first equation, *GH* contains the coefficients on the levels of the economic structure variables, namely the financial repression index, the capital account openness index and the exchange rate regime index. The coefficients on all other variables take the value of zeros. For the second equation, all of the coefficients in *GH* are estimated. In other words, in addition to all of the coefficients from Eq. (8.1), the coefficients on and all of the associated interaction terms are also estimated now.