Skip to content Skip to sidebar Skip to footer

Unexpected Results From Scipy.interpolate.Rbf

I am getting some errors when interpolating with RBF. Here is an example in 1D. I think that it has to do with how close my y values are to each other. Is there any fix for this? i

Solution 1:

Indeed, when implemented properly, RBF interpolation using the polyharmonic spline r^3 in 1D coincides with the natural cubic spline, and is a "smoothest" interpolant.

Unfortunately, the scipy.interpolate.Rbf, despite the name, does not appear to be a correct implementation of the RBF methods known from the approximation theory. The error is around the line

self.nodes = linalg.solve(self.A, self.di)

They forgot the (linear) polynomial term in the construction of the polyharmonic RBF! The system should have been (2).

Now, one shouldn't trust interp1d blindly either. What algorithm used in interp1d function in scipy.interpolate suggests that it may not be using natural cubic spline but a different condition. No mentioning of it in the help page: one needs to go into the python source, and I'm afraid of what we will find there.

Is there a fix for this?

If it's a serious work, make your own implementation of the RBF interpolation algorithm. Or, if you want to try a different implementation in python, there is apparently one from the University of Michigan: https://rbf.readthedocs.io. If you do, could you post your findings here? If not, you've already did a good service by demonstrating an important SciPy error -- thank you!


Post a Comment for "Unexpected Results From Scipy.interpolate.Rbf"