Theoretical reminder

Consider the order $p$ VAR representation for the $1\times m$ vector of observed variables $y_t$:

\[
y_{t}=\sum_{k=1}^{p} y_{t-k} \mathbf{A}_{k} + u_t
\]

where $u_t\sim \mathcal N\left( 0,\Sigma_u\right)$. Let $z_t$ be the $mp\times 1$ vector $\left[y_{t-1}',...,y_{t-p}'\right]'$ and define $\mathbf{A}=\left[\mathbf A_1',...,\mathbf A_p'\right]'$, the VAR representation can then be written in matrix form as:

\[
Y=Z\mathbf A +\mathcal U
\]

where $Y = (y_1',\dots,y_T')'$, $Z = (z_1',\dots,z_T')'$ and $\mathcal U = (u_1',\dots,u_T')'$.

Dummy observations prior for the VAR can be constructed using the VAR likelihood function for $\mathcal T = [\lambda T]$ artificial data simulated with the DSGE $\left( Y^{\ast },Z^{\ast}\right)$, combined with diffuse priors (see Tiao and Zellner (1962) or Zellner (1971)). The prior is then given by:

\[
p_{0}\left( \mathbf A, \Sigma \mid Y^*,Z^* \right)
\propto
\left\vert \Sigma \right\vert ^{-\frac{\lambda T+m+1}{2}}e^{-\frac{1}{2}tr\left[ \Sigma^{-1}\left(
{Y^*}'Y^*-\mathbf{A}'{Z^*}'Y^*-{Y^*}'Z^*\mathbf A+ \mathbf A'{Z^*}'Z^*\mathbf A \right) \right] }
\]

implying that $\Sigma$ follows an inverted Wishart distribution and $\mathbf A$ conditional on $\Sigma$ is gaussian. Assuming that observables are covariance stationary, Del Negro and Schorfheide use the DSGE theoretical autocovariance matrices for a given $n\times 1$ vector of model parameters $\theta$, denoted $\Gamma_{YY}\left( \theta \right)$, $\Gamma_{ZY}\left( \theta \right)$, $\Gamma_{YZ}\left( \theta\right)$, $\Gamma_{ZZ}\left( \theta \right)$ instead of the (artificial) sample moments ${Y^*}'Y^*$, ${Z^*}'Y^*$, ${Y^*}'Z^*$, ${Z^*}'Z^*$. In addition, the $p$-th order VAR approximation of the DSGE provides the first moment of the prior distributions through the population least-square regression:

\begin{subequations}
    \begin{equation}\tag{P1a}%\label{prior1a}
        \mathrm A^*( \theta ) = \Gamma_{ZZ}\left( \theta
        \right)^{-1}\Gamma_{ZY}\left( \theta \right)
    \end{equation}
    \begin{equation}\tag{P1b}%\label{prior1b}
        \Sigma^*(\theta) = \Gamma_{YY}(\theta) -\Gamma_{YZ}(\theta)
        \Gamma_{ZZ}\left( \theta \right)^{-1}\Gamma_{ZY}\left( \theta \right)
    \end{equation}
\end{subequations}

Conditional on the deep parameters of the DSGE $\theta $ and $\lambda$, the priors for the VAR parameters are given by:

\begin{equation}\tag{P2}%\label{prior2}
 \begin{split}
    \mathrm{vec} \mathbf A \mid \Sigma ,\theta, \lambda &\sim \mathcal N \left(\mathrm{vec}\mathbf A^*(\theta),\Sigma
        \otimes \left[\lambda T \Gamma_{ZZ}(\theta)\right]^{-1}\right)\\ 
    \Sigma \mid \theta,\lambda &\sim \mathcal{IW}\left(\lambda T \Sigma^*(\theta),\lambda
T-mp-m\right)
 \end{split}
\end{equation}

where $\Gamma_{ZZ}(\theta)$ is assumed to be non singular and $\lambda \geq \frac{mp+m}{T}$ for the priors to be proper (Note that it would not be possible to estimate the VAR model by OLS (or maximum likelihood) if we had $\mathcal T < m(p+1)$. In this case we would not have more observations than parameters to estimate). The a priori density of $\mathbf A$ is defined by $n+1$ parameters ($\theta$ and $\lambda$), which is likely to be less than $m^2p$ (the VAR number of parameters). If we have a one-to-one relationship (no identification issues) between $(\theta,\lambda)$ and $\mathbf A$ it will be a good idea to estimate $(\theta,\lambda)$ instead of $\mathbf A$, ie to estimate fewer free parameters. To do so, Del Negro and Schorfheide complete the prior by specifying a prior distribution over the structural model's deep parameters: $p_0(\theta)$. We still have to set the weight of the structural prior, $\lambda$. Del Negro and Schorfheide choose the value of $\lambda$ that maximizes the marginal density. They estimate a limited number of DSGE-VAR models, say $N$ models, with different values of $\lambda$. For each model they also estimate the marginal density and select the model (ie the value of $\lambda$) with highest marginal density. Implicitly, they compare different models considering a (discrete) uniform prior distribution over the collection of $N$ models. With Dynare it is also possible to estimate $\lambda$ as another parameter, instead of doing a loop over the values of this parameter. So we define a prior on $\lambda$, which is assumed to be independent from $\theta$.

Finally, the DSGE-VAR model has the following prior structure:

\begin{equation}\tag{P3}
p_0\left( \mathbf A,\Sigma, \theta, \lambda \right) = p_0\left(
\mathbf A, \Sigma \mid \theta ,\lambda \right) \times
p_0\left( \theta \right) \times p_0\left( \lambda \right)
\end{equation}

where $p_0\left(\mathbf A, \Sigma \mid \theta ,\lambda \right)$ is defined by [P1a,P1b] and [P2].

The posterior distribution, may be factorized in the following way:

\begin{equation}\tag{Q3}
p\left( \mathbf A, \Sigma , \theta , \lambda \mid \mathcal Y_T\right) = p\left(\mathbf A, \Sigma
\mid \mathcal Y_T, \theta, \lambda\right) \times
p\left( \theta ,\lambda \mid \mathcal Y_T\right)
\end{equation}

where $\mathcal Y_T$ stands for the sample. A closed form expression for the first density function on the right hand side of [Q3] is available. Conditional on $\theta$ and $\lambda$, [P1a,P1b] and [P2] define a conjugate prior for the VAR model, so its posterior density belongs to the same family: the distribution of $\mathbf A$ conditional on $\Sigma$, $\theta$, $\lambda$ and the sample is matric-variate normal, and the distribution of $\Sigma$ conditional on $\theta$, $\lambda$ and the sample is inverted Wishart. More formally, we have:

\begin{equation}\tag{Q2}
    \begin{split}
        \mathrm{vec} \mathbf A \mid \Sigma, \theta , \lambda, \mathcal Y_T  
            & \sim \mathcal N \mathrm{vec} \left(\widetilde{\mathbf A}(\theta,\lambda),\Sigma \otimes
            V(\theta,\lambda)^{-1}\right)\\
        \Sigma \mid \theta, \lambda, \mathcal Y_T &\sim 
            \mathcal{IW} \left( (\lambda+1) T~\widetilde{\Sigma}(\theta,\lambda),(\lambda+1)T-mp-m\right)
    \end{split}
\end{equation}

where:

\begin{subequations}%\tag{Q1}\label{posterior3}
     \begin{equation}\tag{Q1a}%\label{posterior3a}
         \widetilde{\mathbf A}(\theta,\lambda) = V(\theta,\lambda)^{-1}\left( \lambda
             T~\Gamma_{ZY}(\theta)+Z'Y\right)
     \end{equation}
    \begin{equation}\tag{Q1b}%\label{posterior3b}
         \widetilde{\Sigma}(\theta,\lambda) = \frac{1}{(1+\lambda)T}
             \left[ \lambda T~\Gamma_{YY}(\theta) + Y'Y - \left(\lambda T~\Gamma _{YZ}(\theta)
             +Y'Z\right) V(\theta,\lambda)^{-1}\left(
              \lambda T~\Gamma_{ZY}(\theta)+Z'Y\right)\right]
    \end{equation}
\end{subequations}

with:

\[
V(\theta,\lambda) = \lambda T~\Gamma_{ZZ}(\theta) +Z'Z
\]

The posterior mean of $\mathbf A$ is a convex combination of $A^*(\theta)$, the prior mean, and of the OLS estimate of $\mathbf A$. When $\lambda$ goes to infinity the posterior mean shrinks towards the prior mean, ie the projection of the DSGE model onto the VAR($p$). We do not have a closed form expression for the joint posterior density of $\theta$ and $\lambda$ (the second term on the right hand side of [Q3]). So the posterior distribution of $(\theta,\lambda)$ is recovered from an MCMC algorithm, as described in Del Negro and Schorfheide, except that we do estimate $\lambda$ as the deep parameters $\theta$.

Estimation of a DSGE-VAR model with Dynare

Up to version 4.1.x

The estimation of a DSGE-VAR model instead of a DSGE model is triggered by using the keyword dsge_prior_weight in the list of declared parameters. This parameter name is the Dynare word for $\lambda$. If dsge_prior_weight is a parameter, Dynare understands that the user wants to estimate a DSGE-VAR model using the DSGE model declared in the same file as a prior for a VAR model. The number of lags is four by default and can be changed by adding, for instance, the following line of code:

options_.varlag = 12;

before the estimation command. The weight of the DSGE prior can be :

  1. Calibrated to a positive real number (greater than $\frac{mp+m}{T}$) or to Inf ($\lambda=\infty$ case).

  2. Estimated jointly with the deep parameters. In this case, a prior density has to be defined in the estimated_params block with the usual syntax. An example where the estimation of $\lambda$ is implemented is given in Adjemian Darracq-Pariès and Moyen (2008).

Version 4.2.x and following

The estimation of a DSGE-VAR model instead of a DSGE model is triggered by using the keyword dsge_var in the estimation command. If the weight of the DSGE prior is calibrated (as in Del Negro and Schorfheide (2004)) the calibrated value for $\lambda$ must be supplied the the estimation block as follows:

estimation(..., dsge_var = 1.4, ...);

The DSGE prior weight has to be a real positive number or plus infinity. If the weight of the DSGE prior is estimated (as in Adjemian, Darracq-Pariès, and Moyen (2008)), the prior of $\lambda$ must be defined in the estimated_params block, as follows:

estimated_params;
 ...
 dsge_prior_weight, uniform_pdf, , , 0, 2;
 ...
end;

estimation(..., dsge_var, ...);

The number of lags of the VAR model is four by default and can be changed by using the option dsge_varlag in the estimation command, for instance:

estimation(..., dsge_var, dsge_varlag=12, ...);

Example

Up to version 4.1.x

First run the file simul_hybrid.mod to create a data set from a new keynesian model with an hybrid Phillips curve. Second run the file bvar_forward.mod to estimate the DSGE-VAR model (where the DSGE prior is a new keynesian model with an hybrid Phillips curve). The second file is documented.

Version 4.2.x and following

Examples are in the tests directory of the (git) master repository.

References

Adjemian, S., Darracq-Pariès, M. and S. Moyen (2008). Towards a monetary policy evaluation framework. ECB Working paper 942

Del Negro, M., and F. Schorfheide (2004). Priors from General Equilibrium Models for VARs, in International Economic Review, 45(2), 643–673.

Del Negro, M., F. Schorfheide, F. Smets, and R. Wouters (2007). On the Fit of New Keynesian Models, in Journal of Business and Economic Statistics, 25(2), 123-162.

Tiao, G. C., and A. Zellner (1964). Bayes Theorem and the Use of Prior Knowledge in Regression Analysis, Biometrika, 51(162), 219–230.

Zellner, A. (1971). An Introduction to Bayesian Inference in Econometrics. John Wiley & Sons.

DynareWiki: DsgeVar (last edited 2010-07-05 14:10:20 by StéphaneAdjemian)