help-octave
[Top][All Lists]

## Re: Interpolation on scattered data

 From: Augustin Lefèvre Subject: Re: Interpolation on scattered data Date: Mon, 16 Mar 2020 09:57:11 +0100 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

You can use 3-nearest neighbour interpolation :

$y = \frac\left\{1\right\}\left\{3\right\} \sum_\left\{j=1\right\}^3 y_j$

where j is the index of the three nearest neighbours (based on $x$ values)

or a weighted estimator :

$y = \frac\left\{\sum_\left\{j=1\right\}^n K\left(x,x_j\right) y_j\right\}\left\{\sum_\left\{j=1\right\}^n K\left(x,x_j\right)\right\}$

(careful, means the -th point in your data, so x(i,:) or x(:,i) in your code)

If you're trying to use mesh techniques, I guess you will prefer this solution : it's computationally less demanding, and it makes the interpolant function smooth.

In this case, when the density is high, and points "pile up", then the estimated will be averaged over those points : it's up to you to decide whether this corresponds to your model or not.

In the formula above, you can restrict to to the 3 nearest neighbours, or use the whole data set if you can afford the computational load.

For the radial basis function, you can use for instance a gaussian kernel :

if is low, the interpolant will be "blurry", if is high it will be "spiky".

On 12/03/2020 15:53, Nicklas Karlsson wrote:
I have some problem with interpolation on scattered data. griddata(...) or interp2(...) functions do not work well. Delaunay function could triangulate data but maybe not well in all cases.

I have function to find nearest points. Interpolate between the three nearest point should if I think correct be equal to interpolation on delaunay triangulation but me a little bit stupid and can't immidiately figure out the equation. Anyone have it at hand?

I however found two other very interesting functions here http://fourier.eng.hmc.edu/e176/lectures/ch7/node7.html called "Radial Basis Function Method" and "Shepard method". I am however a little bit uncertain what happen then density vary for example then many points are tightly spaced as I expect them to pile up. Anyone used any of these?

Regards Nicklas Karlsson