chapter seven

7 Hierarchical models: Uncovering the layers of data the Bayesian way

 

This chapter covers

  • Modeling explicit groups with hierarchical models
  • Partially sharing information across groups
  • Shrinkage via information sharing with hierarchical models

We explored how Bayesian models let us incorporate prior knowledge and update beliefs based on observed data. So far, our models have treated datapoints as if they came from the same population. However, in practice, data often have more structure.

Say we want to build a model on the outcomes of students taking an exam, specifically their test scores. If we were to treat all students as belonging to the same group (that is, samples from the same probability distribution), we wouldn’t be able to account for students from high-performing schools obtaining higher scores than other students. On the other extreme, if we separate the schools completely, we might miss trends that span across the schools, and schools with few students could look extreme just by chance. Hierarchical models give us the best of both worlds: they allow us to partially share information across groups while still accounting for individual differences.

The effect of coaching on students’ test scores

Modeling separate schools independently

Modeling all schools jointly

Hierarchical modeling to partially share information across groups

Posterior inference and comparisons between previous models

Different hierarchical structures in other real-world applications

Summary