bundles / scipy 1.17.1 / scipy / interpolate / _rbf / Rbf
class
scipy.interpolate._rbf:Rbf
source: /scipy/interpolate/_rbf.py :56
Members
Summary
Class for radial basis function interpolation of functions from N-D scattered data to an M-D domain (legacy).
Parameters
*args: arraysx, y, z, ..., d, where x, y, z, ... are the coordinates of the nodes and d is the array of values at the nodes
function: str or callable, optionalThe radial basis function, based on the radius, r, given by the norm (default is Euclidean distance); the default is 'multiquadric'
'multiquadric': sqrt((r/self.epsilon)**2 + 1) 'inverse': 1.0/sqrt((r/self.epsilon)**2 + 1) 'gaussian': exp(-(r/self.epsilon)**2) 'linear': r 'cubic': r**3 'quintic': r**5 'thin_plate': r**2 * log(r)
If callable, then it must take 2 arguments (self, r). The epsilon parameter will be available as self.epsilon. Other keyword arguments passed in will be available as well.
epsilon: float, optionalAdjustable constant for gaussian or multiquadrics functions - defaults to approximate average distance between nodes (which is a good start).
smooth: float, optionalValues greater than zero increase the smoothness of the approximation. 0 is for interpolation (default), the function will always go through the nodal points in this case.
norm: str, callable, optionalA function that returns the 'distance' between two points, with inputs as arrays of positions (x, y, z, ...), and an output as an array of distance. E.g., the default: 'euclidean', such that the result is a matrix of the distances from each point in
x1to each point inx2. For more options, see documentation ofscipy.spatial.distances.cdist.mode: str, optionalMode of the interpolation, can be '1-D' (default) or 'N-D'. When it is '1-D' the data
dwill be considered as 1-D and flattened internally. When it is 'N-D' the datadis assumed to be an array of shape (n_samples, m), where m is the dimension of the target domain.
Attributes
N: intThe number of data points (as determined by the input arrays).
di: ndarrayThe 1-D array of data values at each of the data coordinates xi.
xi: ndarrayThe 2-D array of data coordinates.
function: str or callableThe radial basis function. See description under Parameters.
epsilon: floatParameter used by gaussian or multiquadrics functions. See Parameters.
smooth: floatSmoothing parameter. See description under Parameters.
norm: str or callableThe distance function. See description under Parameters.
mode: strMode of the interpolation. See description under Parameters.
nodes: ndarrayA 1-D array of node values for the interpolation.
A: internal property, do not use
Notes
Array API Standard Support
Rbf is not in-scope for support of Python Array API Standard compatible backends other than NumPy.
See dev-arrayapi for more information.
Examples
import numpy as np from scipy.interpolate import Rbf rng = np.random.default_rng() x, y, z, d = rng.random((4, 50)) rbfi = Rbf(x, y, z, d) # radial basis function interpolator instance xi = yi = zi = np.linspace(0, 1, 20) di = rbfi(xi, yi, zi) # interpolated values di.shape✓
See also
Aliases
-
scipy.interpolate.Rbf