Let and let be 15 equally spaced points on the interval. We will form where is a radial basis function, and choose such that . In matrix notation this can be written as Choosing, the Gaussian, with a shape parameter of, we can then solve the matrix equation for the weights and plot the interpolant. Plotting the interpolating function below, we see that it is visually the same everywhere except near the left boundary, where it is still a very close approximation. More precisely the maximum error is roughly.
Motivation
The Mairhuber–Curtis theorem says that for any open set in with, and linearly independent functions on, there exists a set of points in the domain such that the interpolation matrix is singular. This means that if one wishes to have a general interpolation algorithm, one must choose the basis functions to depend on the interpolation points. In 1971, Rolland Hardy developed a method of interpolating scattered data using interpolants of the form. This is interpolation using a basis of shifted multiquadric functions, now more commonly written as, and is the first instance of radial basis function interpolation. It has been shown that the resulting interpolation matrix will always be non-singular. This does not violate the Mairhuber–Curtis theorem since the basis functions depend on the points of interpolation. Choosing a radial kernel such that the interpolation matrix is non-singular is exactly the definition of a radial basis function. It has been shown that any function that is completely monotone will have this property, including the Gaussian, inverse quadratic, and inverse multiquadric functions.
Shape-parameter tuning
Many radial basis functions have a parameter that controls their relative flatness or peakedness. This parameter is usually represented by the symbol with the function becoming increasingly flat as. For example, Rolland Hardy used the formula for the multiquadric, however nowadays the formula is used instead. These formulas are equivalent up to a scale factor. This factor is inconsequential since the basis vectors have the same span and the interpolation weights will compensate. By convention, the basis function is scaled such that as seen in the plots of the Gaussian functions and the bump functions. A consequence of this choice, is that the interpolation matrix approaches the identity matrix as leading to stability when solving the matrix system. The resulting interpolant will in general be a poor approximation to the function since it will be near zero everywhere, except near the interpolation points where it will sharply peak the so-called "bed-of-nails interpolant". On the opposite side of the spectrum, the condition number of the interpolation matrix will diverge to infinity as leading to ill-conditioning of the system. In practice, one chooses a shape parameter so that the interpolation matrix is "on the edge of ill-conditioning". There are sometimes other factors to consider when choosing a shape-parameter. For example the bump function has a compact support leading to a sparse interpolation matrix. Some radial basis functions such as the polyharmonic splines have no shape-parameter.