Error on bridgesampling

I’m fitting Negative Binomial in Bayesian frame work. I want to check the sensitivity of priors in the dispersion parameters. I used two different priors and compared it using the Bayes Factor, and I chose bridgesampling. Unfortunately, I got the following error for many times. I read here about the related error, and they recommend increasing the number of iteration. I tried the number of iteration with 30,000, but I got the same.
FYI – My number of observations is around 6,000.

Error in jj[2,]: Subscript out of bounds
In addition: Warning messages:
1: Infinite value in iterative scheme, returning NA.
    Try rerunning with more samples. 
2: logml could not be estimated within maxiter, rerunning with adjusted starting value. 
     Estimate might be more variable than usual.

1- Would you please recommend something to solve it? Or
2 - Do we have other packages or techniques use to compare the model with different priors?


1 Like

Can you post


after that happens?

Can’t tell if this is a rstan and / or a bridgesampling issue. @Henrik_Singmann ?

Hmm, failing with an error should not happen. Are you using the latest version of our package (1.0-0)?

In any case, I suspect the true underlying issue is, as indicated, a too low number of samples. If you have a rather high number of parameters, than you just need a lot of samples. I would suggest something like 100,000 as a starting point. However, if possible, you can still post a reproducible example to
In case it fails, it should do so with NA and not with an error.

I’ve actually run into this with models before, I’ve got an example with data that I’ll put up on the issue tracker

Thanks so much for your reproducible example. Was indeed a bug. The development version now correctly returns NA in this case.