Uncertainty shock implementations

I am new to uncertainty in Dynare and would appreciate any contribution to improve my understanding. I am trying to simulate crude oil price uncertainty shocks and got the following spec:



var epsPOstar; stderr 0.01;
var  epssOstar; stderr 0.1;

Simul order 3

  1. I see authors (including the seminal Basu_Bundick_2017) using a scale parameter and set stderr to 1. What’s wrong if I proceed as above. I can increase the value as much as I want and see the results. I guess dynare 5 made that possible?
  2. The IRFs show the shocks to both crude oil price (epsPOstar) and uncertainty (epssOstar). To simulate a shock in absence of uncertainty I drop the related variables and parameters from the eq. is there any better way to do it?
  3. How can I proceed to simulate only crude oil price uncertainty (i.e turning epsPOstar off)? Thanks.

any clue @punnoosejacob @jpfeifer ?

  1. I am not sure I understand the question. For sigOstar*epsPOstar, sigOstarss only gives you the standard deviation if epsPOstar has standard deviation 1. As a sidenote, see point 1 of
  1. To shut off uncertainty, you can simply set its standard deviation to 0.
  2. What do you mean with “turning epsPOstar off”? You usually just want to keep it to 0 on average in GIRFs as in DSGE_mod/Basu_Bundick_2017.mod at master · JohannesPfeifer/DSGE_mod · GitHub

Your code is too complex to quickly check. Did you try whether it’s a matter of parameterization?

The counter intuitive IRFs show up when I use your code.
as you can see in the attached, I used the exact same two files as above, but did the follwing two minor changes
var epsPOstar; stderr 0.1;
var epssOstar; stderr 0.1;

epssOstar is the uncertainty

2- I dropped all your code and kept only stock simul.
See the second IRF (epssOstar).
(please run the m file first). There is something I’m not getting right. Thanks.

Model5_external_ext3_N.mod (9.4 KB)
Model5_external_ext3.m (4.8 KB)

@jpfeifer given that difference, do you think the issue comes from my handling of your code ?(the parameters checks were not helpful).
You said sigOstarss only gives you the standard deviation if epsPOstar has standard deviation 1. In my version (see early attached) I set stdvs to 0.1, and but I still get IRFs that make sens to me (i.e the uncertainty shock is contractionary).

  1. What do you mean with
  1. My code implemented GIRFs at the stochastic steady state. stoch_simul will result in GIRFs sampling from the ergodic distribution. That is a conceptual difference.
  2. Regarding the standard deviations. As long as the implementation is consistent, it should not make a difference. But my hunch is that the different code versions imply very different volatilities and therefore IRFs.

Thanks @jpfeifer. When I use your code the GIRF is quite opposite to mine in term of shock transmission. Which I do not understand. When using mine, the uncertainty shock is contractionary as expected. Y,C,…Welfare are negatively affected. But with yours, it’s completely opposite (as you could see, uncertainty shock is expansionary and transmit positively to Y,C,…Welfare). I don’t get this difference. I want to use your code, but the GIRFs are hard to interpret.

Where does the difference come from? GIRFs considered at a different point? Or different shock size specifications?

Thanks so much for always being there. I will take a close look.

Hi @jpfeifer a question regarding the model estimation. When the estimation runs neatly, with no error, no issues. But only with a head "You did not declare endogenous variables after the estimation/calib_smoother command." do you think there is still some issues to address ? I read throughout the forum; people getting similar error usually have error messages and their estimation interrupted.

As you found code complex I do not find useful to attach it again. But below are the key parts and the attached data (only 1 variable). Thanks

Var Infl_obs ;
Model Infl_obs=Infl;
steady_state_model Infl_obs=Infl;
varobs Infl_obs;


estimation(datafile = est_data, xls_sheet=est_data,xls_range=A1:A129, mh_replic=2000,diffuse_filter);

stoch_simul(order = 1, pruning, irf=25) …;

est_data.xls (30.5 KB)


is a warning shown by Dynare if there are more than 20 variables, because in that case, smoother computations can take a long time. Dynare will then ask you for a selection. But that does not indicate any problems with actual computations.

Thanks a lot ! a couple of concerns
1- I placed stoch_simul right below the estimation. From what I read in the forum this will use the updated parameters to plot the IRF. Does it also apply to order 2 (welfare analysis) and order 3 ( uncertainty, using the undemeaned data as you suggested) . I noticed that when I try welfare analysis I get very high values for welfare gain ( >100%). This maybe comes from the fact that all shocks are turned on.Turning some of them off will not run as the number of shocks becomes < number observed variables.

2- Is there any way to run the estimation once, as it is time consuming, and use the updated parameters next time I do some policy scenarios (tweaking one non-estimated parameter) ? My initial thought was to

  • First run estimation
  • Then pull the posteriors
  • Change the parameters in the mod file
  • And close estimation. (% estimation (…))
    That way, I will move faster with the policy scenarios, welfare analysis and uncertainty, using the parameters - which deflect the observed data.