Skip to content

Commit

Permalink
Update distribution.py
Browse files Browse the repository at this point in the history
poisson_exact() function for removal cogent3#1734
  • Loading branch information
Tesla686 committed Mar 13, 2024
1 parent f457ca2 commit aff736e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/cogent3/maths/stats/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
ndtri,
)

from cogent3.util import warning as c3warn

# ndtri import b/c it should be available via this module

Expand Down Expand Up @@ -59,11 +60,9 @@ def poisson_low(successes, mean):
return pdtr(successes, mean)


def poisson_exact(successes, mean):
"""Returns Poisson probablity for exactly Pr(X=successes).
Formula is e^-(mean) * mean^(successes) / (successes)!
"""
@c3warn.deprecated_callable(version="2024.9", reason="use scipy.stats.poisson.pmf()instead", is_discontinued=True)
def poisson_exact(successes, mean): # pragma: no cover
"""being removed"""
if successes == 0:
return pdtr(0, mean)
elif successes < mean: # use left tail
Expand Down

0 comments on commit aff736e

Please sign in to comment.