Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Non-stationary GEV — location-dependent tails

Annual temperature extremes over Spain — part 3: location-dependent tails

Parts 01 and 02 kept the GEV scale σ and shape ξ global — every station shared one tail. This notebook promotes both to per-location spatial GPs, so each site gets its own σ(s)\sigma(s) and ξ(s)\xi(s) on top of the location μ(s)\mu(s) and warming rate β(s)\beta(s) — four latent spatial fields in total.

Same package stack as before: pyrox.gp whitened gp_sample latents, an xtremax GEV likelihood (now with per-station scale and shape), and NumPyro SVI with an AutoNormal guide.

Background — four-GP latent state

μ(s)∼GP(0,kμ),β~(s)∼GP(0,kβ),log⁡σ~(s)∼GP(0,kσ),ξ~(s)∼GP(0,kξ),\mu(s) \sim \mathcal{GP}(0, k_\mu), \quad \tilde\beta(s) \sim \mathcal{GP}(0, k_\beta), \quad \widetilde{\log\sigma}(s) \sim \mathcal{GP}(0, k_\sigma), \quad \tilde\xi(s) \sim \mathcal{GP}(0, k_\xi),

combined with scalar intercepts into the per-(s,t) GEV parameters

μ(s,t)=μ0+μ(s)+(β0+β~(s))d(t),σ(s)=exp⁡ ⁣(log⁡σ0+log⁡σ~(s)),ξ(s)=ξ0+ξ~(s),\mu(s,t) = \mu_0 + \mu(s) + \bigl(\beta_0 + \tilde\beta(s)\bigr) d(t), \quad \sigma(s) = \exp\!\bigl(\log\sigma_0 + \widetilde{\log\sigma}(s)\bigr), \quad \xi(s) = \xi_0 + \tilde\xi(s),

with d(t)=GMST(t)−GMST‾d(t) = \mathrm{GMST}(t) - \overline{\mathrm{GMST}} and y(s,t)∼GEV(μ(s,t),σ(s),ξ(s))y(s,t) \sim \mathrm{GEV}\bigl(\mu(s,t), \sigma(s), \xi(s)\bigr). log⁡σ\log\sigma is modelled (not σ) to keep the scale positive. As before, every latent field is centered so the four scalar intercepts own the global levels.

A caveat up front: ξ is the hardest extreme-value parameter to estimate — 40 years per station carries little information about the tail shape, so the ξ(s)\xi(s) posterior is heavily shrunk toward ξ0\xi_0 by its GP prior. We recover the pattern of ξ(s)\xi(s) better than its amplitude.

Setup

/home/user/research_notebook/projects/gaussian_processes/.venv/lib/python3.12/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
  from .autonotebook import tqdm as notebook_tqdm

Data — stations, GMST, and the four truths

Stations and GMST are identical to nb 01–02.

Ground-truth latent fields

Four independent Matern-3/2 draws. ξ gets a deliberately small variance (0.003) — realistic, since real tail-shape variation is modest.

mu*(s)    [-5.10, 4.07]
beta*(s)  [0.61, 2.05]
sigma*(s) [1.36, 2.74]
xi*(s)    [0.042, 0.203]

GEV likelihood from xtremax (verified vs scipy) + per-station observations

Each station draws with its own (σ∗(s),ξ∗(s))(\sigma^*(s), \xi^*(s)), broadcast along time.

xtremax GEV vs scipy (ξ=0.2)  max|Δ| = 5.12e-13
y_obs shape: (40, 40)  range: [26.8, 71.9] °C

Four truth maps

<Figure size 1400x900 with 8 Axes>

Model — four spatial GPs

Four pyrox GPs (distinct pyrox_names), all centered; four scalar intercepts; per-station σ(s)\sigma(s) and ξ(s)\xi(s) fed straight into the xtremax GEV likelihood.

Inference — SVI

With four per-station fields, a random whitened-latent start can push some stations’ σ(s)/ξ(s)\sigma(s)/\xi(s) out of GEV support, so we additionally initialise the whitened GP bases (*_u) at zero — at init every station has σ=1.8, ξ=0.1\sigma=1.8,\ \xi=0.1 uniform, comfortably in-support.

SVI finished in 25.2s
fitted μ₀ = 34.33 (35)   β₀ = 1.20 (mean β* 1.53)
fitted σ₀ = 2.06 (mean σ* 2.05)   ξ₀ = 0.152 (mean ξ* 0.120)
truth-vs-fit corr:  μ=0.99  β=0.43  σ=0.87  ξ=0.59

Loss curve

<Figure size 1000x320 with 1 Axes>

Parameter recovery — four fields

Truth-vs-posterior scatter for each latent field. μ and σ recover well; β is shrunk modestly; ξ is the hardest — its posterior is pulled strongly toward ξ0\xi_0 by the GP prior, so the cloud is compressed along the vertical axis (low amplitude, but the pattern correlation is positive).

<Figure size 1100x900 with 4 Axes>

The two spatial signatures — σ^(s)\hat\sigma(s) and ξ^(s)\hat\xi(s)

The new ingredients of this notebook: maps of the recovered GEV scale and shape fields, side by side with their truths.

<Figure size 1400x900 with 8 Axes>

Return-level maps with location-dependent tails

Now both the location τ^(s,t∗)\hat\tau(s, t^*) and the tail (σ^(s),ξ^(s))(\hat\sigma(s), \hat\xi(s)) vary in space, so the return-level maps carry spatial structure from all four fields. We use xtremax.gev_return_level with per-station scale and shape.

100-yr return shift 2024→2050: mean 0.60 °C
<Figure size 1500x1300 with 8 Axes>

Where the tail matters — 100yr − 25yr gap

The gap z100−z25z_{100} - z_{25} is governed almost entirely by the local tail (σ^(s),ξ^(s))(\hat\sigma(s), \hat\xi(s)): heavier-tailed stations (larger σ or ξ) show a bigger jump from the 25- to the 100-year level. Under nb 01–02 (global σ,ξ\sigma, \xi) this map would be nearly flat.

<Figure size 680x550 with 2 Axes>

Contrast with nb 02

Aspectnb 02 (multiplicative)nb 03 (non-stationary tail)
Latent fieldsμ(s)\mu(s), β~(s)\tilde\beta(s)μ(s)\mu(s), β~(s)\tilde\beta(s), log⁡σ~(s)\widetilde{\log\sigma}(s), ξ~(s)\tilde\xi(s)
GEV scale σglobalσ(s)\sigma(s) spatial GP
GEV shape ξglobalξ(s)\xi(s) spatial GP
z100−z25z_{100}-z_{25} map~flatspatially varying

The cost of going from two GPs to four is two more gp_sample calls and two more scalar intercepts — the inference recipe is otherwise identical.

Summary

  • Four pyrox spatial GPs feed an xtremax GEV likelihood with per-station scale and shape; NumPyro SVI infers all four fields jointly.
  • Centering every field + initialising the whitened GP bases at zero keeps the richer model identifiable and in-support during early SVI.
  • μ and σ recover well; β is modestly shrunk; ξ is the hardest (tiny signal, strong prior shrinkage) — an honest reflection of how little 40 years of maxima say about the tail shape.
  • The return-level gap z100−z25z_{100}-z_{25} now carries spatial structure from the local tail — impossible under the global-tail models of nb 01–02.

Follow-ups

  • Cross-station dependence — a Gaussian copula on the residuals (nb 04).
  • Temporal non-stationarity in σ,ξ\sigma, \xi — let the tail itself drift with GMST, not just space.