Page 1 of 1

Contributions of shocks to endogenous variables

PostPosted: Tue Mar 27, 2007 8:50 am
by pburriel
Dear all,

I would like to calculate the contributions of estimated shocks to endogenous variables.

I have estimated a DSGE model with Bayesian techniques and have retrieved the shocks (my model has 4 shocks), but now I want to calculate the contribution of each shock to the historical growth of an endogenous variable, eg. output, so that I can say how they explain the historical behaviour of this variable.

How can I do that with Dynare?

What I thought is that if I include the 4 shocks as exogenous deterministic shocks and run a forecast, I should get the historical behaviour of this variable. Then if I do this for one shock at a time, I would get the behaviour of output if only that shock was present, and from that I can calculate the contributions.

The problem is that dynare only allows to do this if we have at least one stochastic shock, but then my contributions will be wrong since they will mix the impact of the deterministic exogenous shock and of the stochastic shock.

Should I trick dynare by including a stochastic shock that is irrelevant for the solution? Should I use "simul" instead?
Any other ideas?

Thanks,

Pablo

PostPosted: Tue Mar 27, 2007 2:15 pm
by iacoviel
Hi Pablo,

There might be better ways of doing this, but this should work.

You have to replace the simult file in the dynare directory with the attached file, declare the EPSILON variable as a global variable in your mod file (see first lines of the mod example attached), and simulate your economy using stoch_simul. In the mod file, you have to set the EPSILON variable equal to your estimated innovations (it should have rows equal to the number of periods, and columns equal to the number of shocks). When you simulate your model, if the EPSILON variable exists, the innovations are taken from your estimated shocks. Then, if you want to shut off some shocks, simply set to zero the corresponding columns of the matrix EPSILON.

Let me know if this works. The attached example should give you an idea.

Matteo

Re: Contributions of shocks to endogenous variables

PostPosted: Wed Jun 10, 2015 8:26 am
by jpfeifer
The modern answer would be: use the
Code: Select all
shock_decomposition

command.

Re: Contributions of shocks to endogenous variables

PostPosted: Tue May 16, 2017 4:45 pm
by fernandocorrales
How can I combine deterministic and stochastic shocks with shock_decomposition comand?

Re: Contributions of shocks to endogenous variables

PostPosted: Thu May 18, 2017 9:51 am
by jpfeifer
Unfortunately, that is not yet supported.

Re: Contributions of shocks to endogenous variables

PostPosted: Thu May 18, 2017 9:43 pm
by fernandocorrales
Is there any second best solution? Something like declare the deterministic shock as stochastic and determine some process the simulates a deterministic path?

Thank you for your help

Re: Contributions of shocks to endogenous variables

PostPosted: Mon May 22, 2017 6:03 pm
by jpfeifer
You should be able to make use of the equivalence of deterministic shocks and news shocks at first order. Define news shocks of the required anticipation horizon. Then define an auxiliary endogenous variable equal to that exogenous shock and make it observed. That should do the trick.

Re: Contributions of shocks to endogenous variables

PostPosted: Thu May 25, 2017 2:25 pm
by fernandocorrales
Thank you very much!!!

Re: Contributions of shocks to endogenous variables

PostPosted: Thu May 25, 2017 9:36 pm
by fernandocorrales
Where can I consult the equivalence between deterministic and news shocks at first order?

Re: Contributions of shocks to endogenous variables

PostPosted: Fri May 26, 2017 7:25 am
by jpfeifer
This seems to be a bit like the folk theorem: common knowledge without a proper source to refer to. I can only point you to an example:
Code: Select all
https://github.com/DynareTeam/dynare/blob/master/tests/forecast/Hansen_exo_det_forecast.mod