Skip to content

ENH/BUG/FAQ: Negative binomial numerical precision at alpha=0 #3863

Open

Description

@josef-pkt

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

  1. josef-pkt commented on Sep 15, 2017

    @josef-pkt
    MemberAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions