Debug help

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

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.

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