Skip to content

Commit 7fba532

Browse files
committed
BUG fixed Poisson switch in NegativeBinomial
1 parent 459a1ca commit 7fba532

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
@@ -241,11 +241,9 @@ def logp(self, value):
241241
+ logpow(alpha / (mu + alpha), alpha),
242242
value >= 0, mu > 0, alpha > 0)
243243

244-
# Return Poisson when alpha gets very large. This only
245-
# works because both Poisson and NegativeBinomial use the
246-
# same attribute names.
244+
# Return Poisson when alpha gets very large.
247245
return T.switch(1 * (alpha > 1e10),
248-
Poisson.logp(self, value),
246+
Poisson.dist(self.mu).logp(value),
249247
negbinom)
250248

251249

0 commit comments

Comments
 (0)