Perfect foresight model with occasionally binding constraint

Dear all

I am in trouble with how to deal with occasionally constraint.

If I think about ZLB and following max function, I understant that I need to use “lmmcp” option and “mcp” to bind the interest rate as non-negative.

However, if I want to think about max function such like following with U,U_p,U_t are all determined as endogenously, I am not sure how to define in dynare code.


If there is shock, we do not know how U_p and U_t will move. I think I cannot bind them by “mcp” because I am not sure which variable will be larger after shock comes.

Like that, if I want to define max function whose both of elements are determined as endogenously, how to deal with this??

Is using “expanded_path” command only way to come over this issue??

I thought following slide p.41 may be the answer to this, but I cannot find original code of this. The latest version of this slide seems to use “mcp” option instead.

It would be much appreciated if you could give me some hints about this.

Thank you.

The problem with max()-operators is that they make many solvers rather unstable in their performance. But sometimes it still works. Have you tried with the max-operator?


there is a more recent version of the slides.

Maybe it could be useful to tag your equations like this?

[ mcp = 'U_p > U_t' ]
U = U_p
[ mcp = 'U_p < U_t' ]
U = U_t

Dear Prof

Thank you for reply

It did work if I set
without any setting about “mcp”.
If I did not input “lmmcp”, it did not work.

But, is it acceptable that I set just “lmmcp” without setting any specific constraint by “mcp”?
It looks a little bit weird as far as I see dynare manual.

Best regards

Can you please provide me with the example?

This attached file is code.
Please try do_file, because I initially solve steady-state by matlab before running dynare code. (5.4 KB)