I’m trying to implement an ordered probit regression, but I frequently get an error that reads:

Chain 1: Rejecting initial value:
Chain 1: Log probability evaluates to log(0), i.e. negative infinity.
Chain 1: Stan can't start sampling from this initial value.

Sometimes it works, and sometimes not.

With the logistic version, however, I run into no such problems at all. I wonder if there’s a better way to implement the probit version so I don’t run into these problems. The probit and logistic implementations are below:

Just going to reply to my own thread here for anyone else who runs into this problem. Setting the argument init_r to a lower value helps this a lot (init_r sets the range of random values to select initializations from, which defaults to -2 to +2). I still get a few “Rejecting initial value” warnings, but it never fails more than 100 times such that the sampler doesn’t run get to run at all. With simulated data, all the parameters are retrieved as expected.

The ordered probit distribution can be a bit difficult, because the log-probability requires calculating log(Phi(x)), and the Phi() function will underflow to 0 at values lower than -37.5. This means that can be very easy to end up with log(0) if you’re not careful.

As an fyi, Stan also has a built-in ordered_probit function now as well, so you can just write: