Different model equations for an endogenous variable depending on the level of another endogenous variable

Dear all,

I specified two equations for a specific endogenous variable (Q) of my DSGE model. I would like the variable to evolve according to the first equation if another endogenous variable (S) is greater or equal to a threshold parameter (k). It should evolve according to the second equation if the other endogenous variable is strictly smaller than the threshold parameter.

I thought about two implementation strategies.

1.) Using the Occbin Toolbox and implement the setting in a similar way to a ZLB case. Would this be feasible?
2.) Specifying the model equation as below:

Q_{t} = (S_{t} \geq k) * (Equation 1) + (S_{t} < k) * (Equation 2)

Is there any way to tell Dynare to evaluate such an expression, (S_{t} \geq k) , either to 0 or 1?

Thank you!


Both should in principle work. Dynare does allow for binary operators. See Section “4.3.2 Operators” of the manual.