0
$\begingroup$

Natural neighbor interpolation is defined here, it is an intriguing method that uses voronoi diagrams. Notably it is smooth almost everywhere whereas linear interpolation is only piecewise linear. I was using it for my research but after some playing around it seems to just be... worse than linear. Here is a pic of natural neighbor vs linear from my research and the first derivative. The derivative of the natural neighbor interpolation is blunted because it is singular at the sampling points.

enter image description here The data here is 2D and I interpolated along a line that included many sampling points.

Does Natural Neighbor interpolation beat linear interpolation at anything?

$\endgroup$
2
  • $\begingroup$ From your leftmost figure it looks like the NN-interpolation dips down to be lower than both neighbouring datapoints, which should not be possible for a correct implementation. It's also clearly not smooth at the datapoints. I think you simply have a bug when computing the weights. $\endgroup$ Oct 4, 2022 at 20:42
  • $\begingroup$ this is a built in matlab function, I don't think there is a bug. There is a lower weight off the sampling line that is causing the value to dip down. $\endgroup$ Oct 4, 2022 at 21:48

1 Answer 1

1
$\begingroup$

The main advantage of this interpolation technique is that it's independent of whatever meshing you'd have to pick for linear interpolation.

A typical extreme example would be a perfect square, where you have to pick over which diagonal you want to interpolate, and results may differ greatly;

P = [0 0; 0 1; 1 0; 1 1];
V = [0; 0; 0; 1];
F = scatteredInterpolant(P,V)
[X,Y] = meshgrid(linspace(0,1,50), linspace(0,1,50));

F.Method = 'linear'
V2lin = reshape(F([X(:),Y(:)]), 50,50)
surf(X,Y,V2lin)
% vs
figure(2)
F.Method = 'natural'
V2nat = reshape(F([X(:),Y(:)]), 50,50)
surf(X,Y,V2nat)

linear interpolation natural interpolation

Playing around with a more complete unstructured mesh

P = [0 0; 0 1; 1 0; 1 1; rand(20,2)];
V = P(:,1) .* P(:,2) + rand(size(V))*0.1
F = scatteredInterpolant(P,V)
...

bumpy linear interpolation bumpy natural interpolation the natural interpolation looks "better", and i certainly don't see any unnatural dips that aren't there in the source data; after all, the weights to the surrounding datapoints always sums up to exactly 1. I can only assume something unexpected is happening to the datapoints outside the slice you showed, or the there is some bug in the code.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.