Yue (Michael) Ying

Localization and inflation

Chapter 2 showed the correlation between an observation and the state. What the ensemble Kalman filter actually uses is the sample covariance — the same quantity with units (K² here). This widget replays the experiment with a shorter-scale truth — a compact warm hump on a smooth random background — and shows the covariance the ensemble estimates next to the true covariance, so the sampling error is directly visible. You control the ensemble size, the observation location, and the localization knob that makes small ensembles usable: a smooth kernel that zeros out covariance beyond a chosen radius, where sampling noise hides any real signal.

Try it: drag the red observation anywhere on a map — the covariance follows it (click it to pin it in place). Slide the ensemble size down to 10 and watch the sample map fill with spurious blobs; slide it up and it converges toward the true covariance in the middle panel. Then turn localization on and dial the radius: everything beyond the dashed circle is set to zero.

Truth T

True Cov(Obs T, State T)

Sample Cov(Obs T, State T)

100
100 km

  • observation — drag to move, click to lock
  • localization radius R

Reading the panels

1 · The truth field — the field the analysis is trying to estimate: a compact warm hump (peak ≈ 8 K above the background, radius scale 30 km) on a smooth random background (std 1.5 K, correlation ≈ 40 km), on a 50×50 grid with 10 km cells. The field is shifted so the temperature stays positive, and drawn in the YlOrRd colormap — cold pale yellow, warm deep red — to keep it visually distinct from the blue–white–red covariance scales. The red circle is the observation of T at that point — drag it anywhere and everything follows.

2 · The true covariance — the exact covariance of this perturbation model, known analytically: the covariance of the hump under random translation (std 25 km) plus the background covariance. Because the hump is compact, so is the pattern: +7.0 K² right at the observation, −3.0 K² on the opposite flank ~86 km away, essentially gone by 150 km. It depends only on the observation location — not on the ensemble size. Both covariance panels share one fixed colour scale, ±7 K² (the true peak at the default observation is 6.96 K²): the sample is compared against it directly, and sample values beyond ±7 saturate the scale.

3 · The sample covariance — what a finite ensemble actually gives you, (1/(n−1)) Σ (xm−x̄)(ym−ȳ), on the same colour scale as the true panel so the two can be compared directly. With n = 100 the pattern is close to the truth; slide n down to 10 and spurious blobs appear everywhere — values beyond 80 km can even exceed the true peak (9.1 K² vs the true 3.0 K² there). That sampling noise is exactly what localization removes.

Localization: the fix for sampling noise

Toggle localize on: the sample covariance map is multiplied, point by point, by the Gaspari–Cohn compact-support kernel — weight 1 at the observation, a smooth taper, and exactly zero beyond the dashed circle of radius R. The positive core near the observation survives; everything beyond R is discarded, whether spurious or genuine, because with a small ensemble the far-field sample covariance is mostly noise anyway. Compare the middle and right panels: the true covariance’s negative lobe at ~86 km is real, yet with R = 100 km it lies close to the kernel’s cutoff and nearly vanishes from the sample map — that is the price of killing sampling noise. Slide R down to localize more aggressively, or toggle localization off to see the raw sample.

Inflation is the other knob: multiplying the ensemble perturbations by a factor slightly above 1 widens the sample spread, compensating for the variance lost to sampling error — and, together with localization, keeps the filter from collapsing onto a wrong analysis. It is not part of this widget, but it acts on the same diagonal of the covariance matrix that you see here as the peak at the observation.

→ Evensen et al., Data Assimilation Fundamentals (2022), Ch 10 — localization and inflation; Gaspari & Cohn (1999), QJRMS 125, 723–757.