help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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=13j=13yjy = \frac{1}{3} \sum_{j=1}^3 y_j

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

or a weighted estimator :

y=j=1nK(x,xj)yjj=1nK(x,xj)y = \frac{\sum_{j=1}^n K(x,x_j) y_j}{\sum_{j=1}^n K(x,x_j)} 

(careful, $x_i$ means the $i$-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 $y$ 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 $j$ 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 :
$K(x,x_i) = \exp(-\frac{\|x-x_i\|^2}{2 c^2})$

if $c$ is low, the interpolant will be "blurry", if $c$ 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]