Inverse distance weighting
IDW implements Shepard's inverse distance weighting method
(Shepard, 1968). It estimates a target value as a weighted average of
nearby known values, giving closer points more influence.
Weighting formula
For a target location and known source points with values at distances from , each point's weight is
where is the power parameter. The estimate at is the
weighted average
If coincides exactly with a source point (), that point's value is returned directly (the weight formula is undefined at zero distance).
Effect of power
- Higher
powerconcentrates weight on the very nearest points -- the surface becomes closer to a Voronoi-style nearest-neighbor assignment, with more visible "bullseyes" around source points. - Lower
powerspreads influence more evenly across all neighbors in range, producing a smoother surface. power=2.0(inverse-square) is the conventional default and a reasonable starting point for most point-sampled fields.
Local neighborhood, not the whole dataset
IDW in APbase is local: the sum uses only the nearest max_neighbors
source points within radius of $x_0, not every point in the dataset. min_neighborssets a floor. Targets with too few in-range neighbors returnNaN` instead of an estimate based on too little local information. This keeps
the cost bounded per target and keeps estimates tied to nearby evidence.
When radius is not given
If radius is omitted, APbase fits a variogram
from the source data and uses range / 3. This gives the search a radius that
usually includes meaningful spatial correlation without reaching too far into
uncorrelated data.