How to fit multiple independent slopes and intercepts with the GLM module?

In case someone needs this …

Adding these deterministic vars got me the parameters I wanted:

    a = pm.Deterministic('a', tt.stack((model['Intercept'],
                                        model['Intercept']+model['Condition'])))
    b = pm.Deterministic('b', tt.stack((model['X'],
                                        model['X']+model['X:Condition'])))

With Condition being 0 or 1 and X the different levels …
a[0], a[1] are then the intercepts and b[0], b[1] the slopes for each condition.

Since the GLM module sets up everything, we don’t have direct references to the variables as we would if we manually set up the model. But it turns out they can be easily obtained by keying the model object (model in my example above) with the (auto-generated) parameter names. Didn’t know that … very convenient …