# The Jacobian contains NaNs

**URL:** <https://forum.dynare.org/t/the-jacobian-contains-nans/5301>\
**Category:** Stochastic simulations\
**Created:** [29 February 2016 11:37 UTC](https://forum.dynare.org/t/the-jacobian-contains-nans/5301 "2016-02-29T11:37:38Z")\
**Posts on this page:** 1\
**Showing post:** 8

<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:** [5 March 2016 06:16 UTC](https://forum.dynare.org/t/the-jacobian-contains-nans/5301/8 "2016-03-05T06:16:45Z")

</div>

Using a penalty function to embed a non-negativity constraint can be done. You might want to take a look at e.g. Kim/Kollmann/Kim (2010) Solving the incomplete market model with aggregate uncertainty using a perturbation method) or [dynare.org/wp-repo/dynarewp027.pdf](http://www.dynare.org/wp-repo/dynarewp027.pdf)

---

_[View the full topic](https://forum.dynare.org/t/the-jacobian-contains-nans/5301)._
