Jump to content

Spline interpolation

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Qwfp (talk | contribs) at 14:39, 9 October 2011 (Introduction: reduce image width in line with MOS:IMAGES). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In the mathematical field 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. Spline interpolation avoids the problem of Runge's phenomenon which occurs when interpolating between equidistant points with high degree polynomials.

Introduction

Elastic rulers that were bent to pass through a number of predefined points (the "knots") were used for making technical drawings for shipbuilding and construction by hand, as illustrated by figure 1.

Figure 1: Interpolation with cubic splines between eight points. Hand-drawn technical drawings were made for ship-building etc. using flexible rulers that were bent to follow pre-defined points (the "knots")

The approach to mathematically model the shape of such elastic rulers fixed by n+1 "knots" is to interpolate between all the pairs of "knots" and with polynomials

The curvature of a curve

is

As the elastic ruler will take a shape that minimizes the bending under the constraint of passing through all "knots" both and will be continuous everywhere, also at the "knots". To achieve this one must have that

and that

for all i , . This can only be achieved if polynomials of degree 3 or higher are used. The classical approach is to use polynomials of degree 3, this is the case of "Cubic splines".

Algorithm to find the interpolating cubic spline

A third order polynomial for which

can be written in the symmetrical form

where

and


As one gets that

Setting and in (5) and (6) one gets from (2) that indeed , and that

If now

are n+1 points and

where

are n third degree polynomials interpolating in the interval , for such that

for

then the n polynomials together define a derivable function in the interval and

for where

If the sequence is such that in addition

for

the resulting function will even have a continuous second derivative.

From (7), (8), (10) and (11) follows that this is the case if and only if

for

The relations (15) are n-1 linear equations for the n+1 values .

For the elastic rulers being the model for the spline interpolation one has that to the left of the left-most "knot" and to the right of the right-most "knot" the ruler can move freely and will therefore take the form of a straight line with . As should be a continuous function of one gets that for "Natural Splines" one in addition to the n-1 linear equations (15) should have that

i.e. that

(15) together with (16) and (17) constitute n+1 linear equations that uniquely define the n+1 parameters

Example

Figure 2: Interpolation with cubic "natural" splines between three points.

In case of three points the values for are found by solving the linear equation system

with

For the three points

one gets that

and from (10) and (11) that

In figure 2 the spline function consisting of the two cubic polynomials and given by (9) is displayed


See also