# How to write the equation using occbin

**URL:** <https://forum.dynare.org/t/how-to-write-the-equation-using-occbin/26567>\
**Category:** Occbin\
**Created:** [14 October 2024 12:24 UTC](https://forum.dynare.org/t/how-to-write-the-equation-using-occbin/26567 "2024-10-14T12:24:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bellaQIU](https://forum.dynare.org/letter_avatar_proxy/v4/letter/b/ebca7d/32.png) [@bellaQIU](https://forum.dynare.org/u/bellaQIU)\
**Post date:** [14 October 2024 12:24 UTC](https://forum.dynare.org/t/how-to-write-the-equation-using-occbin/26567/1 "2024-10-14T12:24:02Z")

</div>

hi everyone! Thanks to Professor Jpfeifer for patiently answering questions for me every time!

I want to write the following equation in dynare,

```auto
st = fs * st(-1) + fk * kt(-1) + ef
fk = 0.07 if kt(-1)<kbar; 0.05 if kt(-1)>=kbar

```

but I don’t know how to implement it, I think I should use the occbin package to implement it, but I don’t know how to write the code, because I don’t know what the corresponding ‘bind’ and 'relax 'conditions are.

In addition, I uploaded my reference paper.Corresponding to equations 5 and 7 in the article ( page 5-6)  
[england central bank-a tail of three occasionally binding constraints a modelling approach to gdp at risk.pdf](https://forum.dynare.org/uploads/short-url/6EXZnvZnSLsnak036R3r239Rltc.pdf) (427.8 KB)

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [17 October 2024 12:13 UTC](https://forum.dynare.org/t/how-to-write-the-equation-using-occbin/26567/2 "2024-10-17T12:13:52Z")

</div>

Usually, it would be something along the lines of

```auto
var klag...;
parameters k_bar... ;

model;
klag=kt(-1);
[name='LOM', bind = 'KBAR']
st = fs * st(-1) + 0.07 * kt(-1) + ef;
[name='LOM', relax = 'KBAR']
st = fs * st(-1) + 0.05 * kt(-1) + ef;
...
end;

occbin_constraints;
name 'KBAR'; bind klag<k_bar; 
end;

```

---

<div class="post-metadata">

**Author:** ![bellaQIU](https://forum.dynare.org/letter_avatar_proxy/v4/letter/b/ebca7d/32.png) [@bellaQIU](https://forum.dynare.org/u/bellaQIU)\
**Post date:** [22 October 2024 11:42 UTC](https://forum.dynare.org/t/how-to-write-the-equation-using-occbin/26567/3 "2024-10-22T11:42:26Z")

</div>

Thank you very much
