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
{{ message }}
Repository navigation
ENH/BUG/FAQ: Negative binomial numerical precision at alpha=0 #3863
There is a problem with score and hessian if alpha in NegativeBinomial is close to zero.
example in #3811 using cpunish dataset.
AFAICS, alpha = 0 only produces nans in score and hessian. The problem is that computations are done in terms of 1 / alpha and alpha**(-2) and alpha**(-3)
However, some terms like those with digamma and log will be difficult to check for canceling terms.
It looks to me right now that NegativeBinomial does not work correctly or robustly in the neighborhood of alpha=0, i.e. close to Poisson.
Activity
josef-pkt commentedon Sep 15, 2017
see scipy/scipy#7858 for a numerical solution for the log gamma expressions in terms of logbeta
Winkelmann count data book 2008 has also a discussion on page 22
in a paper (? for score tests) they used Stirling's formula for the expansion around a=0 to get gradient at a=0, AFAIR.