You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Binomial (LC)CDF functions are defined using the inc_beta function, however this can underflow to 0 for large inputs. By using the relationship with the Gauss Hypergeometric function, we can calculate inc_beta on the log scale: https://stats.stackexchange.com/a/148700
But I also only brought this up for the beta/binomial CDFs (numerical stability for copulas), so let me know if there's a better or more robust approach that avoids all of these headaches!
Activity
spinkney commentedon Jul 14, 2022
Be careful with this as it does lose a lot of precision for very small
xvalues. See discussion at https://bugs.r-project.org/show_bug.cgi?id=16332#c7. We'll have to branch across different values ofx.spinkney commentedon Jul 14, 2022
Umm, when I tested this in R it wasn't good but boost's implementation in c++ is good in a wide range of
xvalues.andrjohns commentedon Jul 15, 2022
Hmm, well it's not the easy fix I was hoping for, but it's a start!
Once we've got the
2F1in I'll start investigating where the underflow could be coming fromandrjohns commentedon Jul 15, 2022
But I also only brought this up for the beta/binomial CDFs (numerical stability for copulas), so let me know if there's a better or more robust approach that avoids all of these headaches!
spinkney commentedon Jul 17, 2022
I think what you have will work! Looking forward to more stable cdfs!
avehtari commentedon Oct 8, 2026
#3433 improves stability, but below
DBL_MINlog_inc_betais still needed