Heat & ozone
Generalised Extreme Value (GEV) distribution via L-moments
Hosking (1990)
Temperature and ozone spikes have heavy, asymmetric tails. Sample L-moments (λ₁, λ₂, λ₃) give closed-form estimates of the GEV location (μ), scale (σ) and shape (ξ), avoiding iterative fitting that can fail to converge on short series.
F(x) = exp( - [ 1 + ξ · (x - μ) / σ ]^(-1 / ξ) )
// Inverse exceedance on the daily basis of the ~30-day fit:
T(x) = 1 / (1 - F(x))
time basis = one day in the 30-day window, not a year
A gate of T ≥ 20 means p ≤ 0.05 within the 30-day daily fit. It is not a 20-year climatological return period, and we don’t publish year-based return periods without a longer historical model. Magnitude gates also apply: ozone +50% and ≥ 2.5σ, or temperature at least +8°C above the 30-day mean.
Heavy rain
Standardised Precipitation Index (SPI) via a 2-parameter Gamma fit
Thom (1958) maximum-likelihood approximation
Rainfall is zero-bounded and right-skewed, so it is fitted with a Gamma distribution (shape α, scale β), with a separate probability q for dry days:
A = ln(x̄) - (1/n) ∑ ln(x_i), α = [1 + √(1 + 4A/3)] / (4A), β = x̄ / α
H(x) = q + (1 - q) · Γ(α, x / β)
SPI = Φ⁻¹(H(x)) (Abramowitz & Stegun rational approximation)
Rain is flagged when SPI ≥ +2.5 with at least 40 mm in 24 h, or when 24 h accumulation reaches 60 mm.
Checking 500 cities at once
Benjamini–Hochberg q-values (shown as a diagnostic)
Benjamini & Hochberg (1995)
q-values are computed across the full family of 500 city p-values and shown on each city page. The flag itself is decided by the magnitude gates. Because those gates depend on the same series as the p-value, selecting first and then promising a false discovery rate would not be valid, so we do not claim a 5% FDR on the flagged set.
1. Sort all city p-values: p_(1) ≤ p_(2) ≤ ... ≤ p_(m)
2. q_(i) = min_(j ≥ i) [ min(1.0, (m / j) · p_(j)) ]
3. q is shown on the city page. Flags do not require q ≤ 0.05.
Fire (FRP ≥ 500 MW) and rain ≥ 60 mm are physical detections, not statistical tests.
Unusual combinations
Isolation Forest (unsupervised)
Liu, Ting & Zhou (2008) · 100 trees · contamination 0.03
Single-metric gates miss cases where each reading looks ordinary but the combination is rare. A standardised 6-feature vector (temperature, humidity, wind, PM2.5, ozone, soil moisture) is scored across all 500 cities, and cities are ranked by isolation score. Cities already flagged by the single-metric gates are excluded. Only the top 10–15 eligible cities are flagged (never more than 20), and the two features with the largest |z| are shown as the likely drivers.
s(x, n) = 2 ^ ( - E[h(x)] / c(n) )
c(n) = 2 H(n - 1) - 2(n - 1)/n