Is there any easy way to get pymc3 to pretend to sample a prior distribution and always return a fixed/predefined value? I just need an option to hard code the values of some linear model parameters. Option 2 in the code below works but it would help me if the pymc3 “pretended” to sample and all the results were in the trace. I tried pm.Normal
with sigma=0
and pm.Uniform
with lower=upper
but no luck so far. Please let me know if you have any suggestions.
with pm.Model():
# Define priors for the unknown parameters
priors = []
for i, pri in enumerate(pri_inputs):
if pri[0] == 1:
priors.append(pm.Uniform("priors_{}".format(i), lower=pri[1], upper=pri[2]) )
elif pri[0] == 2:
priors.append(theano.shared(pri[1], "priors_{}".format(i)))
elif pri[0] == 3:
bounded_N = pm.Bound(pm.Normal, lower=pri[3], upper=pri[4])
priors.append(bounded_N("priors_{}".format(i), mu=pri[1], sigma=pri[2]))
elif pri[0] == 4:
bounded_LogN = pm.Bound(pm.Lognormal, lower=pri[3], upper=pri[4])
priors.append(bounded_LogN("priors_{}".format(i), mu=pri[1], sigma=pri[2]))
priors = tt.stack(priors)[:, None]