ELAI S.r.l.

The map matches the sensors: does it really know the ground between them?

A synthetic agricultural experiment explains IDW weights, validation and an unobserved zone that a smooth map cannot certify.

The map matches the sensors: does it really know the ground between them?

A colored surface is not a new measurement

A farm has a few moisture sensors and wants a map as input to an AI system. Software fills gaps and exactly matches sensor readings. Can we trust it in the least-sampled zone too? We study a synthetic soil transect, explain inverse-distance interpolation and construct two fields with identical readings. The aim is to distinguish numerical reconstruction from verified knowledge of the ground.

Abstract. Four synthetic sensors at0,20,80,100 metres read20,22,28,30 percent volumetric water content. Compare IDW powers1,2,3, nearest neighbor and linear interpolation. At50 metres all IDWs predict25, while two constructed fields matching every sensor are25 and33 there. Leave-one-out selects power3 among tested options yet cannot expose that hidden difference. We derive weighted-average bounds, calculate percentage-point errors and delimit conclusions. No physical sensor or trained model was used.

What we assume about the field

Use one coordinate x in metres along a100-metre transect, not a full2D field, depth, seasons or irrigation. Syntheticz_i are volumetric percentages:20 means20% conventional volume occupied by water. Differences are percentage points, not automatically relative percentages. Sensor values followz=20+0.1x. The60-metre gap from20 to80 leaves the center weakly observed; adding map pixels adds no measurements there.

Inverse distance weighting, IDW, estimates a weighted mean favoring nearby observations. Primary GDAL Grid documentation describes inverse powers, distance, smoothing and search windows; we read its official source. Our basic1D variant uses all four points, no smoothing and no search ellipse. GDAL was not run and its options were not reproduced. Sharing the IDW name does not make protocols identical.

Reading the formula before applying it

d_i = |x−x_i|; w_i = d_i^(−p), p>0 α_i = w_i / Σ_j w_j; z_hat(x) = Σ_i α_i z_i If x=x_i: z_hat(x)=z_i (explicit branch, no division by zero)

x_i is sensor position,d_i distance in metres andp a positive dimensionless exponent. Weights have unitsm⁻ᵖ; normalization gives unitlessα_i summing to1, preservingz units. At a sensor we return its reading before forming weights, avoiding division by zero. Positions are distinct; conflicting readings at one position would require a different protocol.

At30m distances are30,10,50,70m. Power2 weights are1/900,1/100,1/2500,1/4900; the20m sensor reading22 dominates. The estimate is≈22.154537. Power1 gives23; power3≈21.997375. Nearest neighbor gives22; linear interpolation between20 and80 gives23. None is proven correct until a reference at the query is available—constructed here, but requiring measurement or validation in reality.

Increasingp concentrates weight near sensors without guaranteeing lower error. With a unique nearest point, other-to-nearest weight ratios approach0 as p grows, so the limit is nearest neighbor. Neither estimates nor accuracy must approach monotonically. At30m,p=3 is slightly below22 before that limit. “More local is more accurate” is not supported by the method.

A weighted-average bound is not a confidence interval

Positiveα_i summing to1 keep IDW between used readings’ minimum and maximum. Sincez_i≥z_min,Σα_i z_i≥z_minΣα_i=z_min; similarly for maximum. No IDW point here can exceed30 or fall below20, even without sensors nearby. This bounds calculation, not reality: it does not certify that unsampled ground lies in the observed range.

min(z_i) ≤ z_hat(x) ≤ max(z_i) This is a deterministic interpolation bound, not P(true value within bounds).

A smooth map without extremes can hide an unsampled anomaly. Basic IDW has no uncertainty term for distance, soil variability or instrument errors; weights alone give neither correctness probability nor90% interval. Additional models and assumptions may estimate uncertainty, requiring specification and validation. We run no kriging, Gaussian process or neural network and invent no performance comparisons.

Two different fields, four identical readings

We now construct a proof of the information limit. The first field is f₁(x)=20+0.1x. The second adds a term that is exactly zero at all four observed sites. This polynomial is not a soil physics model: it is a mathematical counterexample showing information absent from the data. Both fields are continuous and every sensor has the same reading in both. An algorithm receiving only those four readings cannot know which field generated them.

f₁(x) = 20 + 0.1x f₂(x) = f₁(x) + 8 x(x−20)(x−80)(x−100) / [50·30·(−30)·(−50)] f₁(50) = 25; f₂(50) = 33

The denominator normalizes the product: at50 metres the fraction is1 and the added term is8 percentage points. At0,20,80,100 metres at least one numerator factor vanishes. This verifies both sensor agreement and central disagreement. Coordinates use the stated metre convention; changing units requires transforming polynomial constants too. The factor8 has percentage-point units and the product ratio is dimensionless.

At50 metres symmetry makes every tested IDW power predict25. Error is zero in the first world and8 percentage points in the second. This establishes neither the probability of the second world nor an8-point real error: neither field is a customer measurement. It shows that sensor agreement cannot guarantee central correctness. Since33 exceeds the observed maximum30, no positive IDW power could reproduce it.

x (m)f₁ (%)f₂ (%)IDW p=1 (%)IDW p=2 (%)IDW p=3 (%)
302326.7333332322.15453721.997375
502533252525

Leaving one sensor out: what validation measures

To select a power we hide one reading, reconstruct it from the other three and compare prediction with the hidden value. Repeat for all four sensors: leave-one-out validation. The program actually removes the held-out reading from weight calculation. Retaining it and querying its position would exactly return the known value, producing a uselessly perfect evaluation. This is evaluation leakage, also relevant to more complex AI systems.

e_i = z_hat_{without i}(x_i) − z_i RMSE = sqrt[(e₁² + e₂² + e₃² + e₄²)/4]

Root mean squared error, RMSE, summarizes discrepancy magnitude in its original units. Squaring prevents positive and negative errors cancelling; division by4 averages four cases; the root returns percentage points. It is neither percentage of correct decisions nor direct agronomic benefit. For p=2 predictions are approximately22.6304,21.2899,28.7101,27.3696 versus20,22,28,30, giving1.92654 percentage points.

PowerRMSE (percentage points)
13.059252
21.926540
31.884858

Power3 wins among three candidates, but its advantage over power2 is about0.04168 percentage points over only four cases. No independent sample supports a significance or stability claim. Crucially, observations match in both fields, so validation predictions and all three RMSEs also match: scores cannot expose the50-metre difference. Parameter selection optimizes a criterion at available sites, not observations in the gap. Testing new areas with measurements separate from parameter selection would answer a different question and was not performed here.

Left: two synthetic fields, four shared observations and IDW power2 over100 metres; sensors miss their central separation. Right: leave-one-out RMSE for three powers in percentage points. Curves are calculated constructions, not measurements or confidence intervals.
Left: two synthetic fields, four shared observations and IDW power2 over100 metres; sensors miss their central separation. Right: leave-one-out RMSE for three powers in percentage points. Curves are calculated constructions, not measurements or confidence intervals.

Reproducing results and comparing alternatives

The attached package includes experiment, results and figure generation. A1001-position grid from0 to100 metres at0.1-metre steps draws curves; it is not1001 measurements. No random numbers are used, so no seed is needed. IDW visits n sensors at G positions, costing O(Gn). Straightforward validation with n held-outs and P powers costs O(Pn²). Four sensors are cheap, but neighbor search on large maps can change both runtime and the method actually evaluated.

Piecewise linear interpolation exactly reproduces f₁ because it is a straight line:23 at30 metres and25 at50, still failing in the second field. Nearest neighbor gives22 at30; at50 sites20 and80 tie, and our program selects the first in input order, giving22. Stating the tie rule makes reproduction possible. Success on a linear field does not prove superiority on real soil: it is a constructed match between assumptions and data.

Assertions check shared readings, exact observed-point reconstruction, central value33 in field2 and IDW bounds20–30 across the grid. They detect mathematical implementation errors, not agronomic validity. The displayed code calls experiment functions at the two discussed sites, linking values, table and figure. Outside the sensor interval the package’s linear function holds the endpoint constant; extrapolation ability was not evaluated.

From synthetic proof to a field decision

Application requires checking meaningful distances: a metre-based line omits slopes, barriers, textures and depths. In two dimensions specify coordinates, units, anisotropy and neighbor selection. Nearby map points may not be hydrologically connected. Real sensors introduce calibration, drift and noise; exactly matching noisy readings need not be desirable. This example replaces none of those checks and attributes no such product to EL-AI.

The answer is precise: a map knows readings and applies an assumption between them; it does not automatically know unmeasured ground. Two fields indistinguishable at four sensors demonstrate the limit. For AI, spatial coverage, provenance and map validation belong to available evidence. A parameter winning on known sites may be useful, but a smooth surface is not a new observation.

OSGeo GDAL — Grid Tutorial, official source: inverse distance to a power; read 16 October 2026. GDAL was not executed..

from experiment import idw, f1, f2
for x in [30.,50.]:
    print(x,[idw(x,p) for p in [1.,2.,3.]],f1(x),f2(x))

Code, data, and instructions · JSON. Educational calculations executed with Python 3.14.0; figures with Matplotlib 3.11.2. AI-assisted analysis, without claiming peer review or human review. Original illustrative ImageGen cover: it does not document EL-AI people, premises, or installations. Sources accessed 16 October 2026.