# Application of occasionally binding constraint

Hello everyone,
I want to add an occasionally binding constraint in household’s optimization problem, which is

``````m_f < m* p_h * y /ex_r
``````

By solving it I get one FOC (marginal utility of m_f, equation 10):

``````((c^alpha *(delta* m_h^b+(1-delta)*(m_f)^b)^((1-alpha)/b))^(-sigma))* c^alpha *((1-alpha)/b)*(delta*m_h^b+(1-delta)*(m_f)^b)^((1-alpha)/b-1) * (1-delta) * b * (m_f)^(b-1)- lambda * ex_r + beta* ex_r(+1) * lambda(+1) / pie_f(+1) =lambda_bind ;

``````

where `lambda_mind` is the constraint multiplicator
and also a slackness condition :

``````lambda_bind * ( m_f - m*p_h * y/ex_r) =0
``````

How can I apply these equations in dynare 5.0 ?
I attach the code below.
util_a.mod (6.3 KB)

Thank you so much.

Please try to keep your discussion in one place. This seems to be a follow-up on Occbin simulation with dynare 5.0 - #2 by Max1

This begs the question what exactly you are trying to do. It seems you want to do stochastic simulations in your model using Occbin, i.e. employ a piecewise linear solution. In the other post you state that

Does that mean the model is non-stationary, i.e. there is the level of the exchange rate in the model and it has a trend? Or is it formulated in growth rates of the exchange rate and the growth rate is stationary? Also, Occbin requires you to have a baseline regime to which the model returns in the absence of shocks. Which regime is this in your model? The one where the constraint is binding? Or the one where the current constraint is nonbinding?

1 Like

Dear professor, thank you for your reply.
Sorry for overloading with my questions, I’ve tried another specification of the model, that’s why posted again.

This model is formulated in a growth rate of the exchange rate and thus is stationary. Occbin’s baseline regime is the one where the constraint is not binding, i.e. lambda_bind is equal to zero.

For the details, I can give the equations of the household’s problem: (For simplicity I assumed in the constraint that m_f (the amount of goods that can be bought by foreign currency should be less than equal to some share (say half) of GDP)

Thank you so much.