Skip to content

Commit 81d682e

Browse files
remove commented code, floor and round moment
1 parent cd9f9d1 commit 81d682e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pymc/distributions/discrete.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,10 @@ class Binomial(Discrete):
114114
def dist(cls, n, p, *args, **kwargs):
115115
n = at.as_tensor_variable(intX(n))
116116
p = at.as_tensor_variable(floatX(p))
117-
# mode = at.cast(tround(n * p), self.dtype)
118117
return super().dist([n, p], **kwargs)
119118

120119
def get_moment(rv, size, n, p):
121-
mean = n * p
120+
mean = at.round(n * p)
122121
if not rv_size_is_none(size):
123122
mean = at.full(size, mean)
124123
return mean
@@ -573,10 +572,10 @@ class Poisson(Discrete):
573572
@classmethod
574573
def dist(cls, mu, *args, **kwargs):
575574
mu = at.as_tensor_variable(floatX(mu))
576-
# mode = intX(at.floor(mu))
577575
return super().dist([mu], *args, **kwargs)
578576

579577
def get_moment(rv, size, mu):
578+
mu = at.floor(mu)
580579
if not rv_size_is_none(size):
581580
mu = at.full(size, mu)
582581
return mu

0 commit comments

Comments
 (0)