🗺️ Spatial Interpolation & Kriging

Kriging (Gaussian Process regression on spatial data): estimate values at unsampled locations. Variogram γ(h) = C₀ + C(1 − e^{−h/a}) models spatial autocorrelation. Ordinary vs universal kriging.

GISInteractive
Click canvas to add sample points · Use controls to adjust variogram parameters

How it Works

Kriging treats observed values at known locations as realisations of a spatial random field. The semivariogram quantifies how variance grows with distance. Ordinary kriging then solves a system of equations to find optimal interpolation weights that minimise estimation variance subject to the unbiasedness constraint.

The canvas shows a colour-coded interpolation surface updated in real-time as you change the variogram parameters. Sample points are shown as circles; click to add new ones.

Semivariogram: γ(h) = C₀ + C · (1 − exp(−h/a)) Kriging system: [Γ 1] [w] [γ(x₀,xᵢ)] [1ᵀ 0] [μ] = [1 ] Estimate: Z*(x₀) = Σ wᵢ · Z(xᵢ)

Frequently Asked Questions

What is kriging?

Kriging is a geostatistical interpolation method that estimates values at unsampled locations as a weighted average of nearby samples, where weights are derived from a variogram model describing spatial autocorrelation. It is the BLUP (Best Linear Unbiased Predictor) for spatial data.

What is a variogram?

A variogram γ(h) measures the spatial variance between pairs of observations separated by distance h. It quantifies how similar values are at different separations: γ(h) = 0.5 × E[(Z(x+h) − Z(x))²]. The experimental variogram is fitted by a theoretical model (spherical, exponential, Gaussian).

What is the exponential variogram model?

The exponential variogram γ(h) = C₀ + C(1 − e^{−h/a}) has three parameters: nugget C₀ (variance at zero distance due to measurement error), sill C (total variance reached at large distances), and range a (scale of spatial autocorrelation).

What is ordinary kriging?

Ordinary kriging estimates the unknown value at a point as a weighted sum of nearby samples, with weights summing to 1 (unbiasedness constraint), using the variogram to minimise the estimation variance. It assumes a constant but unknown mean over the search neighbourhood.

How does kriging differ from IDW interpolation?

Inverse Distance Weighting (IDW) assigns weights purely by distance (w ∝ 1/d^p). Kriging uses the variogram structure to determine statistically optimal weights, accounting for data clustering and providing error estimates (kriging variance).

What is the nugget effect?

The nugget C₀ is the y-intercept of the variogram, representing variability at very short distances. It arises from measurement error or micro-scale variation at scales finer than the sampling interval. A large nugget indicates noisy data.

What is the range of a variogram?

The range (a) is the distance at which the variogram levels off at the sill. Points closer than the range show positive spatial autocorrelation; beyond the range, values are essentially spatially independent.

What is universal kriging?

Universal kriging extends ordinary kriging by modelling a non-stationary trend in the mean (e.g., a polynomial drift). It separates the large-scale trend from the stationary residuals, then kriging the residuals to reconstruct the full surface.

What does kriging variance represent?

Kriging variance (σ²k) is the expected squared error of the kriging estimate. Importantly, it depends on the variogram model and the configuration of sample points—not on the data values themselves—making it a purely geometric measure of uncertainty.

What are typical applications of spatial interpolation in GIS?

Spatial interpolation is used in hydrology (rainfall mapping), environmental monitoring (pollution surfaces), mining (ore grade estimation), agriculture (soil property mapping), and meteorology (temperature and pressure field reconstruction).

About this simulation

This simulator scatters random sample points over a hidden synthetic surface, then solves the full ordinary kriging linear system — built from an exponential semivariogram with adjustable nugget C₀, sill C, and range a — to reconstruct a colour-coded estimate at every grid cell, alongside IDW and nearest-neighbour alternatives for comparison. Click the canvas to drop your own sample points and watch the interpolated surface update instantly.

🔬 What it shows

A live-solved kriging surface reconstructed from scattered samples, where the variogram parameters directly determine the (n+1)×(n+1) weight-solving matrix, plus IDW and nearest-neighbour modes to compare interpolation philosophies side by side.

🎮 How to use

Choose Method (Ordinary Kriging, IDW, or Nearest Neighbour), tune Nugget C₀, Sill C, Range a, and Samples n, then click ⟳ New Sample to redraw random points or click directly on the canvas to add your own. ↺ Reset restores defaults.

💡 Did you know?

Kriging's weights come purely from the geometry of the variogram and sample locations, not from the measured values themselves — which is why the same sample layout always produces the same kriging variance regardless of what numbers you actually measured there.

Frequently asked questions

Why does raising the Range a slider smooth out the interpolated surface?

gamma_exp() computes γ(h)=C0+C·(1−e^(−h/a)), so a larger a means the variogram climbs toward the sill much more slowly with distance h — samples remain strongly correlated over greater distances, which makes the kriging solver blend information from farther-apart points and produces a visibly smoother surface.

What does increasing the Nugget C₀ do to the reconstructed surface?

Since gamma_exp() adds C0 as a constant offset for any nonzero distance, a higher nugget effectively tells the kriging system that even very close samples disagree somewhat — this reduces how strongly nearby points are trusted, pulling the interpolated surface toward a smoother, more averaged estimate near each sample.

Why does switching Method to IDW give visibly different results than Kriging?

IDW weights points purely by w ∝ 1/d^p with no reference to a variogram at all, so it ignores spatial clustering of samples — kriging's matrix-solved weights instead account for redundant, closely-spaced samples by down-weighting them relative to isolated points, which is exactly why the two methods can diverge in sample-dense regions.

Why does the interpolateKriging() function need to solve an (n+1)×(n+1) system instead of just n equations?

The extra row and column enforce the unbiasedness constraint that all kriging weights sum to 1 (via a Lagrange multiplier μ), which is what makes ordinary kriging the Best Linear Unbiased Predictor rather than an arbitrary weighted average.

Why does adding more Samples n change the surface even in areas far from the new points?

Every new sample re-enters the shared kriging matrix used to solve for every grid cell's weights, so even distant estimates are recomputed from a system that now includes the new point — in practice its effect fades quickly beyond the effective range shown in the Statistics panel, but the linear system is genuinely global.