Theoretical reminder
Consider the order
VAR representation for the
vector of observed variables
:
![\[
y_{t}=\sum_{k=1}^{p} y_{t-k} \mathbf{A}_{k} + u_t
\] \[
y_{t}=\sum_{k=1}^{p} y_{t-k} \mathbf{A}_{k} + u_t
\]](/DynareWiki/DsgeVar?action=AttachFile&do=get&target=latex_a0d779b6c7c14e45e5f34a3cc8b26d0e41b45de1_p1.png)
where
. Let
be the
vector
and define
, the VAR representation can then be written in matrix form as:
![\[
Y=Z\mathbf A +\mathcal U
\] \[
Y=Z\mathbf A +\mathcal U
\]](/DynareWiki/DsgeVar?action=AttachFile&do=get&target=latex_39839dadd822540e9e83e6cc8e65f045bf8531f9_p1.png)
where
,
and
.
Dummy observations prior for the VAR can be constructed using the VAR likelihood function for
artificial data simulated with the DSGE
, 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] }
\] \[
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] }
\]](/DynareWiki/DsgeVar?action=AttachFile&do=get&target=latex_80e95b87a51ea9815bc69e9866fe1033510b0531_p1.png)
implying that
follows an inverted Wishart distribution and
conditional on
is gaussian. Assuming that observables are covariance stationary, Del Negro and Schorfheide use the DSGE theoretical autocovariance matrices for a given
vector of model parameters
, denoted
,
,
,
instead of the (artificial) sample moments
,
,
,
. In addition, the
-th order VAR approximation of the DSGE provides the first moment of the prior distributions through the population least-square regression:

Conditional on the deep parameters of the DSGE
and
, 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} \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}](/DynareWiki/DsgeVar?action=AttachFile&do=get&target=latex_5d2eafb18a285f7ebb7aa6002cdc207212c5b850_p1.png)
where
is assumed to be non singular and
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
. In this case we would not have more observations than parameters to estimate). The a priori density of
is defined by
parameters (
and
, which is likely to be less than
(the VAR number of parameters). If we have a one-to-one relationship (no identification issues) between
and
it will be a good idea to estimate
instead of
, 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:
. We still have to set the weight of the structural prior,
. Del Negro and Schorfheide choose the value of
that maximizes the marginal density. They estimate a limited number of DSGE-VAR models, say
models, with different values of
. For each model they also estimate the marginal density and select the model (ie the value of
) with highest marginal density. Implicitly, they compare different models considering a (discrete) uniform prior distribution over the collection of
models. With Dynare it is also possible to estimate
as another parameter, instead of doing a loop over the values of this parameter. So we define a prior on
, which is assumed to be independent from
.
Finally, the DSGE-VAR model has the following prior structure:

where
is defined by [P1a,P1b] and [P2].
The posterior distribution, may be factorized in the following way:

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

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} \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}](/DynareWiki/DsgeVar?action=AttachFile&do=get&target=latex_6b5382e5a043b3a5b91531da7705b18bdd3fc401_p1.png)
with:
![\[
V(\theta,\lambda) = \lambda T~\Gamma_{ZZ}(\theta) +Z'Z
\] \[
V(\theta,\lambda) = \lambda T~\Gamma_{ZZ}(\theta) +Z'Z
\]](/DynareWiki/DsgeVar?action=AttachFile&do=get&target=latex_72ce5e113f8bfde21517cc5d6aea0c67e9144c16_p1.png)
The posterior mean of
is a convex combination of
, the prior mean, and of the OLS estimate of
. When
goes to infinity the posterior mean shrinks towards the prior mean, ie the projection of the DSGE model onto the VAR(
). We do not have a closed form expression for the joint posterior density of
and
(the second term on the right hand side of [Q3]). So the posterior distribution of
is recovered from an MCMC algorithm, as described in Del Negro and Schorfheide, except that we do estimate
as the deep parameters
.
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
. 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 :
Calibrated to a positive real number (greater than
) or to Inf (
case). 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
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
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
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.