Skip to content

Commit 09afc8e

Browse files
aseyboldttwiecki
authored andcommitted
Do not allow observed Bound RVs
1 parent 5d2fe4f commit 09afc8e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pymc3/distributions/distribution.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,11 @@ def __init__(self, distribution, lower=-np.inf, upper=np.inf):
474474
self.upper = upper
475475

476476
def __call__(self, *args, **kwargs):
477+
if 'observed' in kwargs:
478+
raise ValueError('Observed Bound distributions are not allowed. '
479+
'If you want to model truncated data '
480+
'you can use a pm.Potential in combination '
481+
'with the cumulative probability function.')
477482
first, args = args[0], args[1:]
478483

479484
return Bounded(first, self.distribution, self.lower, self.upper,

0 commit comments

Comments
 (0)