In my hierarchical modeling, I have found that I often want to select some parameters for a particular output based on values of predictors.
For example, cell cultures grown at a high temperature get one parameter, versus those grown at a low temperature, which get another.
I copied this approach from the method used by @junpenglao in the schizophrenia example case.
It occurs to me that this is probably a common thing to do using a probabilistic programming language, so it might be worth having a kind of expression in PyMC that supports it directly.
Right now, when I do this, I end up with cumbersome expressions I make by vectorizing
index to do look up and then extracting a scalar random variable from a vector-shaped random variable. In one case, even worse, I had to hand build a theano vector out of some random variables and some constants. What I write is hard to read, error-prone, and a bear to debug.
Is there a cleaner way of doing this that I just don’t know? Or would it be worth adding some kind of construct to the language to support it?
Also, are there other examples of this than the schizophrenia one?