# Debug help

**URL:** <https://discourse.mc-stan.org/t/debug-help/2565>\
**Category:** Modeling\
**Created:** [November 21, 2017, 5:46pm UTC](https://discourse.mc-stan.org/t/debug-help/2565 "2017-11-21T17:46:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dirk\_Nachbar](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/dirk_nachbar/32/4271_2.png) [@Dirk\_Nachbar](https://discourse.mc-stan.org/u/Dirk_Nachbar)\
**Post date:** [November 21, 2017, 5:46pm UTC](https://discourse.mc-stan.org/t/debug-help/2565/1 "2017-11-21T17:46:17Z")

</div>

I have a very complex model with 100+ lines of code (which I cannot share - sorry), I do get this error below

“Rejecting initial value:”  
[299] " Gradient evaluated at the initial value is not finite."  
[300] " Stan can’t start sampling from this initial value."  
[301] "Initialization between (-2, 2) failed after 100 attempts. "

I cannot see any parameters that are bound between -2 and 2. Is there a way for stan to be more explicit about the affected parameter?

Dirk

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [November 21, 2017, 6:06pm UTC](https://discourse.mc-stan.org/t/debug-help/2565/2 "2017-11-21T18:06:20Z")

</div>

The -2 to 2 thing is on the unconstrained space; specify the `init_r` argument to some value less than 2 to use a smaller window. But, no, Stan cannot be made more explicit about the affected parameter because the initialization problem is related to the joint distribution.

---

<div class="post-metadata">

**Author:** ![Bob\_Carpenter](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bob_carpenter/32/9230_2.png) [@Bob\_Carpenter](https://discourse.mc-stan.org/u/Bob_Carpenter)\
**Post date:** [November 29, 2017, 9:26pm UTC](https://discourse.mc-stan.org/t/debug-help/2565/3 "2017-11-29T21:26:02Z")

</div>

You should be getting error messages that tell you what got rejected if you’re using a recent version of Stan.
