I want to run stochastic simulations for a model displaying an occasionally binding borrowing constraint. I have successfully used the runsim_cgg template in the most updated version of the OccBin toolkit for the cgg/cgg_zlb model. However, my simulations look strange.

First, in some periods, total debt is above the borrowing constraint even after dropping the first several Monte Carlo simulations. (To give a context on this issue, the Lagrange multiplier is negative in the first few simulations but becomes positive after a sufficiently high number of random draws.)

Second, the variance of consumption and hours worked is lower in the economy displaying the borrowing constraint compared to the frictionless economy. On a related note, the average of several endogenous variables differs across the constrained and unconstrained economies, even though the steady state is the same in both, as the borrowing constraint does not bind in the steady state.

Third, as a consequence, welfare is higher in the constrained economy than in the unconstrained one, which is an obviously incorrect result.

The IRFs produced by the built-in OccBin package in Dynare look correct, though. But it seems I do need to use the toolkit to run Monte Carlo simulations.

Thank you for the reply. I want to perform Monte Carlo simulations in the constrained and unconstrained models to make welfare comparisons. I checked that welfare is indeed lower in the constrained economy if I compute it using the IRFs to an MIT shock produced by the built-in OccBin package in Dynare. But I wanted to simulate an â€śactualâ€ť economy by drawing random shocks using Monte Carlo simulations, as we can do with the stoch_simul command.

At first, I was using the OccBin built-in package in Dynare, but I realized that stochastic simulations are performed for the unconstrained model only.

Thank you for the reference. The simulations seem to work fine. A last question: It seems I canâ€™t shock the economy with all the exogenous shocks at once, but I can just shock the economy with one exogenous shock in each simulation. Is that right?

Isnâ€™t it possible to recover an output similar to oo_.endo_simul in which all the exogenous shocks hit the economy simultaneously?

No, you can fully specify shock sequences for all exogenous variables in the shocks(surprise)-block. The results will be in oo_.occbin.simul.piecewise. See the manual.

Perfect. I found how to include multiple shocks in the perfect foresight setup:

shocks;
var e;
periods 1;
values 0.5;
var u;
periods 4:5;
values 0;
var v;
periods 4:5 6 7:9;
values 1 1.1 0.9;
var w;
periods 1 2;
values (1+p) (exp(z));
end;