#acl DynareWriterGroup:read,write,delete,revert DynareTeamGroup:read,write,delete,revert,admin All:read #pragma latex_preamble LatexPackage == Theoretical reminder == Consider the order <> VAR representation for the <> vector of observed variables <>: {{{#!latex \[ y_{t}=\mathbf C+\sum_{k=1}^{p} y_{t-k} \mathbf{A}_{k} + u_t \] }}} where <>. Let <> be the <> vector <> and define <>, the VAR representation can then be written in matrix form as: {{{#!latex \[ Y=Z\mathbf A +\mathcal U \] }}} 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: {{{#!latex \[ 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 <> 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: {{{#!latex \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 <> and <>, the priors for the VAR parameters are given by: {{{#!latex \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 <> is assumed to be non singular and <> for the priors to be proper. 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: {{{#!latex \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 <> is defined by [P1a,P1b] and [P2]. The posterior distribution, may be factorized in the following way: {{{#!latex \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 <> 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: {{{#!latex \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: {{{#!latex \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: {{{#!latex \[ V(\theta,\lambda) = \lambda T~\Gamma_{ZZ}(\theta) +Z'Z \] }}} 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 : 1. Calibrated to a positive real number (greater than <>) or to '''Inf''' (<> 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 <> 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 [[attachment:simul_hybrid.mod]] to create a data set from a new keynesian model with an hybrid Phillips curve. Second run the file [[attachment: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''. [[http://www.ecb.int/pub/pdf/scpwps/ecbwp942.pdf| 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.