Min max function help

Hello, I am solving a model with occasional constraints using a trick presented by Garcia and Zangwill (1981). Basically it replaces the lagrangian multipliers by max(0,nu) functions where is appropriate. I tried this trick and it seems to work. To recover the values of the original lagrangian multipliers one must set an extra equation as lambda=max(0,nu). This way when nu=0 you would see that lambda takes values of 0. However, this is not happening in my code :frowning: , so I am not sure if the other part of the code is working :question: .
I wanted to know if someone could let me know what’s going on
Best Regards
Mario
banks_cia_obc.mod (3.89 KB)
solvesss.m (407 Bytes)

As Dynare reports, you cannot use non-differentiable functions with stoch_simul as Taylor approximations in this case are not well defined. You cannot easily get around the problem with occasionally binding constraints in stochastic simulations.

A question concerning Garcia-Zangwill trick, what are the applications of it? In which setup is it currently used?

Any information and hints would be highly appreciated!

It is used in cases where i) you need the complementary slackness condition because the constraint is not always binding and ii) the non-differentiability at the kink is honored by the solution technique. This implies that you can only use it in the perfect foresight context where no Taylor approximation is conducted.

But I thought that inequaility constraints can (trivially) be handled also by Matlab routine fmincon. I cannot see the advantage of Garcia Zangwill “trick” and recasting the problem into one with equalities. Or is the reason that with fmincon computational errors are larger/more probable?

Dynare does not use fmincon with its syntax where you can provide various constraints. You need to enter the equations in Dynare syntax and one way to do this is by entering the complementary slackness condition to transform inequalities to equalities.

Thanks!