Skip to content

Commit

Permalink
Allow n=0 in Binomial logp and logcdf
Browse files Browse the repository at this point in the history
  • Loading branch information
theorashid authored Mar 15, 2022
1 parent 08b6b01 commit 09bddde
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pymc/distributions/discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def logp(value, n, p):
binomln(n, value) + logpow(p, value) + logpow(1 - p, n - value),
)

return check_parameters(res, 0 < n, 0 <= p, p <= 1, msg="n > 0, 0 <= p <= 1")
return check_parameters(res, 0 <= n, 0 <= p, p <= 1, msg="n >= 0, 0 <= p <= 1")

def logcdf(value, n, p):
"""
Expand Down Expand Up @@ -177,10 +177,10 @@ def logcdf(value, n, p):

return check_parameters(
res,
0 < n,
0 <= n,
0 <= p,
p <= 1,
msg="n > 0, 0 <= p <= 1",
msg="n >= 0, 0 <= p <= 1",
)


Expand Down

0 comments on commit 09bddde

Please sign in to comment.