Thanks for the quick answer!
I’ve checked Bounded but it doesn’t seem to work as I expect. Consider the following example:
with pm.Model() as model:
x = pm.Normal('x', mu=5, sigma=1)
y = pm.Normal('y', mu=7, sigma=1)
BoundedDeterministic = pm.Bound(pm.Deterministic, lower=6.0, upper=7.0)
z = BoundedDeterministic('z', x+y)
I would like to impose a constraint on
z (in this case that the values are between 6.0 and 7.0) and see how it affects the variables
y. I expect that the sampler gives higher probability to the samples that satisfy the constraint, and disregards the samples that don’t.
Unfortunately, the snippet above doesn’t work. I get an error message saying that
pm.Deterministic is not a subclass of distribution. Do you know what class I should use for this case?