Uniform distributions with variable width issue

Hi,
I have a relatively complicated model where one of my parameters has a uniform distribution where the distribution’s upper bound varies according to some of the other parameters (This is because I don’t want some of the other parameters going outside of the range of my data).

Unfortunately in some cases no values of this parameter are possible, in which case the ‘upper’ argument is smaller than the ‘lower’ argument. In this case, I would expect the probability to be 0 (and indeed my likelihood function gives -inf for this parameterization), but it appears PyMc 3 treats this as a delta function and so I always get my results here.

My model looks like this:

And my posterior plot looks like this:

Putting these values into my likelihood function separately returns -inf, so I’m not certain how I’m getting this.

What version of pymc3 are you running? What does model.check_test_point print out? It looks like an initial value problem, but it’s hard to tell from just these two screenshots.

Usually, when you have variables that are constrained or bound in some way, you can enforce the bound either by wrapping the distribution in Bound or adding a Potential.