1

I am building a PyMC model in which I have a multidimensional Normal distributed parameter, as follows:

motor_betas = pm.Normal("motor_beta", mu=0, sigma=1/2, size=9)

These betas are later used in a linear regression model. I want to restrict the joint combinations of parameter values such that beta1 > beta2 > ... > beta9. How would I approach this with PyMC?

Thank you for giving your time to help me with this.

kakben
  • 119
  • 8
  • Add `transform=pm.transforms.ordered` to `pm.Normal` based on this [discussion](https://discourse.pymc.io/t/constraining-order-in-a-mixture-model/7842). But that's for the opposite order you want. Doesn't seem like you can specify the reverse, but you might be able to get the correct order from the output. – m13op22 Mar 03 '23 at 20:47
  • I think the ordered transform is based on [this answer](https://stackoverflow.com/questions/43113413/pymc3-how-to-defined-an-ordered-vector-of-parameters). You could modify this to reverse the order. – m13op22 Mar 03 '23 at 20:49
  • 1
    Thanks, I am looking into it. I was able to use transform=pm.transforms.ordered by using a negative of my betas in the regression, because they were centered at 0 anyway. But I am getting some other strange outcomes, so will report back later. – kakben Mar 05 '23 at 22:37

0 Answers0