|
5 | 5 | import theano.tensor as tt
|
6 | 6 | from scipy import stats
|
7 | 7 |
|
8 |
| -from .dist_math import bound, factln, binomln, betaln, logpow |
| 8 | +from .dist_math import bound, bound_elemwise, factln, binomln, betaln, logpow |
9 | 9 | from .distribution import Discrete, draw_values, generate_samples
|
10 | 10 |
|
11 | 11 | __all__ = ['Binomial', 'BetaBinomial', 'Bernoulli', 'Poisson',
|
@@ -348,8 +348,8 @@ def random(self, point=None, size=None, repeat=None):
|
348 | 348 | def logp(self, value):
|
349 | 349 | upper = self.upper
|
350 | 350 | lower = self.lower
|
351 |
| - return bound(-tt.log(upper - lower + 1), |
352 |
| - lower <= value, value <= upper) |
| 351 | + return bound_elemwise(-tt.log(upper - lower + 1) * tt.ones_like(value), |
| 352 | + lower <= value, value <= upper) |
353 | 353 |
|
354 | 354 |
|
355 | 355 | class Categorical(Discrete):
|
@@ -454,7 +454,7 @@ class ZeroInflatedPoisson(Discrete):
|
454 | 454 | Often used to model the number of events occurring in a fixed period
|
455 | 455 | of time when the times at which events occur are independent.
|
456 | 456 |
|
457 |
| - .. math:: |
| 457 | + .. math:: |
458 | 458 |
|
459 | 459 | f(x \mid \theta, \psi) = \left\{ \begin{array}{l}
|
460 | 460 | (1-\psi) + \psi e^{-\theta}, \text{if } x = 0 \\
|
@@ -503,7 +503,7 @@ class ZeroInflatedNegativeBinomial(Discrete):
|
503 | 503 |
|
504 | 504 | The Zero-inflated version of the Negative Binomial (NB).
|
505 | 505 | The NB distribution describes a Poisson random variable
|
506 |
| - whose rate parameter is gamma distributed. |
| 506 | + whose rate parameter is gamma distributed. |
507 | 507 |
|
508 | 508 | .. math::
|
509 | 509 |
|
|
0 commit comments