Extending the Hierarchical Linear Regression Examples

I’m new to both Bayesian statistics and PyMC3, so if you can assume I don’t know anything, it would be much appreciated.

I’ve seen the example in the PyMC3 docs of implementing Gelman’s radon problem as a centered hierarchical linear model. I’ve also seen Tom Wiecki’s example of reparameterizing the same problem as a non-centered model, which seems like a clever way of specifying this model.

What I’m struggling with is, what if there were more levels to the hierarchical structure in the non-centered example? What would be an effective way of specifying that model? For example, suppose we had data not only for Minnesota, but now for all 50 states. We could then specify a hierarchy of state > county > town. I think seeing an example of how to make the hierarchical structure extensible would be extremely helpful to me. Thanks for any help you can provide.

Hi Max,
I updated the radon example notebook some weeks ago – it’s not yet on the website but it’s on master.
There are a lot of models in there, with different parametrizations, and I even added one, so this should help you in your thinking :vulcan_salute:

I missed that, thanks very much. If I’m still lost after going through this I’ll check back in.

1 Like

Hey, @Max_K, did you figure it out? I have the same question and I’m still lost on how to add the state level with a non-centered parameterization. Anyone else?

Hey, sorry I haven’t yet. I was expecting to need to do this, but so far it hasn’t been necessary for what I’ve needed to do.

In case anyone needs it, updated link to Alex’s example notebook above.

1 Like