Skip to content
Statistical RethinkingStatistical Rethinking

13.5 Summary

Chapter 13 in review

Chapter 13 extended multilevel models to varying slopes and Gaussian processes. The common thread is covariance: the model learns how parameters relate to each other, not just their average values.

We covered:

  1. Varying slopes (Section 13.1): Allow the effect of a predictor to differ across groups. The model estimates a covariance matrix with variances and a correlation ρ\rho between intercepts and slopes. The LKJ prior regularizes the correlation.

  2. Admission and gender (Section 13.2): Simpson's paradox — the aggregate effect can reverse within-group effects. Varying slopes by department reveal the true structure and show that variation across departments is as important as the average.

  3. Cross-classified chimpanzees (Section 13.3): Multiple crossed random effects (actor, block, treatment) with varying slopes by actor. More structure does not mean overfitting — partial pooling controls complexity.

  4. Gaussian processes (Section 13.4): Varying intercepts for continuous categories (space, time). The covariance function determines how similarity decays with distance. The length scale ℓ\ell controls smoothness.

Key formulas

  • Varying slopes: (γj,βj)∼MVNormal(0,Σ)(\gamma_j, \beta_j) \sim \text{MVNormal}(0, \Sigma) with Σ=(σγ2ρσγσβρσγσβσβ2)\Sigma = \begin{pmatrix} \sigma_\gamma^2 & \rho\sigma_\gamma\sigma_\beta \\ \rho\sigma_\gamma\sigma_\beta & \sigma_\beta^2 \end{pmatrix}
  • LKJ prior: p(R)∝∣R∣η−1p(\mathbf{R}) \propto |\mathbf{R}|^{\eta-1}
  • Squared exponential kernel: Cov(f(x),f(x′))=σ2exp⁡(−(x−x′)2/(2ℓ2))\text{Cov}(f(x), f(x')) = \sigma^2 \exp(-(x-x')^2 / (2\ell^2))

Key lessons

  • Varying slopes are pooled interactions — interactions with shrinkage.
  • The correlation between intercepts and slopes is part of the model.
  • Simpson's paradox is a pooling problem — varying slopes solve it.
  • Gaussian processes are varying intercepts for continuous dimensions.
  • Modeling covariance is as important as modeling means.
Rethinking

Covariance is the adventure. The title of this chapter is "Adventures in Covariance" because covariance is where the real action is. Means are easy — everyone models means. But the way parameters vary together — how intercepts and slopes correlate, how nearby locations are similar, how departments differ in both selectivity and bias — that is where the structure lives. The models in this chapter all share a common idea: instead of estimating parameters independently, estimate them together, with a covariance structure that reflects the real-world relationships. This is what makes multilevel models powerful: they model not just the average, but the variation and covariation.