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.

● no-pooling estimate (site mean) ● partial-pooling estimate (mixed model) ▬ overall (grand) mean
Show the plotted values as a table

Things to try

  1. Small τ → strong shrinkage. Slide τ toward 0. The model decides sites are basically alike, so every site estimate collapses onto the grand mean.
  2. 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.
  3. More data → less shrinkage. Raise n. Each site's own mean becomes more reliable, so it is pulled less toward the center.
  4. 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.
  5. The retention weight B shown below is B = τ² / (τ² + σ²/n): the fraction of the way each estimate stays at its own site mean rather than the grand mean. Careful with the direction: B is what a site keeps, and 1 − B is how far it is shrunk toward the grand mean. Day 3's morning problem set (Problem 1) uses B the same way.
  6. Unequal effort. Tick the box. Now every site gets its own Bi, and the sparsely sampled sites are pulled hardest. This is the balanced-versus-unbalanced contrast that the lab's stream data cannot show, because every stream there has exactly three observations.

← Back to the Day 3 lab