Regression Methods for Geospatial DataPart 4 of 4Advanced · Updated December 1, 2026

Gaussian Process Regression

Kernel regression counts correlated observations as independent and returns no measure of its own confidence. Both limitations arise because it models the relation between each observation and the query, but not between the observations themselves. Gaussian process regression adds that relation and addresses both.

Reading the kernel as a covariance defines a Gaussian process

Instead of reading k(x,x′)k(\mathbf{x}, \mathbf{x}') as the weight an observation receives, read it as the correlation between the field’s values at two points. A Gaussian process is then a prior over functions:

f(x)∼GP(m(x), k(x,x′))f(\mathbf{x}) \sim \mathcal{GP}\left(m(\mathbf{x}),\, k(\mathbf{x}, \mathbf{x}')\right)

For any finite set of points, the vector of function values is jointly Gaussian, with mean given by mm and covariance by kk. The kernel is unchanged (the same lsl_s, ltl_t, lfl_f and e−re^{-r}), but it now describes the joint structure of the field rather than only proximity to the query.

With observations y=f+ϵ\mathbf{y} = \mathbf{f} + \boldsymbol{\epsilon}, ϵ∼N(0,σn2)\epsilon \sim \mathcal{N}(0, \sigma_n^2), conditioning the joint Gaussian on the data gives the posterior at a query point in closed form:

E[f∗]=m∗+k∗⊤(K+σn2I)−1(y−m)\mathbb{E}[f_*] = m_* + \mathbf{k}_*^{\top}\left(K + \sigma_n^2 I\right)^{-1}(\mathbf{y} - \mathbf{m}) V[f∗]=k∗∗−k∗⊤(K+σn2I)−1k∗\mathbb{V}[f_*] = k_{**} - \mathbf{k}_*^{\top}\left(K + \sigma_n^2 I\right)^{-1}\mathbf{k}_*

where k∗\mathbf{k}_* holds the kernel between the query and each observation, and KK holds it between every pair of observations. Nadaraya–Watson never forms KK.

The inverse covariance discounts redundant observations

Both estimators are linear combinations of the observed values (written here with zero prior mean) and differ in how the kernel vector is normalised:

y^NW=k∗⊤yk∗⊤1versusy^GP=k∗⊤(K+σn2I)−1y\hat{y}_{\text{NW}} = \frac{\mathbf{k}_*^{\top}\mathbf{y}}{\mathbf{k}_*^{\top}\mathbf{1}} \qquad\text{versus}\qquad \hat{y}_{\text{GP}} = \mathbf{k}_*^{\top}\left(K + \sigma_n^2 I\right)^{-1}\mathbf{y}

Nadaraya–Watson divides by the total weight; the Gaussian process multiplies by the inverse covariance, which decorrelates the observations. Two observations at almost the same location have k(x1,x2)≈1k(\mathbf{x}_1,\mathbf{x}_2) \approx 1, and the inverse discounts the pair to roughly one observation’s worth. The weighted mean does not see this entry and counts both in full.

This is the redundancy that, in the previous tutorial, a calibration map could only partly correct: ten nearby points from one flight are close to a single measurement, but ∑iwi\sum_i w_i counts them as ten. A Gaussian process avoids this overcounting in the model itself rather than correcting it afterwards.

GP σ where there is no data 0.727GP σ at the cluster 0.258Error at the cluster — NW 0.138, GP 0.000
Figure 1.Both estimators on the same data with the same kernel and length scale. In the unobserved stretch in the middle, the kernel smoother interpolates with no indication of reduced confidence, while the Gaussian process's band widens; the band comes from the same matrix solve as the mean. Near the peak at x = 2, a weighted mean cannot exceed all its neighbours, so Nadaraya–Watson flattens the peak while the Gaussian process follows it, although at high observation noise the ordering of their errors can reverse. Increasing the clustering collapses five observations onto one spot: the kernel smoother moves much further than the Gaussian process mean.

The predictive variance reports where the estimate is uncertain

V[f∗]\mathbb{V}[f_*] starts at the prior variance k∗∗k_{**} and is reduced by k∗⊤(K+σn2I)−1k∗\mathbf{k}_*^{\top}(K+\sigma_n^2 I)^{-1}\mathbf{k}_*, which is large when the query is close to observations that are informative, not merely numerous. Three consequences follow:

  • Far from data, k∗→0\mathbf{k}_* \to 0 and the variance returns to the prior variance.
  • Redundant observations reduce the variance less than independent ones, because the inverse discounts them.
  • The variance does not depend on y\mathbf{y}. It depends only on where measurements were taken, so it can be computed before collecting data, which makes sensor placement a tractable optimisation problem.

For decisions based on the estimate this distinction can matter. A decision might reasonably differ between an estimate of 0.6 supported by many recent nearby flights and an estimate of 0.6 that is the prior in the absence of data. Kernel regression returns the same number in both cases.

Hyperparameters can be fitted by marginal likelihood

A Gaussian process gives the probability of the data under the model in closed form:

log⁡p(y∣X,θ)=−12y⊤Ky−1y−12log⁡∣Ky∣−n2log⁡2π\log p(\mathbf{y} \mid X, \boldsymbol{\theta}) = -\tfrac{1}{2}\mathbf{y}^{\top}K_y^{-1}\mathbf{y} - \tfrac{1}{2}\log|K_y| - \tfrac{n}{2}\log 2\pi

with Ky=K+σn2IK_y = K + \sigma_n^2 I. The first term rewards fitting the data; the second penalises models flexible enough to fit anything. The trade-off needs no held-out set or grid search, and the expression is differentiable in θ\boldsymbol{\theta}, so the length scales can be fitted by gradient ascent.

The marginal likelihood is, however, only as reliable as the model assumptions behind it, and it is often multimodal; one common local optimum explains the data as noise with a long length scale. Scoring on held-out flights, as in the earlier tutorials, makes fewer assumptions and is harder to mislead.

Assumptions and failure modes

Cost. Building KK takes O(n2)O(n^2) memory and factorising it O(n3)O(n^3) time. With millions of trajectory points, a dense KK would have trillions of entries and does not fit in memory. Standard approximations include:

  • Inducing points (sparse variational GPs), which summarise nn observations by m≪nm \ll n pseudo-inputs, at cost O(nm2)O(nm^2).
  • Local GPs, which fit an exact GP within a neighbourhood. The radius cutoff RR of the earlier tutorials is already a local approximation of this kind: everything outside the neighbourhood is treated as uncorrelated. The remaining step is to solve within the neighbourhood rather than average over it.
  • Structured kernels, which exploit grid structure for fast matrix–vector products.

Local GPs suit a kernel estimator that already truncates at RR: if the neighbourhoods are small, say hundreds of points, they are well within the reach of a dense Cholesky factorisation.

Bounded outputs. A GP is a prior over unbounded functions, while the quantity estimated in this series is a probability in [0,1][0,1]. The standard approach, GP classification, places the GP on a latent function and passes it through a sigmoid; the posterior is then neither Gaussian nor closed-form, and requires a Laplace approximation, expectation propagation or variational inference. The pseudo-count formulation of the kernel tutorial avoids this by keeping the estimate a weighted mean of values already in [0,1][0,1], so the comparison between the two methods is not one-sided.

Summary

  • A Gaussian process reads the kernel as a covariance and solves with (K+σn2I)−1(K + \sigma_n^2 I)^{-1} instead of dividing by the total weight.
  • The inverse covariance discounts redundant observations, and the same solve gives a predictive variance that grows away from data.
  • Hyperparameters can be fitted by marginal likelihood, which is convenient but can be misled when the model assumptions are wrong.
  • Exact inference costs O(n3)O(n^3); local GPs within the existing neighbourhood cutoff are a practical route at large scale, and bounded probabilities require approximate GP classification.

This is the last tutorial in the series. Across the four, each estimator addresses a limitation of the previous one: nearest neighbours define a neighbourhood, kernel regression weights it smoothly and adds a prior, calibration corrects the resulting probabilities, and a Gaussian process models the correlation that causes the miscalibration.

References

  • Rasmussen, C. E., & Williams, C. K. I. (2006). Gaussian Processes for Machine Learning. MIT Press. doi:10.7551/mitpress/3206.001.0001
  • Quiñonero-Candela, J., & Rasmussen, C. E. (2005). A unifying view of sparse approximate Gaussian process regression. Journal of Machine Learning Research, 6, 1939–1959. jmlr.org
  • Titsias, M. (2009). Variational learning of inducing variables in sparse Gaussian processes. Proceedings of the 12th International Conference on Artificial Intelligence and Statistics (AISTATS), PMLR 5, 567–574. proceedings.mlr.press