I want to have a normal distribution with upper and lower bound. the code:
model = pm.Model()
with model:
x1=pm.math.maximum(pm.math.minimum(pm.Normal('s',mu=0.45,sd=0.15), 0.7),0.4)
x1.name="x1"
step=pm.HamiltonianMC(vars=[x1])
def run(n_samples=100):
`with model:`
trace = pm.sample(n_samples,trace=[x1],step=step)
pm.traceplot(trace,varnames=['x1'])
if __name__=='__main__':
run()
however, there is invalid when using HMC sampler. why? is the code wrong?