h-scatterplots and lag binning
Learning objectives
- Read the h-scatterplot as the pair-level picture of γ(h): for ordered pairs at separation h, the cloud of hugs the 45° line when γ(h) is small (high correlation) and disperses to the full bivariate scatter when γ(h) is large (low correlation)
- Write the Matheron 1962 empirical-variogram estimator , understand each piece (squared increments, the pair set N(h), the 1/2 factor), and connect it to the §3.1 identity
- Bin irregularly-spaced data by lag distance: equal-width bins with a chosen bin width , and (looking ahead to §3.3) a directional tolerance for anisotropic variograms
- Choose : too narrow ⇒ each bin's is small ⇒ is noisy; too wide ⇒ structural features (the knee at the range, the nugget origin) are smoothed away. Default rule of thumb: minimum sample spacing
- Apply the two practical rules of thumb that protect against the modal failure modes of experimental variography: (i) trust only for bins with , since the estimator's variance scales like ; (ii) cap at roughly half the domain size so edge effects do not dominate the long-lag tail
- Carry the Part 2 declustering weights through to the variogram with the weighted estimator for pairs at lag . Without this step, short-lag bins over-represent dense regions and γ̂ is biased exactly where the variogram model needs the data most
- Diagnose common artefacts: bumpy long-lag tail = small (mask, do not model), monotonic decline at long lag = drift / non-stationarity (consider detrending, §0.2), inflated nugget = measurement error OR short-range structure unresolvable at the sampling spacing (§4.2 dissects)
- Locate §3.2 honestly in Parts 3-4: this section is 'how to compute '. §3.3-§3.6 extend the estimator (directional, anisotropic, indicator, robust). §4 fits a permissible MODEL to that Part 5 kriging can actually use
§3.1 defined the variogram as a theoretical object: a continuous function on a stationary population, capturing the half-variance of the increment as a function of separation . The widgets in that section let you slide the parameters of an idealised model and watch the curve respond — but they took the variogram as given. §3.2 picks up the next question: how do you actually compute from data?
The answer in one line is the Matheron 1962 estimator,
where is the set of all unordered sample pairs whose separation falls in a lag-bin around , and — also written just by mild abuse of notation — is its size. It is the population variance-of-difference under second-order stationarity, estimated by an average of squared differences over the data pairs that fall in each bin. It is the Part 3 workhorse: §3.3 makes it directional, §3.4 makes it anisotropic, §3.5 makes it categorical via indicator transforms, §3.6 makes it robust to outliers. But all four of those extensions sit on top of the same basic binning machinery this section develops.
The basic machinery has three moving parts and a small handful of artefacts. The reader who finishes §3.2 should be able to compute from any reasonable dataset, choose a defensible bin width, know which bins to trust and which to mask, and recognise the common ways an empirical variogram lies. The two widgets below stage the journey: the first connects to the pair-level picture (the h-scatterplot), the second walks the full binning pipeline end-to-end with a known generating process so you can SEE how well recovers it. By the end of §3.2 you have an experimental variogram. Part 4 will fit a permissible model to it.
The h-scatterplot — γ(h) made visible at the pair level
Before the average over pairs, look at the pairs themselves. The h-scatterplot at lag is the 2-D scatter of points for every ordered pair of samples whose separation is approximately . It is the bivariate joint distribution of the field at two locations a distance apart, sampled empirically from the data.
Its shape tells you visually. Drop in two facts from §3.1:
- If is SMALL — pairs at lag have nearly the same value — the cloud hugs the 45° identity line .
- If is LARGE — pairs at lag are nearly uncorrelated — the cloud spreads to the full bivariate scatter, looking like a 2-D blob of size set by .
- In between, the cloud is a tilted ellipse — narrow along the 45° direction (small variance of the increment) and wider perpendicular to it.
The first widget for §3.2 shows the connection directly. Drag the lag slider and the cloud tightens or disperses; read off as the cloud's spread perpendicular to the 45° line, since for any pair the perpendicular distance to the 45° line is , and the variogram is the half-variance of .
The left panel shows the 80 samples on a unit square, drawn from a known exponential-variogram field (range , sill 1.0, no nugget). Up to three example pairs at the current lag are highlighted as line segments so you can see which pairs the right panel is computing on. The right panel is the h-scatterplot itself: each point is an ordered pair at separation in the band . The 45° line is overlaid. The numeric readout reports (the unordered pair count in the bin), (computed live), and the true for the generating process so you can compare.
Three things to do with this widget. Set the lag short (say ) and watch the cloud collapse onto the 45° line — pairs that close are almost the same value, so is small. Slide the lag up past the range () and watch the cloud spread to roughly circular dispersion — the variogram has saturated at the sill. Finally, drop the tolerance down to its minimum (0.01); the cloud becomes sparse and noisy because collapses to a handful of pairs — this is the pair-level version of the noise problem that motivates lag binning in the first place. Wider packs more pairs into each bin and tightens the estimate at the cost of lag resolution; the trade-off is the central practical decision in experimental variography, and the second widget below stages it explicitly.
The empirical variogram estimator: from pairs to γ̂(h)
Average the h-scatterplot cloud across one lag bin and you have a single value of . Do that across many bins and you have the empirical variogram. The Matheron 1962 estimator is
where is the set of unordered pairs with separation for bin index , and the bin centre is . The estimator is computed at one or a few dozen bin centres; the points are then plotted against to produce the familiar empirical-variogram curve. Each point is a sample mean of squared increments — it is unbiased for under second-order stationarity (Matheron 1962; Cressie 1993 §2.4), and its variance scales like (the standard variance-of-a-sample-mean result, applied to the squared-increment population).
The factor of 2 in the denominator — easy to forget — comes from the definition itself. The naïve plug-in estimator estimates the full increment variance , so dividing by gives . If your computed empirical variogram is twice as high as the §3.1 model curves are telling you to expect, this is the first place to look.
Lag binning in practice — equal-width bins, with directional tolerance to come
Real spatial data is irregularly spaced. With 100 samples scattered across a study area, no two pairs have exactly the same separation. So you cannot compute at a single value of — you bin pairs into lag intervals and treat the bin centre as a single representative .
The standard scheme is equal-width binning: choose a bin width and define bins . Any pair with separation in that interval contributes to bin . The number of bins is set by the chosen maximum lag as . Both and are reader choices, and both have rules of thumb attached.
Looking ahead to §3.3: when the field is anisotropic (e.g. fluvial channels with along-channel continuity longer than across-channel), the binning gains a SECOND dimension. Pairs are kept only if their separation vector falls within of a target azimuth, and they go into a one-dimensional binning by for that direction. The result is one empirical variogram per direction. §3.2 stays isotropic — every pair counts regardless of direction — but the same binning machinery applies once you turn the angular filter on.
End-to-end: from samples to γ̂(h) with error bars
The second widget for §3.2 runs the full pipeline on 150 samples drawn from a known Spherical variogram (range , structural sill , nugget , total sill 1.00). The top panel shows as points with error bars of size — the large-sample standard deviation of the Matheron estimator (Cressie 1985, 1993 §2.4). The TRUE is overlaid in gold so you can see how well recovers it. The bottom panel is the histogram — one bar per lag bin — with the chosen cut-off threshold drawn as a horizontal red line.
Slide the bin width from its minimum to its maximum and watch the tension between two opposite failure modes play out. At narrow you get many bins, each with a small — points scatter wildly around the gold curve, error bars are large, and the long-lag tail is essentially noise. At wide you get few bins, each with many pairs — points hug the gold curve closely, error bars shrink, but the SHARP knee at the range smooths into a slow rounded shoulder and small structural features are washed out. The sweet spot is somewhere in the middle, and it depends on your data's sample spacing: a common rule of thumb (Goovaerts 1997 §4.3; Isaaks & Srivastava 1989 ch. 7) is to choose on the order of the MINIMUM sample spacing, so each bin has the resolution of one sampling interval and roughly twenty to fifty pairs per bin in the structural range.
N(h) is the noise control — the rule-of-30 and the half-domain rule
Two very practical rules govern when you should TRUST a bin and when you should ignore it.
The rule of 30. Each is a sample mean of squared increments. By the same argument that gives the scaling of the classical standard error, the noise in scales like ; the coefficient of variation is roughly for a Gaussian field (Cressie 1985, 1993 §2.4). Below this CV is above 25% — the binned estimate at that lag is at least a quarter off in either direction, often more, and the visual artefacts (jagged dips, spikes, monotonicity violations) become indistinguishable from real structural features. The widely-used (Goovaerts 1997, Isaaks & Srivastava 1989) convention is to plot but DO NOT MODEL bins with . The widget dims those bins to make the cut-off visible.
The half-domain rule. A second source of long-lag noise is edge effects: at lags approaching the size of the study area, only a few pairs CAN exist (the ones connecting opposite corners of the domain), and those pairs disproportionately sample whatever non-stationarity is present at the largest scales. The conventional cap (Journel & Huijbregts 1978 ch. 3; Deutsch & Journel 1998 §II.1) is where is the domain size — half the study-area extent. Beyond that, the empirical variogram is no longer estimating the spatial structure of a stationary process; it is showing you the consequences of finite sampling on a bounded domain. The widget marks the half-domain line at on a unit square so you can see where the trustworthy region ends. Slide past it and notice that the long-lag bins go red — under the cut-off — almost everywhere.
Declustering revisited — weights carry through to γ̂
Part 2 introduced cell and polygonal declustering as a fix for the preferential-sampling bias in the histogram and the mean: clustered samples in high-grade zones inflate the global statistics, declustering weights pull them down to a defensible estimate. The same bias contaminates the empirical variogram. Short-lag bins are dominated by pairs from densely-sampled regions, so they over-represent whatever structure is present in those regions. If the dense clusters are in high-grade hotspots, the short-lag is artificially LOW (high-grade is locally smooth); if the dense clusters are at facies boundaries, the short-lag is artificially HIGH (facies contacts are locally rough). Either way, the variogram model fitted to a naïve will be biased exactly where the kriging system depends on it most — the short-lag region.
The fix is the same as for the histogram: weight the pairs. The declustering-weighted variogram estimator is
where is the Part 2 declustering weight of sample . A pair (cluster, sparse) gets weight , which is lower than the all-cluster pair weight ; the dense-region pairs are systematically downweighted in the variogram exactly as they were in the histogram. Both Goovaerts 1997 §4.4 and Deutsch & Journel 1998's GSLIB program gamv implement this weighting natively. The naïve estimator drops out as the special case for all .
When does the weighting matter? For uniformly-spaced samples (e.g., a regular grid), declustering weights are all equal and the weighted estimator collapses back to Matheron. For preferentially-sampled data — which is most reservoir-characterisation, mining-exploration, and contamination-survey datasets — the unweighted and weighted estimators can differ by 30–50% at short lags. Part 4's fitting routines and Part 5's kriging system inherit that bias if it is not corrected here. The declustering pipeline started in Part 2; this is where it actually pays off.
Common artefacts: what an empirical variogram tells you when it lies
An experimental variogram in the wild rarely looks like the smooth clean curves of §3.1. Three artefacts come up often enough that diagnosing them is part of the working routine.
- Bumpy long-lag tail. Beyond about half the domain, drops and the variance of explodes. The bumps and dips you see are noise, not structure. The fix is the cut-off and the half-domain rule, both above. DO NOT fit your variogram model to that tail — Part 4.5 develops the weighted-least-squares fitting routine that down-weights low- bins automatically (Cressie 1985 is the foundational reference).
- Monotonic decline at long lag. If rises to a peak and then falls back down at large , you are looking at a stationarity violation, not a stationary process with a quirky variogram. The most common cause is a regional trend (a smoothly varying mean across the domain — porosity decreasing east-to-west, ore grade higher in one corner). The textbook fix is to FIT the trend, subtract it, and compute on the residuals. Universal kriging in Part 5.3 and KED handle the same problem at prediction time, but pre-residualising for variogram estimation gives you a cleaner picture. §0.2 introduced the stationarity ladder; this is where it bites.
- Inflated nugget. A whose lowest-lag bin sits well above zero is showing you a nugget effect — but the SOURCE of the nugget is not directly diagnosable from the variogram alone. It could be measurement error in the assay; it could be real structural variability at scales shorter than your closest sample spacing; or it could be a bin-width effect (a very narrow short-lag bin can have so few pairs that the noise alone inflates the estimate). The fix is to compare independent re-measurements of the same sample if you have any — that gives you the measurement-error component directly — and to compare at multiple bin widths to rule out the bin-width artefact. §4.2 takes up nugget dissection in detail.
Where §3.2 ends and §3.3-§3.6 + §4 begin
Be precise about scope. §3.2 gave you the basic isotropic Matheron estimator with equal-width lag bins, the noise-management rules (cut-off, half-domain), and the declustering correction. The next four sections of Part 3 extend the same estimator in four orthogonal directions, each addressing a different way that real data departs from the basic isotropic Gaussian-field assumption:
- §3.3 — directional variograms. Drop the isotropy assumption. Compute separately along each compass direction with an angular tolerance . The output is several variograms — one per direction — which often differ in range and sill.
- §3.4 — anisotropy modelling. Bundle the directional variograms into a 2-D (or 3-D) anisotropic structure: range as an ellipse with major / minor axes, "geometric" anisotropy when only the range varies, "zonal" anisotropy when the sill also varies with direction.
- §3.5 — indicator variograms. Threshold the continuous variable at a cut-off to produce a 0/1 indicator . Compute the empirical variogram of . This is the bridge to indicator kriging (Part 8) for categorical or quantile-thresholded data.
- §3.6 — robust variogram estimators. Replace the in the sum by something less sensitive to outliers: the Cressie–Hawkins 1980 estimator is the classic. The §1.4 robust-statistics ideas (M-estimators, breakdown points) port directly into the variogram domain.
After Part 3 you have a defensible empirical variogram. Part 4 fits a PERMISSIBLE model to it — a continuous function from a family (Spherical, Exponential, Gaussian, Matérn, nested) that is conditionally negative definite, so the kriging matrices in Part 5 are guaranteed positive definite. Part 4.5 covers the fitting routines (weighted least squares, manual fitting, automated cross-validation). The Part 5 kriging system finally consumes the fitted model. Everything in Parts 3 and 4 exists so that Part 5's linear system has the right entries.
Try it
- In the h-scatter-explorer, set the lag (very short) and the tolerance . Look at the cloud: does it hug the 45° line, or is it spread? Note the value of in the readout. Now slide to 0.50 (long, beyond the field's range of 0.30). What happens to the cloud? Why does change so much?
- Still in the h-scatter-explorer, hold (mid-range) and slide from its minimum (0.005) to its maximum (0.10). At small , collapses to a handful of pairs and the cloud is sparse and noisy. At large , is large and the cloud is well-populated, but it now mixes pairs at very different separations (0.10 to 0.30). What is the trade-off you are making?
- In the empirical-variogram-builder, set (narrow) and look at the top panel. Many bins; many error bars; long-lag tail jagged and noisy. Now set (wide). Few bins; small error bars; the knee at the range smooths into a slow shoulder. Where between these two would you set to capture the spherical knee without drowning in noise? (Hint: try -.)
- In the empirical-variogram-builder, set and look at the histogram. How many bins are above the cut-off line? How many are below (red)? Now slide down to 0.50 — the half-domain rule. Which long-lag bins disappeared, and were they trustworthy? (Hint: compare to where the half-domain dashed-red line was.)
- Click "New realisation" four or five times in the empirical-variogram-builder, holding all the sliders fixed. The same GENERATING variogram produces empirical variograms that wiggle around the gold curve from run to run. Estimate by eye how much each bin wiggles between realisations. Bins with wiggle less than the small-N ones — this is the noise scaling, made visible.
- Without coding: a colleague brings you 200 porosity samples on a roughly-square 1 km × 1 km domain, with the closest pair 20 m apart and an expected range around 150 m. What bin width would you suggest? What ? Why? (Hints: minimum spacing = 20 m gives 7 or 8 bins inside the range — enough to resolve the knee; m = half the diagonal stays safely inside the half-domain rule.)
- Without coding: the same colleague reports that they ran both unweighted and with cell-declustering weights, and the short-lag value of dropped from 0.018 to 0.012 once weights were applied. What does this suggest about the sampling pattern? Should they use the weighted variogram for downstream kriging? (Hint: a 33% drop at short lag means dense clusters were in locally-smooth regions — high-grade hotspots most likely. Yes, use the weighted version; the unweighted one is biased low for nearby pairs.)
- Without coding: an experimental variogram peaks at m with and then DECLINES back to 0.04 at m. The bins at 250 m and 500 m both have . Is this consistent with a stationary process, or does it suggest a violation? What is the most likely cause? (Hint: declining at long lag indicates a smoothly-varying mean across the domain — a trend. Stationary processes can only have flat or rising at long lag.)
Pause and reflect: the empirical variogram is a sample statistic, and you have just inherited all the small-sample diagnostic discipline that classical statistics requires for any sample statistic — confidence intervals, sample-size requirements, outlier sensitivity. Where in your domain (reservoir, mine, watershed, brownfield, weather grid) would a 200-sample dataset be considered "lots of data" for variogram estimation, and where would it be considered tight? What single rule of thumb (the rule-of-30, the half-domain, declustering) would you defend most strongly to a colleague who wants to skip it for speed?
What you now know — and what §3.3 onward will build on it
You have the Matheron 1962 empirical-variogram estimator , with the bin centre and the pair set . You have the pair-level intuition for it: the h-scatterplot, where short-lag pairs hug the 45° line and long-lag pairs disperse to the full bivariate scatter. You have the lag-binning machinery: equal-width bins controlled by the choice of (resolution vs noise), and a maximum lag controlled by the half-domain rule. You have the two practical rules of thumb that govern when to trust a bin: for the noise floor, and for the edge-effects ceiling. You have the declustering-weighted variant that carries the Part 2 declustering weights into Parts 3 and 5. And you have a working diagnostic vocabulary for the three artefacts that an empirical variogram presents in real data: noisy long-lag tails (small ), monotonic declines (drift / non-stationarity), and inflated nuggets (measurement error vs unresolved short scale).
§3.3 lifts the isotropy assumption. Real fields have direction: along the geological strike, along a fluvial channel axis, along an east-west drainage gradient. Variograms computed in different compass directions look different — different ranges, sometimes different sills. The §3.3 widget will stage the directional binning with a tolerance on the separation azimuth, and you will see the same data produce dramatically different empirical variograms once you slice by direction. §3.4 then bundles those directional curves into an anisotropy ellipsoid that Part 4 can fit a model to. §3.5 swaps the continuous for an indicator and shows how categorical/quantile-thresholded data fit the same machinery. §3.6 replaces the squared-difference statistic with a robust counterpart that survives a few wild outliers. By the end of Part 3 you have not just an isotropic but a full experimental description of the spatial structure — direction, anisotropy, categorical thresholds, robust under contamination. Part 4 then turns that experimental description into a permissible model that Part 5 kriging can consume.
The two widgets above are the bedrock. Every later widget in this textbook that says "variogram" — and there are many — runs the §3.2 binning machinery under the hood. Understanding what those bins represent, what makes them noisy, and how to choose a defensible is the single most important practical skill in geostatistical estimation.
References
- Matheron, G. (1962). Traité de géostatistique appliquée, Tome I. Editions Technip, Paris. (The foundational reference for the empirical variogram estimator that bears Matheron's name. Defines the binning machinery and the form.)
- Cressie, N. (1985). Fitting variogram models by weighted least squares. Mathematical Geology, 17(5), 563–586. (The standard reference for the standard-error scaling that this section's widget uses for the error bars. Also the foundational paper for the WLS fitting routine used in Part 4.5.)
- Cressie, N. (1993). Statistics for Spatial Data (revised ed.). Wiley. (§2.4, "Estimation of the Variogram" — the definitive mathematical-statistics treatment of the empirical estimator: bias, variance, asymptotic distribution, robust alternatives.)
- Goovaerts, P. (1997). Geostatistics for Natural Resources Evaluation. Oxford University Press. (§4.3 on experimental variograms, including the bin-width and minimum-pair rules of thumb. §4.4 on declustering-weighted variograms.)
- Isaaks, E.H., Srivastava, R.M. (1989). An Introduction to Applied Geostatistics. Oxford University Press. (Chapter 7, "Spatial continuity" — the most readable practitioner-level treatment of the h-scatterplot, lag binning, and the standard cut-off / half-domain rules.)
- Deutsch, C.V., Journel, A.G. (1998). GSLIB: Geostatistical Software Library and User's Guide (2nd ed.). Oxford University Press. (The
gamandgamvprograms that implement the regular-grid and irregular-grid empirical estimators with all the directional and declustering options developed in this textbook.) - Journel, A.G., Huijbregts, C.J. (1978). Mining Geostatistics. Academic Press. (Chapter 3, "Experimental Variogram". The classic mining-geostatistics statement of the binning rules and the half-domain convention; the source of much of the practical wisdom in §3.2.)
- Chilès, J.-P., Delfiner, P. (2012). Geostatistics: Modeling Spatial Uncertainty (2nd ed.). Wiley. (Chapter 2 on the variogram; §2.7 on robust estimators that §3.6 will pick up. The modern comprehensive reference.)