Make two random variables equal

I guess I would try to avoid defining a model that way. If you want y to be a function of X, link them directly via regression. Something like y = pm.Normal('y', mu = hyper_y_mu + beta_y * X, sigma = hyper_y_sigma).

My advice would be that any time you run into a situation where you want to impose some kind of constraint, instead think about how you can re-write the problem to directly define what you want. Reach for the hard constraints only in the cases where it’s really absolutely impossible to just directly write down what you want.

1 Like