A radial basis function is defined in relation to a fixed reference point.
The Rbf()
function also takes xs
and ys
as arguments and returns a callable function that can be used with new xs
.
Interpolate the given xs
and ys
using RBF and find the values for the range 2.1, 2.2, …, up to 2.9.
from scipy.interpolate import Rbf import numpy as np xs = np.arange(10) ys = xs**2 + np.sin(xs) + 1 interp_func = Rbf(xs, ys) newarr = interp_func(np.arange(2.1, 3, 0.1)) print(newarr) |
[6.25748981 6.62190817 7.00310702 7.40121814 7.8161443 8.24773402 8.69590519 9.16070828 9.64233874] |