# Model with collateral constraints

**URL:** <https://forum.dynare.org/t/model-with-collateral-constraints/18630>\
**Category:** Macroeconomic Model Data Base\
**Created:** [2 August 2021 11:37 UTC](https://forum.dynare.org/t/model-with-collateral-constraints/18630 "2021-08-02T11:37:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![luishb](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/aeb1de/32.png) [@luishb](https://forum.dynare.org/u/luishb)\
**Post date:** [2 August 2021 11:37 UTC](https://forum.dynare.org/t/model-with-collateral-constraints/18630/1 "2021-08-02T11:37:01Z")

</div>

Hello everyone!

I am trying to construct a model close to Iacoviello and Neri (2010) but including also a collateral constraint for capital goods purchases. It would be also similar to the model of Gerali et al. (2010) but without credit supply rigidities. When I use the commands “check” and “steady” everything seems correct and I am able to perform stochastic simulation (resulting in strange IRFs) but when it comes to estimation the Blanchard Kahn conditions are not satisfied.  
I have checked the timing and the parameters for stochastic simulation are calibrated at the prior mean. At this point, I really do not understand where this problem is coming from. I would really appreciate any insight.

[estimationDATA.mat](https://forum.dynare.org/uploads/short-url/n9foBk0XyTZy1x6Givxu7Pnqg0U.mat) (16.1 KB)  
[macroprudential.mod](https://forum.dynare.org/uploads/short-url/70Dkc1uoGCwfSO7qWfcyzZD5ohx.mod) (13.3 KB)  
[macroprudential\_steadystate.m](https://forum.dynare.org/uploads/short-url/3AIdx0LW5Jf7wmPgGteOokXTo1B.m) (6.9 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:** [2 August 2021 12:21 UTC](https://forum.dynare.org/t/model-with-collateral-constraints/18630/2 "2021-08-02T12:21:32Z")

</div>

You are missing the Excel file.

---

<div class="post-metadata">

**Author:** ![luishb](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/aeb1de/32.png) [@luishb](https://forum.dynare.org/u/luishb)\
**Post date:** [2 August 2021 14:11 UTC](https://forum.dynare.org/t/model-with-collateral-constraints/18630/3 "2021-08-02T14:11:14Z")

</div>

So sorry, I have edited the post and include the mat file instead of the m file.  
Thank you very much for your response.

---

<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:** [2 August 2021 14:13 UTC](https://forum.dynare.org/t/model-with-collateral-constraints/18630/4 "2021-08-02T14:13:18Z")

</div>

Why do you provide explicit starting values? You should simply use the calibration that works to start mode-finding.

---

<div class="post-metadata">

**Author:** ![luishb](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/aeb1de/32.png) [@luishb](https://forum.dynare.org/u/luishb)\
**Post date:** [2 August 2021 16:56 UTC](https://forum.dynare.org/t/model-with-collateral-constraints/18630/5 "2021-08-02T16:56:18Z")

</div>

I have deleted the starting values as you suggest. Now, I get the error:  
`initial_estimation_checks:: The forecast error variance in the multivariate Kalman filter became singular.`

I have one more shock than observables and as far I understand there is not any single equation that imply an exact linear combination of an observable. Anyway, I reduced the number of observables and the mode routine 1 is able to start but it stops after few iterations at a huge (negative) log posterior.  
Moreover if I run the identification(advanced=1) command I see that the collinearity across most of the parameter is close to 1.

I guess that all these things are signs that there is something wrong in the model but I do not know where to look at because at this point every equation seems correct to me. I am sure that any clue from you will be very helpful.

Thank you so much in advanced.

The updated .mod file:  
[macroprudential.mod](https://forum.dynare.org/uploads/short-url/6fzyChOcRBBsSlKrG6xDEea5IDn.mod) (13.3 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:** [3 August 2021 15:45 UTC](https://forum.dynare.org/t/model-with-collateral-constraints/18630/6 "2021-08-03T15:45:17Z")

</div>

Mode-finding for such a large model takes time and a lot of iterations. But you limited the number of iterations. With `mode_compute=5`, there was a significant improvement, but still the maximum number of iterations was reached:  
[macroprudential\_mode.mat](https://forum.dynare.org/uploads/short-url/tgSNnsu4QcoAUGMA6PbS0e8mpYb.mat) (1012 Bytes)
