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.

Kronecker-multiplicative GP — spatially varying warming rates

Annual temperature extremes over Spain — part 2: a spatially varying climate response

A direct follow-up to 01_spain_extremes. Same block-maxima data, same xtremax GEV likelihood, same Iberian grid — but we upgrade β from a scalar to a spatial GP, so each location gets its own warming amplification rate.

Notebook 01 fit an additive field τ(s,t)=μ(s)+β d(t)+τr(t)\tau(s,t) = \mu(s) + \beta\,d(t) + \tau_r(t) with a single scalar β. Here we replace β with a spatial GP β(s)\beta(s), giving a multiplicative (rank-1 space–time) interaction

τ(s,t)=μ0+μ(s)+β(s) (GMST(t)−GMST‾),\tau(s, t) = \mu_0 + \mu(s) + \beta(s)\,\bigl(\mathrm{GMST}(t) - \overline{\mathrm{GMST}}\bigr),

and drops the temporal residual. As in nb 01 the model is a NumPyro program: latent spatial fields via pyrox.gp whitened gp_sample, an xtremax GEV likelihood, and SVI with an AutoNormal guide.

Background — the multiplicative model

From scalar to field

  • μ(s)∼GP(0,kμ)\mu(s) \sim \mathcal{GP}(0, k_\mu) — the constant spatial residual (the time-invariant climate offset of each location).
  • β(s)=β0+β~(s), β~∼GP(0,kβ)\beta(s) = \beta_0 + \tilde{\beta}(s),\ \tilde{\beta} \sim \mathcal{GP}(0, k_\beta) — the spatially varying warming rate. Prior mean β0≈1\beta_0 \approx 1 = “one degree of global warming raises local extremes by one degree”.

The latent field on the S×TS \times T grid is τ(si,tj)=μ0+μ(si)+β(si) dj\tau(s_i, t_j) = \mu_0 + \mu(s_i) + \beta(s_i)\,d_j with dj=GMST(tj)−GMST‾d_j = \mathrm{GMST}(t_j) - \overline{\mathrm{GMST}}, and observations are y(si,tj)∼GEV(τ(si,tj),σ,ξ)y(s_i, t_j) \sim \mathrm{GEV}(\tau(s_i,t_j), \sigma, \xi).

Covariance on the full grid — a sum of two Kronecker products

Since μ and β~\tilde{\beta} are a priori independent GPs,

Kτ  =  Kμ⊗JT  +  Kβ⊗dd⊤,JT=1T1T⊤,K_\tau \;=\; K_\mu \otimes J_T \;+\; K_\beta \otimes d d^\top, \qquad J_T = \mathbf{1}_T \mathbf{1}_T^\top,

a sum of two Kronecker products (gaussx.SumKronecker). Both right-hand factors are rank-1, so the prior’s time-rank is 2 — the hallmark of the multiplicative model. We display this operator below for intuition, though the inference works directly with the two spatial GPs.

Identifiability

Two traps, both handled by centering the latent fields (so μ0\mu_0 owns the global level and β0\beta_0 owns the mean warming rate):

  1. μ(s)\mu(s) vs β(s)\beta(s) at d=0d = 0 — centering dd around its mean spreads β information over the whole record.
  2. β0\beta_0 vs the mean of β~\tilde{\beta} — centering β~\tilde\beta to be zero-mean pins the mean rate on β0\beta_0.

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

Synthetic data — a warming Spain with heterogeneous response

Stations and GMST are identical to nb 01 so the two can be compared directly.

GMST proxy — xtremax.simulations.generate_gmst_trajectory (same as nb 01)

GMST range:  0.15  ->  0.90 °C
d range:     -0.38  ->  +0.41 °C (centred)

Ground-truth β∗(s)\beta^*(s) drawn from a Matern GP

β∗(s)\beta^*(s) is drawn from a spatial GP with a known kernel so the GP prior is well-specified. Prior mean β0∗=1.2\beta_0^* = 1.2; fluctuations from a zero-mean Matern-3/2 kernel (variance 0.25, lengthscale 3°3°), drawn from pyrox GP priors via GPPrior.sample.

beta*(s) range:  0.61  ->  2.05  (mean 1.53, truth beta0 1.20)

GEV observation model — from xtremax, verified vs scipy

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

Inspecting the truth

(a) spatial offset μ∗(s)\mu^*(s); (b) the new ingredient β∗(s)\beta^*(s); (c) yearly-max timeseries at four stations spanning the β∗\beta^* range.

<Figure size 1600x460 with 5 Axes>

The multiplicative prior covariance as a gaussx.SumKronecker

Purely pedagogical: assemble the full-grid prior covariance with gaussx operators (kernels from pyrox.matern_kernel) and inspect its storage cost. We never materialise it during training.

prior operator:   SumKronecker
  logical shape:  (1600, 1600)  = (40·40, 40·40)
  storage cost:   6400 entries (vs 2560000 dense, 400× compression)
  time-rank:      1 + 1 = 2  (J_T and dd^T each rank 1)

The model — two spatial GPs + xtremax GEV likelihood

A NumPyro program with two pyrox spatial GPs (μ(s)\mu(s) and β~(s)\tilde\beta(s), distinct pyrox_names so their hyperprior sites don’t collide), both centered, a trainable intercept β0\beta_0, and an xtremax GEV likelihood. SVI with an AutoNormal guide replaces nb 01’s hand-rolled scaffold.

Inference — SVI

SVI finished in 17.1s
fitted μ₀    = 34.33  (truth 35.0)
fitted β₀    = 1.27  (truth mean β* 1.53)
fitted β(s)  range [1.10, 1.52]  (truth [0.61, 2.05])
fitted σ     = 1.83  (truth 1.8)
fitted ξ     = 0.144  (truth 0.12)

Loss curve

<Figure size 1000x320 with 1 Axes>

Parameter recovery

The headline is the β(s)\beta(s) map: recovering a smoothly-varying warming rate from 40 stations × 40 years of GEV maxima. The GP prior shrinks the posterior amplitude toward β0\beta_0, but the spatial pattern is recovered.

<Figure size 1600x900 with 10 Axes>

GEV tail recovery

<Figure size 1100x380 with 2 Axes>

Return-level maps — now spatially varying

τ^(s,t∗)=μ0+μ^(s)+β^(s) d(t∗)\hat\tau(s, t^*) = \mu_0 + \hat\mu(s) + \hat\beta(s)\,d(t^*), then zp(s)=z_p(s) = gev_return_level. Because β^(s)\hat\beta(s) is location-dependent, the 2024 → 2050 warming shift is non-uniform — the key difference from nb 01.

100-yr return shift 2024→2050:  mean 0.63 °C,  range [0.55, 0.76] °C
  (spatial spread is the new feature; nb 01 had zero spread here)
<Figure size 1500x1300 with 8 Axes>

The spatial pattern of warming

z100(2050)−z100(2024)z_{100}(2050) - z_{100}(2024) directly. Under nb 01 this map would be constant; here it tracks β^(s)\hat\beta(s).

<Figure size 680x550 with 2 Axes>

Contrast with the additive model (nb 01)

AspectAdditive (nb 01)Multiplicative (this nb)
Temporal structureβ d(t)+τr(t)\beta\,d(t) + \tau_r(t), one ββ(s) d(t)\beta(s)\,d(t), per-station rate
Prior covarianceKμ⊗IT+IS⊗KtK_\mu \otimes I_T + I_S \otimes K_tKμ⊗JT+Kβ⊗dd⊤K_\mu \otimes J_T + K_\beta \otimes dd^\top
Time rankfull (TT)2
Latent fieldsμ(s)\mu(s), τr(t)\tau_r(t)μ(s)\mu(s), β~(s)\tilde\beta(s)
2050 warming mapconstantspatially varying

Both share the same machinery — pyrox GP latents, xtremax GEV likelihood, NumPyro SVI — with only τ(s,t)\tau(s,t)'s definition and the second GP changing.

Summary

  • The multiplicative model’s prior is gaussx.SumKronecker of two rank-1 Kronecker products; time-rank 2 because d(t)d(t) is a known covariate.
  • Inference reuses the nb 01 stack verbatim: two pyrox spatial GPs via whitened gp_sample, an xtremax GEV likelihood, NumPyro SVI; centering both fields fixes the μ0/μ(s)\mu_0 / \mu(s) and β0/β~(s)\beta_0 / \tilde\beta(s) identifiabilities.
  • The payoff is a spatially heterogeneous warming signal: high-β regions warm faster, so the 100-year return-level shift is a map, not a constant.

Follow-ups

  • Non-stationary GEV — let σ, ξ vary across space via their own spatial GPs (nb 03).
  • Higher-rank coregionalisation — a 3–4 component temporal basis with β a matrix of location weights.