stan-dev / stan

Stan development repository. The master branch contains the current release. The develop branch contains the latest stable development. See the Developer Process Wiki for details.
https://mc-stan.org
BSD 3-Clause "New" or "Revised" License
2.6k stars 370 forks source link

Initialization failed message is misleading when using user defined inits #3288

Closed avehtari closed 1 week ago

avehtari commented 6 months ago

When using the new CmdStanR to provide inits, I happen to have a case where the initial values have finite lp__, but non-finite gradient. The message coming from stan https://github.com/stan-dev/stan/blob/c746ad2f9455d5abc15551e07e7273e1bb3c97ac/src/stan/services/util/initialize.hpp#L217 says "Initialization between (-2, 2) failed after 100 attempts. " which is confusing as fixed init values were used.