Skip to content

Commit d846f0c

Browse files
switching to randint instead of rounding
1 parent f0847f8 commit d846f0c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pymc3/distributions/discrete.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,8 @@ def __init__(self, lower, upper, *args, **kwargs):
447447
def _random(self, lower, upper, size=None):
448448
# This way seems to be the only to deal with lower and upper
449449
# as array-like.
450-
samples = stats.uniform.rvs(lower,
451-
upper + 1 - lower - np.finfo(float).eps,
452-
size=size)
453-
return np.floor(samples).astype('int32')
450+
samples = stats.randint.rvs(lower, upper + 1, size=size)
451+
return samples
454452

455453
def random(self, point=None, size=None, repeat=None):
456454
lower, upper = draw_values([self.lower, self.upper], point=point)

0 commit comments

Comments
 (0)