Skip to content

Commit

Permalink
first draft of Binomial.icdf issue #6612
Browse files Browse the repository at this point in the history
  • Loading branch information
niknow committed Jun 15, 2024
1 parent 33b24cc commit 0f2cf84
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pymc/distributions/discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ def logcdf(value, n, p):
msg="n >= 0, 0 <= p <= 1",
)

def icdf(value, n, p):
cdf_vals = Binomial.logcdf(pt.arange(0, n), n, p)
return pt.argmax(cdf_vals > pt.log(value))


class BetaBinomial(Discrete):
R"""
Expand Down

0 comments on commit 0f2cf84

Please sign in to comment.