# Deterministic model with OBC

**URL:** <https://forum.dynare.org/t/deterministic-model-with-obc/20887>\
**Category:** Perfect foresight simulations\
**Created:** [12 August 2022 17:55 UTC](https://forum.dynare.org/t/deterministic-model-with-obc/20887 "2022-08-12T17:55:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![APF75](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/977dab/32.png) [@APF75](https://forum.dynare.org/u/APF75)\
**Post date:** [12 August 2022 17:55 UTC](https://forum.dynare.org/t/deterministic-model-with-obc/20887/1 "2022-08-12T17:55:03Z")

</div>

I’m trying to solve a deterministic small open economy with an occasionally binding endogenous collateral constraint. I’m using the LMMCP option in the perfect foresight solver but I’m not entirely sure if I’ve specified the MCP condition correctly. I’ve defined the ‘collateral constraint gap’ (collgap) as the difference between debt and the value of the collateral constraint. Then I’ve written the MCP condition as  
[mcp = ‘collgap \< 0’]  
mu = 0;  
where mu is the Lagrange multiplier on the collateral constraint. My understanding is that this syntax means “If the collateral constraint gap is negative, set the multiplier = 0, otherwise, set the collateral constraint gap = 0 and let the code determine mu.”  
The code computes the (unconstrained) steady state correctly but then I can’t obtain simulations in which the collateral constraint binds for some time. Either mu is zero (up to rounding error) throughout the simulation horizon or the code does not compute the solution. I don’t understand if I have a problem with the code or with the model (perhaps in the calibration).  
Any help would be much appreciated.  
Thanks  
[SOE\_flowcoll.mod](https://forum.dynare.org/uploads/short-url/AfckBH74vUm1FrpQC7N4Oib9P5S.mod) (3.1 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:** [15 August 2022 08:00 UTC](https://forum.dynare.org/t/deterministic-model-with-obc/20887/2 "2022-08-15T08:00:55Z")

</div>

With a smaller shock, the complementary slackness condition seems to work: Either `mu` or `collgap` is zero.  
[SOE\_flowcoll.mod](https://forum.dynare.org/uploads/short-url/30scgfWtDkbrrher1BD7Z4MCrpF.mod) (3.2 KB)

---

<div class="post-metadata">

**Author:** ![APF75](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/977dab/32.png) [@APF75](https://forum.dynare.org/u/APF75)\
**Post date:** [16 August 2022 16:49 UTC](https://forum.dynare.org/t/deterministic-model-with-obc/20887/3 "2022-08-16T16:49:31Z")

</div>

Thanks. One issue is that the multiplier is negative the period in which it is non-zero, which I’m guessing has to do with the way in which the complementary slackness condition is written. However, just changing the collateral gap definition creates problems with the solution. The other issue is that increasing either the size of the shock or the persistence a tiny bit also creates problems with the solution.

---

<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 August 2022 06:45 UTC](https://forum.dynare.org/t/deterministic-model-with-obc/20887/4 "2022-08-17T06:45:24Z")

</div>

Have you defined the multiplier and the constraint correctly for it to be zero? Put differently, should it be

```auto
1 - mu

```

or

```auto
1+mu

```

in the Euler equation?

---

<div class="post-metadata">

**Author:** ![APF75](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/977dab/32.png) [@APF75](https://forum.dynare.org/u/APF75)\
**Post date:** [17 August 2022 08:38 UTC](https://forum.dynare.org/t/deterministic-model-with-obc/20887/5 "2022-08-17T08:38:03Z")

</div>

I think it should be 1-mu.

---

<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:** [18 August 2022 06:42 UTC](https://forum.dynare.org/t/deterministic-model-with-obc/20887/6 "2022-08-18T06:42:42Z")

</div>

You should check again. A positive sign for the Lagrange multiplier attached to an inequality constraint requires you to write the constraint as g(x)\leq0
