Defining occasionally binding constraints

Hello,

I am trying to use Occbin available on Dynare versions 5.0 and higher, but run into perplexing regime histories.

The constraint that I would like to implement is a collateral constraint of the following type. V_t\geq exp(\zeta_t)(P_{kt}K_t + P_{bt}B_t) where \mu_t is the lagrangian multiplier associated with this constraint and \zeta_t is an exogenous variable meant to capture a shock to the constraint.

I define a variable \Delta_t = V_t - exp(\zeta_t)(P_{kt}K_t + P_{bt}B_t).

There are two regimes, one where the constraint is slack (\mu_t=0, \Delta_t>0) and another where the constraint binds (\mu_t>0, \Delta_t=0).

I write down the regime-specific equations as follows.

[name=‘constraint’,bind = ‘CC’]
Del =0;
[name=‘constraint’,relax = ‘CC’]
mu=0;

I write the occbin_constraint block as follows.

occbin_constraints;
name ‘CC’; bind mu>0; relax Del>0;
end;

When I solve the model and simulate it using “surprise” shocks, I end up getting sometimes negative values of \mu_t or \Delta_t.

Have I incorrectly specified the occbin_constraint block?

I have also tried the following setup:

occbin_constraints;
name ‘CC’; bind Del<=0; relax mu<=0;
end;

but the solution will not converge now.

I would need to see the file.

Thank you for the reply. I was able to fix the issue independently. I was simulating shocks that were too big so there was no convergence to the reference regime within the number of periods I specified.