Skip to content

Commit 450a6f7

Browse files
committed
Fix bounds for logcdf of DiscreteUniform
1 parent 831afba commit 450a6f7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pymc3/distributions/discrete.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,10 +1254,10 @@ def logcdf(self, value):
12541254
upper = self.upper
12551255
lower = self.lower
12561256

1257-
return tt.switch(
1258-
tt.lt(upper, lower),
1259-
-np.inf,
1257+
return bound(
12601258
tt.log(tt.minimum(tt.floor(value), upper) - lower + 1) - tt.log(upper - lower + 1),
1259+
lower <= value,
1260+
lower <= upper,
12611261
)
12621262

12631263

0 commit comments

Comments
 (0)