Simulating around the stochastic steady state in dynare

I have a model of occasionally binding capital requirement constraints for banks. The goal is to simulate the economy around the stochastic steady state. All the dynare documentation that I have been looking at seems to suggest that this is not possible in dynare. Just wanted to make sure if I am misunderstanding it. I do observe that in the dynare output there is a vector called means of the endo variables. I am not sure if these values correspond to the ergodic distribution. Any leads in this regard will be highly appreciated. Thanks a lot.

What do you mean with

? Do you want to compute the decision rules at the stochastic steady state? And when you say stochastic steady state, do you really mean the stochastic steady state (ergodic mean in the absence of shocks) or the ergodic mean?
Note also that Dynare cannot handle occasionally binding constraints in a stochastic context.

Thanks for the reply. Ok so let me be a bit mor specific. So I approximate the occasionally binding constraint with a penalty function and so then dynare can handle this. Now in terms of the model, my bank in the steady state has a 1% capital buffer but in this environment it is completely aware that future shocks may happen. So when I say I want to simulate around the stochastic steady state, I mean starting from this point, I would like to look at irfs following the realization of some bank net worth shocks. A more basic question is I am not sure how to implement this in dynare.

What I mean is I can compute the deterministic SS where capital buffer is = 0. And then then I can look at decision rules, irfs etc in response to some shocks. Here I can simply enter these numbers in the initval block. The problem is I am not sure how to do the same things, starting from the stochastic SS in dyanre. Thanks a lot for the help.

Specifically answering your question, I mean the stochastic SS in the sense that there is no shock today but might occur in the future. Yes, I want to compute the decision rules at the this stochastic steady state. Thanks

Computing decision rules at the stochastic steady state is not supported. But you can easily generate IRFs starting at the stochastic steady state. Code for this is available in the replication files to Born/Pfeifer (2014): “Risk Matters: A comment” at
or more clearly at

Sorry for bumping this old thread, but jpfeifer: I was wondering what would be the best way to implement permanent policy shocks under the stochastic steady state.

I’ve followed your methodology in Basu and Bundick (2017) and Born and Pfeifer (2014), but I’m not quite sure how to implement an expected permanent increase in a policy variable (such as a tax rate) at period t+1. I’ve tried using this approach:

burnin=5000; %periods for convergence

shock_mat_with_zeros=zeros(burnin,M_.exo_nbr); %shocks set to 0 to simulate without uncertainty
out_noshock=simult_(oo_.dr.ys,oo_.dr,shock_mat_with_zeros,options_.order); %simulate series
log_deviations_SS_noshock=out_noshock-oo_.dr.ys*ones(1,burnin+M_.maximum_lag); %subtract steady state to get deviations from steady state
ergodicmean_no_shocks=out_noshock(:,end); %ergodic mean absent of shocks (EMAS) is the final product

shock_mat = zeros(IRF_periods,M_.exo_det_nbr);
shock_mat(25:end,strmatch('tau_Dstar_bar',M_.exo_det_names,'exact'))= 0.0001;

sim_mat = simult_(ergodicmean_no_shocks,oo_.dr,shock_mat,options_.order);

But, as expected, I get a matrices dimensions error with the simult_() command.

I would need to see the full codes.

Thanks jpfeifer. I attach the mod file to this post:

ABK2016_rep.mod (17.7 KB)

The idea is that I would like to implement a permanent increase to either tau_Dstar or tau_K in period 25 (until period 200, the end).

You cannot use varexo_det with simult_.

Ok thanks jpfeifer!
So then I would have to convert the shock process for tau_Dstar or tau_K into a stochastic shock process? And I assume that if I want to implement permanent policy changes, I would have to specify a unit root process?

Furthermore, I assume that if I specify unit root shock processes I would have to specify an analytical solution for the steady state instead of providing initial values for Dynare’s solver?

Yes, you need a unit root process and preferably an analytical steady state. But it may work with starting values (including for the exogenous variables that have a unit root).