3. DSGE-VAR Modeling

3.1. Description

The DSGE-VAR or elswhere known as BVAR-DSGE is a methodology that combines a BVAR and a DSGE model following the methodology in [Del Negro and Schorfheide, 2004] and [Del Negro et al., 2007].

There are two possible interpretations. One is that the DSGE is used as a prior for the BVAR model and the other is that the BVAR serves to relax the tight restrictions in the DSGE model.

In the end we have four sub-models in one object:

  • The VAR model

  • The VAR approximation of the DSGE model

  • The DSGE model

  • The BVAR model i.e. the VAR model with the (VAR approximation of the) DSGE as prior

In RISE, the DSGE model can be a model with a simple instrument rule (e.g. Taylor rule) or an optimal policy under commitment or under discretion.

The DSGE model can be stationary or nonstationary.

3.2. A quick-start example

3.2.1. A simple New Keynesian DSGE model

dsgemodel={
'model:New Keynesian model'
'@endogenous X "Output gap" R "interest rate" P "Inflation" G U'
'@exogenous EG "Demand shock" EU "Monetary Policy shock"'
'@parameters beta "discount factor" kappa "Phillips curve slope" sigu sigg rhou rhog psi'
'@observables  P R'
'@model'
'       P = beta*P{+1}+kappa*X;'
'       X = X{+1}-(R-P{+1}-G);'
'       R = psi*P+U;'
'       U = rhou*U{-1} + sigu*EU;'
'       G = rhog*G{-1} + sigg*EG;'
    };

3.2.2. Setting up the BVAR-DSGE model

nlags=4;

constant=false;

mdl=bvar_dsge(dsgemodel,nlags,constant);

3.2.3. Fixed parameters

mdl=set(mdl,'parameters',{'beta',0.96});

3.2.4. Setting up and visualing the priors

priors=struct();

% ___priors on the DSGE parameters___
priors.kappa={0.2,0.5,0.5,'gamma'};
priors.psi={1.5,2,.5,'gamma'};
priors.rhou={0.75,0.75,0.1,'beta'};
priors.rhog={0.75,0.75,0.1,'beta'};
priors.sigu={0.01,0.01,4,'sichisq'};
priors.sigg={0.01,0.01,4,'sichisq'};

% ___prior on the dsge model___
priors.dsge_prior_weight={3,3,1,'gamma'};

plotOpts=struct();
plotOpts.prior_trunc=2e-3;
rdist.plot(priors,plotOpts)

3.2.5. Collecting and transforming the data

d=fetch_fred({'CPALTT01USQ661S','BOGZ1FL072052006Q'});

db=struct();

db.P=log(d(1).series/lag(d(1).series,1));

db.R=d(2).series/100;

3.2.6. Maximizing the posterior

mdlest=estimate(mdl,'priors',priors,'data_demean',true,'data',db,...
    'estim_start_date','1960Q2','estim_end_date','2022Q3');

3.2.7. IRFs of the BVAR-DSGE at the maximized posterior

myirfs_bvar_dsge=irf(mdlest);

3.2.8. IRFs of the DSGE model at the maximized posterior

myirfs_dsge=irf(mdlest.dsge);

3.2.9. IRF comparison

myirfs=ts.concatenator(myirfs_bvar_dsge,myirfs_dsge)

quick_irfs(mdlest.dsge,myirfs,{'P','R'})

3.3. Technical documentation for dsge_var objects