Hm, I see. It still looks strange to me. But nevertheless, from what I can see, theta has to be bigger than the biggest value from your data. If it isn’t the log-prob goes to infinity. You can also see that by plotting the posterior for theta. The problem is that PyMC3 does not know that and the initial value that it sets up ends up being smaller. You can define the initial point yourself using testval.
with pm.Model() as basic_model:
theta = pm.Uniform('theta', lower=0, upper=1, testval=0.54)
y = pm.Uniform('y', lower=0, upper=theta,
observed=[0.49131995252993826, 0.2774397121516236, 0.5381935236905224, 0.19753121107715765])
print(basic_model.check_test_point())
trace = pm.sample(1000, progressbar=True, chains=1, random_seed=1)
See the domain for the posterior of theta:
