Why do I get: "Chain 1: Rejecting initial value: Log probability evaluates to log(0), i.e. negative infinity."?

I’m running the brms package in R, and I’m trying to do an ordinal regression on the following data:

correct: proportion correct on a arithmetic task 0-1,
for example: 0.8421053, 0.8800000, 0.9130435, 0.9000000, 0.89285

performance_rating: 1-9,
for example: 5, 7, 6, 6, 6, 6, 3, 3, 3, 3, 8, 7, 4, 3, 3, 2, 6

condition: Control or Sleep Deprived.

This is my code.

fit_aritmetic_model_1 <- brm(
  formula = performance_rating ~ 1 + correct + condition,
  data = d_arithmetic,
  family = cumulative("probit"),
  control = list(adapt_delta = 0.99), 
  seed = 2023
)

The problem is that I’m getting a lot of these warnings:

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.

After a couple of iterations, it finds values that work, and it seems to run well (but I’m no expert, so maybe I shouldn’t trust the results). Nevertheless, I want to learn how to avoid this problem.

How do I adjust my code to get rid of it?

Howdy! For starters you could try adding init = 0 to the brm call.

1 Like

Thank you, that seems to have done the trick. Just so I understand, this changes the starting location for the MCMC to 0 instead of picking a random value?

Also, does setting init to 0 change the outcome of the results in any way? That is, can I trust these results as well as if init would be “random”?

If you get these warnings a few times at the start of sampling but then everything works out fine, Stan just has a hard time finding initial values that work and you can probably ignore them.
I think 2 is the default for init so you can try smaller values before setting it to 0 to improve efficiency.

1 Like