Two inequality constraints

Hi Dynare community,

I am trying to solve a perfect foresight path using lmmcp imposing two inequality constraints. In essence, my model looks like this (minimal example)


There are just two variables, a and y. I set a to 1 in the first period. y is supposed to follow a, except when it falls outside the corridor [0.25,0.75], in which case it should be set to the bounds.

The problem works as long as I impose only one of the two bounds, either the upper or the lower bound. However, lmmcp gives an error when I impose both bounds simultaneously. Do you know if there is a way Dynare can handle this problem?

Thanks a lot for your help!

I found a way to do it myself. It does not work using lmmcp (or at least I don’t know how), but it works simply by using max and min operators, i.e. by writing y=max(min(a(+1),0.75),0.25);

May not be true for any model though, as was pointed out in other blog posts using these operators makes the solution algorithms unstable