weecology / macroecotools

Tools for Macroecological Analyses Using Python
Other
9 stars 13 forks source link

improve numerical precision of negbin loglik #24

Closed davharris closed 8 years ago

davharris commented 8 years ago

Per my comments in https://github.com/weecology/sad-comparison/issues/93

If I did things correctly (and didn't just re-run the unit tests for the master branch), this should give the same answer when things are numerically stable. The fact that we're not calculating log(1-p) manually anymore should improve the precision when most of the probability mass is at zero.

davharris commented 8 years ago

Oh, maybe there aren't unit tests for this? So passing might not mean much....

davharris commented 8 years ago

Okay, I confirmed manually that I get the same answer both ways.

rueuntal commented 8 years ago

Looks great. Thanks @davharris !