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.

Two fields — a spatial scale as well

Letting the GEV scale σ(s) vary in space alongside the location μ(s)

Abstract

Notebook 07 let the GEV location μ(s) roam as a Gaussian process while the scale σ and shape ξ stayed global. Here we give the scale its own field too: log σ(s) becomes a second, independent GP (plus nugget), so both where the distribution sits and how spread out it is may vary smoothly across Iberia. On the scale we also add a covariate trend β⊤c(s)\beta^\top c(s) in elevation and distance-to-coast — features that barely move the mean but track the spread of the extremes (notebook 06). We fit with a fast mean-field variational approximation, map the new σ(s) surface, and ask the empirical question — does the scale actually carry spatial structure, and does freeing it change the 100-year levels? Only the shape ξ is still held global; notebook 09 frees that too.

Keywords:non-stationary extremesGaussian processspatial scalevariational inferencereturn levels

Two fields: a spatial location and a spatial scale

In notebook 07 only the GEV location moved in space, μ(s)=μ0+f(s)+εs\mu(s) = \mu_0 + f(s) + \varepsilon_s, while the scale σ\sigma and shape ξ\xi were single global numbers shared by every station. That is a strong assumption: it says the spread of the annual maxima is identical in the cool northern interior and on the warm Mediterranean coast, and only their centre differs.

This notebook relaxes it one step. We give the scale its own Gaussian-process field, on the log scale so it stays positive and varies multiplicatively:

ys,t∼GEV(μ(s), σ(s), ξ),μ(s)=μ0+fμ(s)+εsμ,log⁡σ(s)=λ0+β⊤c(s)+fσ(s)+εsσ,y_{s,t} \sim \mathrm{GEV}\big(\mu(s),\ \sigma(s),\ \xi\big), \qquad \begin{aligned} \mu(s) &= \mu_0 + f_\mu(s) + \varepsilon^\mu_s, \\ \log\sigma(s) &= \lambda_0 + \beta^\top c(s) + f_\sigma(s) + \varepsilon^\sigma_s, \end{aligned}

with two independent GP fields fμ,fσ∼GP(0,k3/2)f_\mu, f_\sigma \sim \mathcal{GP}\big(0, k_{3/2}\big) — each a Matérn-3/2 with a fixed regional lengthscale and a fixed amplitude — and per-station nuggets εsμ,εsσ\varepsilon^\mu_s, \varepsilon^\sigma_s absorbing local structure. The shape ξ\xi stays global: it is the hardest parameter to identify (notebook 04), so we free it last, in notebook 09.

Everything else carries over from notebook 07: the whitened GP sampling and the masked likelihood for the ragged records.

/Users/eman/code_projects/research_notebook/projects/spatial_extremes/.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
source: REAL | stations 107 | years 1897-2025 (125)

The two-field model

Each field is built the same way — a whitened Matérn-3/2 GP with a fixed regional lengthscale and a fixed amplitude, centred to remove the additive degeneracy with its global offset — so a small helper keeps the model readable. The kernels carry distinct pyrox_names so their sample sites don’t collide.

Why fix the amplitude rather than learn it? With two fields the GP variances are only weakly identified — the data cannot cleanly separate a small smooth field from a large one that the nugget then shrinks — and a free variance hyperparameter destabilises the fit badly (it runs off to extreme values and the scale field overflows). Fixing it, exactly as we already fix the lengthscale, removes the pathology and costs us nothing we could reliably estimate anyway.

The location field fμf_\mu works in °C; the log-scale field fσf_\sigma works in log units, where a regional value of, say, 0.2 means the scale is ~20% larger than its neighbourhood baseline. Its amplitude is set correspondingly small.

On the scale we go one step beyond a pure GP field and add a linear covariate trend, $\log\sigma(s) = \lambda_0 + \beta^\top c(s) + f_\sigma(s)

  • \varepsilon^\sigma_s,with, with c(s)$ the standardised elevation and distance-to-coast. Notebook 06 showed these features barely move the location, but they track the spread of the extremes — so we let them explain what they can and leave the GP to mop up the smooth residual.

Fit with mean-field VI

Two latent fields plus their nuggets give the posterior a stiffer geometry than notebook 07’s single field — stiff enough that a mode-and-Hessian Laplace fit is numerically fragile here. A mean-field Gaussian guide (AutoNormal) sidesteps that: it fits an independent Gaussian per latent coordinate by maximising the ELBO, so there is no Hessian to invert and the fit is stable. The trade-off is that mean-field VI ignores posterior correlations and tends to under-state uncertainty, so read the interval widths below as a lower bound. The ELBO loss should settle to a flat plateau.

Mean-field VI fit in 11.6s · final ELBO loss 13987.0
<Figure size 600x320 with 1 Axes>

Read off the posterior

As before, draw from the Laplace Gaussian and push the draws through Predictive to recover the location and scale fields, their smooth components, and the global tail.

global tail   ξ = -0.244 ± 0.005
location μ(s) range : 21.4 -> 42.7 °C
scale    σ(s) range : 1.34 -> 3.93 °C (global σ in nb 07 was ≈ 1.8)
smooth log-σ field vs latitude: corr = -0.36
log-σ covariate effects (per 1 SD, 95% CI):
  β[elevation    ] = -0.092  (-0.11, -0.07)  ← excludes 0
  β[dist-to-coast] = -0.012  (-0.03, +0.01)  

The two surfaces

Location on the left, the new scale field on the right. Notebook 07 would have shown the scale panel as a single flat colour; now it has texture.

<Figure size 620x520 with 2 Axes>
<Figure size 620x520 with 2 Axes>

What drives the scale — covariates, coordinates, or noise?

A field can vary station-to-station for three different reasons, and we can now separate them. Split log⁡σ(s)\log\sigma(s) into a covariate part (β⊤c(s)\beta^\top c(s), elevation and distance-to-coast), a regional part (the smooth GP fσf_\sigma), and a local part (the nugget). Notebook 06 found these covariates barely move the mean; the question here is whether they carry the scale — and how much of its variation they explain that raw coordinates leave to the nugget.

log-σ covariate (elev+coast) SD : 0.102  (31% of variation)
log-σ regional   (GP)        SD : 0.013  ( 0%)
log-σ local      (nugget)    SD : 0.152  (69%)
<Figure size 620x520 with 2 Axes>

Return levels

The 100-year level now responds to a varying scale as well as a varying location. We map the posterior-median z100z_{100} and its 95% credible width, and compare the average width with the single-field model.

z100 median range : 25.5 -> 48.6 °C
z100 95% CI width : 9.4 °C avg (max 16.7) [mean-field VI; nb 07 single-field was ≈ 2.7]
<Figure size 620x520 with 2 Axes>
<Figure size 620x520 with 2 Axes>

Takeaway

Freeing the scale showed that σ varies across Iberia; adding elevation as a covariate shows why. With log⁡σ(s)=λ0+β⊤c(s)+fσ(s)+εsσ\log\sigma(s) = \lambda_0 + \beta^\top c(s) + f_\sigma(s) + \varepsilon^\sigma_s, the elevation coefficient is unambiguously non-zero (β≈−0.09\beta \approx -0.09 per standard deviation, 95% CI excluding 0): higher stations have less-variable extremes. Distance-to-coast — strongly correlated with elevation — adds nothing once elevation is in.

The variance split is the real story: the covariate explains ~30% of the log-σ variation and the smooth GP collapses to nil. The “regional” scale field of the pure-GP model (notebook 07’s machinery) was, to first order, elevation in disguise — a single physical covariate does the GP’s old job and makes it interpretable. What it does not explain is the ~70% that stays in the nugget: much of how hard the extremes swing is genuinely local (exposure, microclimate), not a smooth surface a GP or a covariate can recover.

One parameter is still global: the shape ξ\xi. It is the tail exponent, the hardest thing to pin down from a few decades of maxima — which is exactly why it is interesting to set it free. Next: a third GP for ξ(s)\xi(s), and an honest look at whether spatial pooling can rescue a parameter that is barely identified even in aggregate.