# Class RBFInterpolation2D

java.lang.Object
smile.interpolation.RBFInterpolation2D
All Implemented Interfaces:
`Serializable`, `Interpolation2D`

public class RBFInterpolation2D extends Object implements Interpolation2D
Radial basis function interpolation is a popular method for the data points are irregularly distributed in space. In its basic form, radial basis function interpolation is in the form

y(x) = Σ wi φ(||x-ci||)

where the approximating function y(x) is represented as a sum of N radial basis functions φ, each associated with a different center ci, and weighted by an appropriate coefficient wi. For distance, one usually chooses Euclidean distance. The weights wi can be estimated using the matrix methods of linear least squares, because the approximating function is linear in the weights.

The points ci often called the centers or collocation points of the RBF interpolant. Note also that the centers ci can be located at arbitrary points in the domain, and do not require a grid. For certain RBF exponential convergence has been shown. Radial basis functions were successfully applied to problems as diverse as computer graphics, neural networks, for the solution of differential equations via collocation methods and many other problems.

Other popular choices for φ comprise the Gaussian function and the so-called thin plate splines. Thin plate splines result from the solution of a variational problem. The advantage of the thin plate splines is that their conditioning is invariant under scaling. Gaussians, multi-quadrics and inverse multi-quadrics are infinitely smooth and involve a scale or shape parameter, r0 `> 0`. Decreasing r0 tends to flatten the basis function. For a given function, the quality of approximation may strongly depend on this parameter. In particular, increasing r0 has the effect of better conditioning (the separation distance of the scaled points increases).

A variant on RBF interpolation is normalized radial basis function (NRBF) interpolation, in which we require the sum of the basis functions to be unity. NRBF arises more naturally from a Bayesian statistical perspective. However, there is no evidence that either the NRBF method is consistently superior to the RBF method, or vice versa.

• ## Constructor Summary

Constructors
Constructor
Description
```RBFInterpolation2D(double[] x1, double[] x2, double[] y, RadialBasisFunction rbf)```
Constructor.
```RBFInterpolation2D(double[] x1, double[] x2, double[] y, RadialBasisFunction rbf, boolean normalized)```
Constructor.
• ## Method Summary

Modifier and Type
Method
Description
`double`
```interpolate(double x1, double x2)```
Interpolate the data at a given 2-dimensional point.
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`
• ## Constructor Details

• ### RBFInterpolation2D

public RBFInterpolation2D(double[] x1, double[] x2, double[] y, RadialBasisFunction rbf)
Constructor. By default, it is a regular rbf interpolation without normalization.
Parameters:
`x1` - the 1st dimension of data points.
`x2` - the 2nd dimension of data points.
`y` - the function values at `(x1, x2)`.
`rbf` - the radial basis function used in the interpolation
• ### RBFInterpolation2D

public RBFInterpolation2D(double[] x1, double[] x2, double[] y, RadialBasisFunction rbf, boolean normalized)
Constructor.
Parameters:
`x1` - the 1st dimension of data points.
`x2` - the 2nd dimension of data points.
`y` - the function values at `(x1, x2)`.
`rbf` - the radial basis function used in the interpolation
`normalized` - true for the normalized RBF interpolation.
• ## Method Details

• ### interpolate

public double interpolate(double x1, double x2)
Description copied from interface: `Interpolation2D`
Interpolate the data at a given 2-dimensional point.
Specified by:
`interpolate` in interface `Interpolation2D`
Parameters:
`x1` - the 1st dimension value.
`x2` - the 2nd dimension value.
Returns:
the interpolated function value.
• ### toString

public String toString()
Overrides:
`toString` in class `Object`