KRIGING · SEMIVARIOGRAM · VARIOGRAM FIT · STANDARD ERROR MAP · LEAVE-ONE-OUT CHECK · X/Y OR LON/LAT · RUNS IN YOUR BROWSER · NOTHING UPLOADED

What is the value between my sample points, and how sure can I be?

Soil samples, wells, rain gauges, air sensors, survey points: you measured at some places and need a map of the rest. This tool fits a semivariogram to your readings (how fast they stop resembling each other with distance), fills in the map by ordinary kriging (Matheron 1963) with a standard error at every place, and checks itself by leaving out each reading in turn, against inverse distance weighting and the nearest reading.

Nothing you enter leaves this browser tab. A statistical estimate from the readings you give, not engineering, surveying or environmental advice.

Your readings

Example: one month of ocean waves from 371 points

The real example is the median significant wave height in January 2024 at 371 ocean points on a 10-degree grid, from the ERA5 reanalysis (Hersbach et al. 2020). Left out one at a time, kriging predicts each point from the other 370 with a root mean square error of 0.39 m. Inverse distance weighting misses by 0.62 m and the nearest point by 0.51 m. The fitted exponential variogram has a small nugget (5% of the sill), so neighbouring cells 1,000 km apart still share most of their variation. The points kriging gets most wrong are sheltered water near land: one in southern Norway at 60°N 10°E had 0.22 m where the open-ocean neighbours imply 2.2 m. That is the point of the check: a map is only as good as the variogram's idea of what "nearby" means.

Questions

What is kriging?

Kriging estimates a value at a place you did not measure as a weighted average of the readings you have, with weights chosen from how quickly readings stop resembling each other as they get farther apart (the variogram). Among such averages it has the smallest expected error, and it says how large that error is likely to be at every place. It is named after Danie Krige, a South African mining engineer, and was formalised by Georges Matheron.

What do nugget, sill and range mean?

The semivariogram plots half the average squared difference between two readings against the distance between them. The nugget is where it starts at a tiny distance: measurement noise plus variation finer than your spacing. The sill is the level it flattens at, about the overall variance. The range is the distance where it gets there: readings farther apart than that tell you nothing about each other.

Is kriging better than inverse distance weighting?

Often, but check on your own data. The tool leaves out each reading in turn and predicts it from the rest by kriging, by inverse distance weighting and by the nearest reading, and reports each method's error. On the ERA5 wave-height example kriging misses by 0.39 m root mean square against 0.62 m for inverse distance. On 40 simulated fields with a known truth it beat inverse distance on 36. If inverse distance wins on your data, the tool says so.

How much can I trust the standard error map?

It is right only if the variogram is right, so the tool checks it: the mean standardised squared error of the leave-one-out predictions should be near 1. Above about 1.5 the bands are too narrow; below about 0.67 they are too wide. On simulated fields the 95% bands covered 95.1% of the held-out true values. The standard error depends on where the readings are, not on their values, so it also shows where one more sample would help most.

Can I use longitude and latitude?

Yes. Name the columns lon and lat (or longitude and latitude) and distances are measured in kilometres on a sphere, straight through the Earth (chordal distance), which keeps the spherical, exponential and Gaussian models valid (Gneiting 2013). Points either side of the 180 degree meridian are treated as neighbours.

What does the tool not do?

It assumes the same variogram in every direction (no anisotropy), a constant mean (no trend surface or universal kriging), and uses every reading in every estimate, so it takes up to 1,000 locations. It does not do block kriging, indicator kriging, co-kriging or log-normal back-transforms. It is a statistical estimate, not a survey, engineering or environmental certification.

Is my data uploaded anywhere?

No. Every number is computed by JavaScript in this browser tab. There are no accounts, cookies or analytics vendors.

Method and citation

Semivariogram (Matheron 1963). Every pair of readings, binned by distance up to half the widest distance (or the limit you set): half the mean squared difference in each class. The robust option is Cressie & Hawkins (1980): the fourth power of the mean square-root difference, bias-corrected, so a few wild readings do not inflate it.

Model fit (Cressie 1985). Spherical, exponential or Gaussian, with nugget, partial sill and range (the practical range, 95% of the sill, for the exponential and Gaussian), chosen to minimise the sum over classes of pairs × (estimate / model − 1)². For each range, nugget and sill are found by reweighted least squares, kept non-negative; the range is scanned and refined by golden-section search. "Best by leave-one-out" fits all three and keeps the one with the smallest leave-one-out error.

Ordinary kriging (Matheron 1963). The estimate is the weighted average of every reading whose weights sum to one and minimise the expected squared error under the model; the kriging variance is that minimum. Readings at the same place are averaged first. The map passes exactly through each reading.

Leave-one-out (Dubrule 1983). All the leave-one-out errors and variances come from one inverse of the kriging matrix, so the check costs no more than the map. Baselines: inverse distance weighting with power 2 (Shepard 1968) and the nearest reading. Longitude and latitude: chordal distance on a sphere of radius 6,371 km (Gneiting 2013).

Checked against the covariance-form predictor solved by a separate Cholesky routine (to 1e-8), against linear interpolation in one dimension with a linear variogram (an exact result), against a refit with each reading removed for the leave-one-out shortcut, and on 40 simulated random fields with a known truth, where the 95% bands covered 95.1% of 4,000 held-out values. Implemented from the papers; no third-party code was ported.

@article{matheron1963principles, author={Matheron, Georges}, title={Principles of geostatistics}, journal={Economic Geology}, volume={58}, number={8}, pages={1246--1266}, year={1963}, doi={10.2113/gsecongeo.58.8.1246}}
@article{krige1951statistical, author={Krige, D. G.}, title={A statistical approach to some basic mine valuation problems on the Witwatersrand}, journal={Journal of the Chemical, Metallurgical and Mining Society of South Africa}, volume={52}, number={6}, pages={119--139}, year={1951}}
@article{cressie1980robust, author={Cressie, Noel and Hawkins, Douglas M.}, title={Robust estimation of the variogram: I}, journal={Mathematical Geology}, volume={12}, number={2}, pages={115--125}, year={1980}, doi={10.1007/BF01035243}}
@article{cressie1985fitting, author={Cressie, Noel}, title={Fitting variogram models by weighted least squares}, journal={Mathematical Geology}, volume={17}, number={5}, pages={563--586}, year={1985}, doi={10.1007/BF01032109}}
@article{dubrule1983cross, author={Dubrule, Olivier}, title={Cross validation of kriging in a unique neighborhood}, journal={Mathematical Geology}, volume={15}, number={6}, pages={687--699}, year={1983}, doi={10.1007/BF01033232}}
@inproceedings{shepard1968two, author={Shepard, Donald}, title={A two-dimensional interpolation function for irregularly-spaced data}, booktitle={Proceedings of the 1968 23rd ACM National Conference}, pages={517--524}, year={1968}, doi={10.1145/800186.810616}}
@article{gneiting2013strictly, author={Gneiting, Tilmann}, title={Strictly and non-strictly positive definite functions on spheres}, journal={Bernoulli}, volume={19}, number={4}, pages={1327--1349}, year={2013}, doi={10.3150/12-BEJSP06}}
@article{hersbach2020era5, author={Hersbach, Hans and others}, title={The ERA5 global reanalysis}, journal={Quarterly Journal of the Royal Meteorological Society}, volume={146}, number={730}, pages={1999--2049}, year={2020}, doi={10.1002/qj.3803}}

Example data: ERA5 (Hersbach et al. 2020) through the Open-Meteo marine API, licence CC BY 4.0. Contains modified Copernicus Climate Change Service information (2024). Neither the European Commission nor ECMWF is responsible for any use of it. Monthly medians computed from hourly values in this repository.

Limits: up to 1,000 distinct locations, every reading in every estimate. Isotropic variogram, constant mean, point estimates (no block kriging). The map's bounding box is the readings' own; cells far from any reading are hidden by default because the estimate there is just the mean.