Skip to content
Research Atlas

Spatial Analysis & GIS · Lesson 3 of 4

Variograms: Measuring How Similarity Decays

~18 min

The Concept

Kriging needs to know exactly how the similarity between two wells decays with distance, and that relationship needs to be quantified, not guessed. The tool that describes it is the variogram (a chart that shows how quickly two measurements stop resembling each other as the distance between them grows). You spend an afternoon calculating the semivariance between every pair of wells in the basin at every separation distance, then plotting the result. The shape that emerges looks like a rising curve that eventually flattens, near pairs are similar, distant pairs are not, and beyond a certain range, they're no more correlated than random strangers.

The experimental variogram is built by taking every pair of wells, computing the squared difference in their nitrate values, halving it (hence 'semi'-variance), and plotting it against the distance between them. Nearby wells have small squared differences (low semivariance), far-apart wells have larger differences (higher semivariance).

Three numbers summarise the variogram shape: the nugget (the semivariance at distance zero, non-zero if there's measurement error or fine-scale variability), the sill (the plateau semivariance reached at large distances), and the range (the distance at which semivariance stops increasing, beyond the range, the wells are no longer spatially correlated).

The Analogy

Think of dropping a stone in a pond and watching the ripples. Right where the stone lands, the water moves a lot. A little farther out, it still moves, just a bit less. Far enough away, the water is completely still again. A variogram is a chart of exactly that fade-out, except instead of ripples it is tracking how much nitrate values differ as distance grows.

The Math (optional)

The experimental semivariance γ(h) at separation distance h is the average squared difference between all well pairs separated by approximately h:

Experimental semivariogram

γ^(h)=12N(h)(i,j)N(h)[zizj]2\hat{\gamma}(h) = \frac{1}{2|N(h)|} \sum_{(i,j) \in N(h)} [z_i - z_j]^2

N(h) is the set of all pairs of wells separated by distance h (within a tolerance band). z_i and z_j are the nitrate values at those wells. The factor of 1/2 is the 'semi' in semivariance.

Exponential variogram model

γ(h)=c0+(c1c0)(1eh/a)\gamma(h) = c_0 + (c_1 - c_0)\left(1 - e^{-h/a}\right)

c₀ is the nugget, c₁ is the sill, and a is the practical range parameter. This smooth curve is fitted to the experimental points and used by the kriging algorithm to assign weights.

Try It

Adjust the influence range, notice how the prediction surface changes as you expand the range, effectively changing the variogram's range parameter.

010203040506070809101112131415

How far each well's influence extends — the kriging "range" parameter. Larger = smoother, but more likely to blur real gradients.

How steeply influence falls with distance. High power = only the nearest wells contribute; low power = distant wells still matter.

2 mg/L
14 mg/L

Hover a well to see its influence radius. The colour surface predicts nitrate concentration between wells — this is spatial interpolation. The GW-14 hotspot (northeast) drives the red region around the agricultural zone.

Code (optional)

variogram.pypython
import numpy as np
from skgstat import Variogram

# Well coordinates and nitrate values
coords = wells_gdf[["x_utm", "y_utm"]].values
nitrate = wells_gdf["nitrate_mgl"].values

# Fit an exponential variogram model
V = Variogram(
    coordinates=coords,
    values=nitrate,
    model="exponential",
    n_lags=8,
)

print(f"Nugget:  {V.parameters[2]:.3f} (mg/L)²")
print(f"Sill:    {V.parameters[0]:.3f} (mg/L)²")
print(f"Range:   {V.parameters[1]:.0f} m")
print(f"RMSE of variogram fit: {V.rmse:.4f}")

V.plot()  # Shows experimental points and fitted curve

Line by line

  • Variogram() takes UTM coordinates (metres) and nitrate values, computes all pairwise distances and squared differences, and bins them.
  • model='exponential' fits the standard exponential variogram curve to the experimental points.
  • The three parameters (sill, range, nugget) are what kriging will use to assign spatial weights, the range tells it how far spatial correlation extends.
  • V.plot() gives the diagnostic plot you always check: are the experimental points following the model curve smoothly?

Why Real Researchers Care

Variogram fitting is one of the most craft-dependent steps in geostatistics, there's no single right answer, and expert practitioners often disagree on the best model. The choice of variogram model (exponential, Gaussian, spherical) and its parameters can meaningfully change the kriging predictions, which is why publishing variogram diagnostics is standard practice in environmental science papers using spatial interpolation.

Quick Check

Q1. The variogram range for Bluewater Basin nitrate is 4,200 m. What does this mean practically?

Your Goal

If Bluewater Basin had a very high nugget (close to the sill value) in its variogram, what would that tell you about the spatial structure of the data and the reliability of kriging predictions?

Hint: High nugget means the data looks almost random at short distances, there's little 'smooth' spatial structure to exploit.

Teach It Back

Explain the nugget, sill, and range of a variogram to a hydrologist colleague using a physically intuitive interpretation for each term.

Previous lesson