Day 3 · Interactive
Shrinkage: how a random effect borrows strength
Eight sites, each with its own noisy estimate. A mixed model pulls each site's estimate toward the overall mean — a lot when a site has little data or sites are alike, a little when a site has lots of data or sites truly differ.
Things to try
Key idea
- Small τ → strong shrinkage. Slide τ toward 0. The model decides sites are basically alike, so every site estimate collapses onto the grand mean.
- Large τ → almost no shrinkage. Slide τ up. The model trusts each site's own data, and the teal estimates sit almost on top of the orange ones.
- More data → less shrinkage. Raise n. Each site's own mean becomes more reliable, so it is pulled less toward the center.
- Noisier observations → more shrinkage. Raise σ. Each site's own mean is now measured badly, so the model leans harder on the grand mean. Notice that τ and σ/√n are in a tug of war: only their ratio matters.
- The shrinkage weight shown below is τ² / (τ² + σ²/n): the fraction of the way each estimate stays at its own site mean rather than the grand mean.