Inverse distance weighting (IDW)

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 x0x_0 and nn known source points with values z1,…,znz_1, \dots, z_n at distances d1,…,dnd_1, \dots, d_n from x0x_0, each point's weight is

wi=1dipw_i = \frac{1}{d_i^{p}}

where pp is the power parameter. The estimate at x0x_0 is the weighted average

z^(x0)=∑i=1nwi zi∑i=1nwi\hat{z}(x_0) = \frac{\displaystyle\sum_{i=1}^{n} w_i \, z_i}{\displaystyle\sum_{i=1}^{n} w_i}

If x0x_0 coincides exactly with a source point (di=0d_i = 0), that point's value is returned directly (the weight formula is undefined at zero distance).

Effect of power

  • Higher power concentrates 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 power spreads 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 x0x_0, not every point in the dataset. When fewer than min_neighbors points fall within radius, the target uses the max_neighbors nearest points regardless of distance, so sparse areas still get an estimate. This keeps the cost bounded per target and keeps estimates tied to the nearest available evidence.

When radius is not given

If radius is omitted, APbase fits a variogram from the source data and derives the radius from its range, as described at the end of that page.