Skip to content

Commit

Permalink
- Replace tt.max and tt.min with tt.switch
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoV94 committed Dec 21, 2020
1 parent 64009ec commit 9f9df0e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pymc3/distributions/discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,8 +930,9 @@ def logp(self, value):
- betaln(n - value + 1, bad - n + value + 1)
- betaln(tot + 1, 1)
)
lower = tt.max([0, n - N + k])
upper = tt.min([k, n])
# value in [max(0, n - N + k), min(k, n)]
lower = tt.switch(tt.gt(n - N + k, 0), n - N + k, 0)
upper = tt.switch(tt.lt(k, n), k, n)
return bound(result, lower <= value, value <= upper)


Expand Down

0 comments on commit 9f9df0e

Please sign in to comment.