Brms: cumulative model\ rejecting initial values issue

Before moving into full model, I tried to run following simple model:
m1<-brm(Response ~ Avglength,
data = sdf,
family = cumulative(link=“probit”, threshold=“flexible”),
chains=2,
iter=100,
cores=2,
seed = 1,
init_r=0)
Every time i run the model, i got the same issue which was: rejecting initials.Log probability evaluates to log(0), i.e. negative infinity.Stan can’t start sampling from this initial value. I tried with and without init_r=0, but got the same issue.
My response has 11 levels and independent variable was length of fish (numeric value).

Does using init_r=0 and init=0 achieve the same thing? Setting init_r is about the range of randomly generated inits…

Yes. Gives the same result.

Both give following error:
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.
[1] “Error in sampler$call_sampler(args_list[[i]]) : Initialization failed.”
[1] “error occurred during calling the sampler; sampling not done”

Maybe @Solomon has some suggestions, as I think he might make frequent use of these types of models in brms

1 Like

My first step would be to move away from the default priors.

Hi Solomon:

This was my model:
m2<-brm(Response ~1+Avglength,
data = sdf1,
family = cumulative(link=“probit”, threshold=“flexible”),
prior = c(prior(normal(0,2), class=Intercept),
prior(normal(0,10), class=b)),
chains=2,
iter=1000,
init_r=2)

where Response has satisfaction level from 0 to 10 and Avglength is the size of fish individual angler caught. Error are below:

Chain 1: Stan can’t start sampling from this initial value.
Chain 1:
Chain 1: Initialization between (-2, 2) failed after 100 attempts.
Chain 1: Try specifying initial values, reducing ranges of constrained values, or reparameterizing the model.
[1] “Error in sampler$call_sampler(args_list[[i]]) : Initialization failed.”
[1] “error occurred during calling the sampler; sampling not done”

You might spend some time thinking more about setting individual priors for the individual thresholds. Also, normal(0, 2) is really broad on the probit scale.

As you suggested in your blog, I calculated the right-handed thresholds and use that information to assign the individual prior, see below. Still I got the same result. Are there an other things to consider it?

fit1 ← brm(
data = cdata3,
family = cumulative(probit),
Response ~ 1,
prior = c(prior(normal(-1.34, 1), class = Intercept, coef = 1),
prior(normal(-0.91, 1), class = Intercept, coef = 2),
prior(normal(-0.60, 1), class = Intercept, coef = 3),
prior(normal(-0.35, 1), class = Intercept, coef = 4),
prior(normal(-0.11, 1), class = Intercept, coef = 5),
prior(normal(0.11, 1), class = Intercept, coef = 6),
prior(normal(0.35, 1), class = Intercept, coef = 7),
prior(normal(0.60, 1), class = Intercept, coef = 8),
prior(normal(0.91, 1), class = Intercept, coef = 9),
prior(normal(1.34, 1), class = Intercept, coef = 10)),
cores = 2,
chains=1,
iter=100)

Error: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.

what could be issues here?

Hmmm. Maybe try setting init_r = 0.2.

Changing the priors doesn’t effect the inits, so fiddling with the priors, while definitely a good idea, won’t tend to resolve this issue.