Shape of Trace: number of columns depends on observations

Hey there!
I think your model is behaving as expected: the deterministic variable is computed over the 2 given values of age, which is why you get two traces for theta – one for age = 22, the other for age = 34.

If you wanna see how the probability changes with new values of age, I think you have two options:

  • set age as a shared variable to resample the model later with new values of the predictor – then you’ll get as much theta traces as you have predictor values
  • reconstruct your GLM after the model has sampled – you just do logistic(p_trace["intercept"] + p_trace["slope"] * age as these are numpy arrays

These two options achieve the same goals, but one is done during sampling, the other afterwards – pick your favorite :wink: