In the mathematical subfield of numerical analysis, spline interpolation is a form of interpolation where the interpolant is a special type of piecewise polynomial called a spline. Spline interpolation is preferred over polynomial interpolation because the interpolation error can be made small even when using low degree polynomials for the spline. Thus, spline interpolation avoids the problem of Runge's phenomenon which occurs when using high degree polynomials.
Given n+1 distinct knots xi such that
with n+1 knot values yi we are trying to find a spline function of degree n
with each Si(x) a polynomial of degree k.
Using polynomial interpolation, the polynomial of degree n which interpolates the data set is uniquely defined by the data points. The spline of degree n which interpolates the same data set is not uniquely defined, and we have to fill in n-1 additional degrees of freedom to construct a unique spline interpolant.
Linear spline interpolation is the simplest form of spline interpolation. The data points are graphically connected by straight lines. The resultant spline is just a polygon.
Algebraically, each Si is a linear function constructed as
The spline must be continuous at each data point, that is
This is the case as we can easily see
The quadratic spline can be constructed as
The coefficients can be found by choosing a and then using the recurrence relation:
For the n cubic polynomials comprising S, this means to determine these polynomials, we need to determine 4n conditions (since for one polynomial of degree three, there are four conditions on choosing the curve). However, the interpolating property gives us n + 1 conditions, and the conditions on the interior data points give us n + 1 − 2 = n − 1 data points each, summing to 4n − 2 conditions. We require two other conditions, and these can be imposed upon the problem for different reasons.
One such choice results in the so-called clamped cubic spline, with
Alternately, we can set
Amongst all twice continuously differentiable functions, clamped and natural cubic splines yield the least oscillation about the function f which is interpolated.
Another choice gives the periodic cubic spline if
Another choice gives the complete cubic spline if
The functional contains an approximation of the total curvature of the graph of and then the spline is the approximation of with minimal curvature, and then is the more well looking psychologically.
Since the total energy of an elastic strip is proportional to the curvature, the spline is the configuration of minimal energy of an elastic strip constrained to points. A spline is also an instrument to design based on an elastic strip.
It can be defined as
and
The coefficients can be found by solving this system of equations:
h_{i-1} z_{i-1} + 2(h_{i-1} + h_i) z_i + h_i z_{i+1}
= 6 \left( \frac{y_{i+1}-y_i}{h_i} - \frac{y_i-y_{i-1}}{h_{i-1}} \right) \\
z_n = 0 \end{matrix}\right.
Consider the problem of finding a linear spline for
After directly applying the spline formula, we get the following spline:
The spline function (blue lines) and the function it is approximating (red dots) are graphed below:
The graph below is an example of a spline function (blue lines) and the function it is approximating (red lines) for k=4:
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Spline interpolation".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world