In addition, I also tried another model without the use of shape parameter:
with model 2:
a = pm.HalfNormal('a', 6)
b = pm.HalfNormal('b', 30)
f = pm.Uniform('f', lower = 0, upper = 1)
Y_max = X_shared * a + b
model_y = pm.Normal('Model_Y', mu= Y_max*f, sd=Y_err_shared, observed=Y_obs)
I tested both model 1 and 2 on generated data, which I know a = 3 is correct.
The previous Model 1 can return quite close answers a ~ 3; however, the model 2 always return a= 5 ~ 6.
I don’t really understand why the model 2 have such different results, but I guess it is probably related to the use of shape parameter.