Skip to contents

NaturalNeighbourWeights: Sibson (area-stealing) or Laplace (non-Sibsonian: facet length over distance) coordinates of a query point, positive only on its natural neighbours, summing to one and reproducing linear functions. NnInterpolate: \(f(x) = \sum_i w_i z_i\), with the natural-neighbour variance and the bounds of the neighbours' values; NA outside the convex hull unless outside = "extrapolate". NnGradientInterpolate: \(\sum_i w_i (z_i + g_i \cdot (x - x_i))\) with gradients from inverse-squared-distance weighted planes through each datum and its natural neighbours. NnCrossValidation: leave-one-out predictions and RMSE. NnInDomain: the convex-hull domain (Sibson 1981; Belikov et al. 1997; Watson 1992). Identical to the Python arm morie.fn.natnbr; weight names are 1-based point indices.

Usage

NaturalNeighbourWeights(points, x, method = "sibson")

NnInterpolate(points, values, xs, method = "sibson", outside = "nan")

NnGradientInterpolate(points, values, xs, method = "sibson")

NnCrossValidation(points, values, method = "sibson")

NnInDomain(points, xs)

Arguments

points

Two-column data locations.

x

Query point.

method

"sibson" or "laplace".

values

Data values.

xs

Two-column query points.

outside

"nan" or "extrapolate".

Value

List (or logical vector).

References

Sibson, R. (1981). A brief description of natural neighbour interpolation. In V. Barnett (ed.), Interpreting Multivariate Data, 21-36. Wiley.

Belikov, V. V. et al. (1997). The non-Sibsonian interpolation: a new method of interpolation of the values of a function on an arbitrary set of points. Computational Mathematics and Mathematical Physics 37, 9-15.

Watson, D. F. (1992). Contouring: A Guide to the Analysis and Display of Spatial Data. Pergamon.

Examples

sq <- rbind(c(0, 0), c(1, 0), c(1, 1), c(0, 1))
NaturalNeighbourWeights(sq, c(0.5, 0.5))$weights
#>    1    2    3    4 
#> 0.25 0.25 0.25 0.25 
P <- rbind(c(0, 0), c(2, 0), c(2, 2), c(0, 2), c(1, 3))
NnInterpolate(P, 1 + 2 * P[, 1] - P[, 2], rbind(c(1, 1), c(5, 5)))$estimates
#> [1]   2 NaN