In numerical analysis, polynomial interpolation is the interpolation of a given data set by the polynomial of lowest possible degree that passes through the points in the dataset.
Given a set of data points , with no two the same, a polynomial function is said to interpolate the data if for each .
There is always a unique such polynomial, commonly given by two explicit formulas, the Lagrange polynomials and Newton polynomials.
Applications The original use of interpolation polynomials was to approximate values of important transcendental functions such as natural logarithm and trigonometric functions. Starting with a few accurately computed data points, the corresponding interpolation polynomial will approximate the function at an arbitrary nearby point. Polynomial interpolation also forms the basis for algorithms in numerical quadrature (Simpson's rule) and numerical ordinary differential equations (multigrid methods).
In computer graphics, polynomials can be used to approximate complicated plane curves given a few specified points, for example the shapes of letters in typography. This is usually done with Bézier curves, which are a simple generalization of interpolation polynomials (having specified tangents as well as specified points).
In numerical analysis, polynomial interpolation is essential to perform sub-quadratic multiplication and squaring, such as Karatsuba multiplication and Toom–Cook multiplication, where interpolation through points on a product polynomial yields the specific product required. For example, given a = f(x) = a0x0 + a1x1 + ··· and b = g(x) = b0x0 + b1x1 + ···, the product ab is a specific value of W(x) = f(x)g(x). One may easily find points along W(x) at small values of x, and interpolation based on those points will yield the terms of W(x) and the specific product ab. As fomulated in Karatsuba multiplication, this technique is substantially faster than quadratic multiplication, even for modest-sized inputs, especially on parallel hardware.
In computer science, polynomial interpolation also leads to algorithms for secure multi party computation and secret sharing.
Interpolation theorem For any bivariate data points , where no two are the same, there exists a unique polynomial of degree at most that interpolates these points, i.e. .
Equivalently, for a fixed choice of interpolation nodes , polynomial interpolation defines a linear bijection between the (n+1)-tuples of real-number values and the vector space of real polynomials of degree at most n:
This is a type of unisolvence theorem. The theorem is also valid over any infinite field in place of the real numbers , for example the rational or complex numbers.
First proof Consider the Lagrange basis functions given by:
Notice that is a polynomial of degree , and we have for each , while . It follows that the linear combination:
has , so is an interpolating polynomial of degree .
To prove uniqueness, assume that there exists another interpolating polynomial of degree at most , so that for all . Then is a polynomial of degree at most which has distinct zeros (the ). But a non-zero polynomial of degree at most can have at most zeros, so must be the zero polynomial, i.e. .
Second proof Write out the interpolation polynomial in the form
Substituting this into the interpolation equations , we get a system of linear equations in the coefficients , which reads in matrix-vector form as the following multiplication:
An interpolant corresponds to a solution of the above matrix equation . The matrix X on the left is a Vandermonde matrix, whose determinant is known to be which is non-zero since the nodes are all distinct. This ensures that the matrix is invertible and the equation has the unique solution ; that is, exists and is unique.
Corollary If is a polynomial of degree at most , then the interpolating polynomial of at distinct points is itself.
Constructing the interpolation polynomial
Lagrange interpolation
We may write down the polynomial immediately in terms of Lagrange polynomials as: For matrix arguments, this formula is called Sylvester's formula and the matrix-valued Lagrange polynomials are the Frobenius covariants.
Newton interpolation
Theorem For a polynomial of degree less than or equal to , that interpolates at the nodes where . Let be the polynomial of degree less than or equal to that interpolates at the nodes where . Then is given by:where also known as Newton basis and .
Proof:
This can be shown for the case where :and when :By the uniqueness of interpolated polynomials of degree less than , is the required polynomial interpolation. The function can thus be expressed as:
Polynomial coefficients To find , we have to solve the lower triangular matrix formed by arranging from above equation in matrix form:
The coefficients are derived as
where
is the notation for divided differences. Thus, Newton polynomials are used to provide a polynomial interpolation formula of n points.
ProofThe first few coefficients can be calculated using the system of equations. The form of n-th coefficient is assumed for proof by mathematical induction.
Let Q be polynomial interpolation of points . Adding to the polynomial Q:
where . By uniqueness of the interpolating polynomial of the points , equating the coefficients of we get, .
Hence the polynomial can be expressed as:
Adding to the polynomial Q, it has to satisfiy: where the formula for and interpolating polynomial are used. The term for the polynomial can be found by calculating:which implies that .
Hence it is proved by principle of mathematical induction.
Newton forward formula The Newton polynomial can be expressed in a simplified form when are arranged consecutively with equal spacing.
If are consecutively arranged and equally spaced with for i = 0, 1, ..., k and some variable x is expressed as , then the difference can be written as . So the Newton polynomial becomes
Since the relationship between divided differences and forward differences is given as:Taking , if the representation of x in the previous sections was instead taken to be , the Newton forward interpolation formula is expressed as:which is the interpolation of all points after . It is expanded as:
Newton backward formula If the nodes are reordered as , the Newton polynomial becomes
If are equally spaced with for i = 0, 1, ..., k and , then,
Since the relationship between divided differences and backward differences is given as:taking , if the representation of x in the previous sections was instead taken to be , the Newton backward interpolation formula is expressed as:which is the interpolation of all points before . It is expanded as:
Lozenge diagram A Lozenge diagram is a diagram that is used to describe different interpolation formulas that can be constructed for a given data set. A line starting on the left edge and tracing across the diagram to the right can be used to represent an interpolation formula if the following rules are followed:
Left to right steps indicate addition whereas right to left steps indicate subtraction If the slope of a step is positive, the term to be used is the product of the difference and the factor immediately below it. If the slope of a step is negative, the term to be used is the product of the difference and the factor immediately above it. If a step is horizontal and passes through a factor, use the product of the factor and the average of the two terms immediately above and below it. If a step is horizontal and passes through a difference, use the product of the difference and the average of the two terms immediately above and below it.
The factors are expressed using the formula:
Proof of equivalence If a path goes from to , it can connect through three intermediate steps, (a) through , (b) through or (c) through . Proving the equivalence of these three two-step paths should prove that all (n-step) paths can be morphed with the same starting and ending, all of which represents the same formula.
Path (a):
Path (b):
Path (c):
Subtracting contributions from path a and b:
Thus, the contribution of either path (a) or path (b) is the same. Since path (c) is the average of path (a) and (b), it also contributes identical function to the polynomial. Hence the equivalence of paths with same starting and ending points is shown. To check if the paths can be shifted to different values in the leftmost corner, taking only two step paths is sufficient: (a) to through or (b) factor between and , to through or (c) starting from .
Path (a)
Path (b)
Path (c)
Since , substituting in the above equations shows that all the above terms reduce to and are hence equivalent. Hence these paths can be morphed to start from the leftmost corner and end in a common point.
Newton formula Taking negative slope transversal from to gives the interpolation formula of all the consecutively arranged points, equivalent to Newton's forward interpolation formula:
whereas, taking positive slope transversal from to , gives the interpolation formula of all the consecutively arranged points, equivalent to Newton's backward interpolation formula:
where is the number corresponding to that introduced in Newton interpolation.
Gauss formula Taking a zigzag line towards the right starting from with negative slope, we get Gauss forward formula:
whereas starting from with positive slope, we get Gauss backward formula:
Stirling formula By taking a horizontal path towards the right starting from , we get Stirling formula:
Stirling formula is the average of Gauss forward and Gauss backward formulas.
Bessel formula By taking a horizontal path towards the right starting from factor between and , we get Bessel formula:
Vandermonde algorithms The Vandermonde matrix in the second proof above may have large condition number, causing large errors when computing the coefficients if the system of equations is solved using Gaussian elimination.
Several authors have therefore proposed algorithms which exploit the structure of the Vandermonde matrix to compute numerically stable solutions in O(n2) operations instead of the O(n3) required by Gaussian elimination. These methods rely on constructing first a Newton interpolation of the polynomial and then converting it to a monomial form.
Non-Vandermonde algorithms To find the interpolation polynomial p(x) in the vector space P(n) of polynomials of degree , we may use the usual monomial basis for P(n) and invert the Vandermonde matrix by Gaussian elimination, giving a computational cost of O(n3) operations. To improve this algorithm, a more convenient basis for P(n) can simplify the calculation of the coefficients, which must then be translated back in terms of the monomial basis.
One method is to write the interpolation polynomial in the Newton form (i.e. using Newton basis) and use the method of divided differences to construct the coefficients, e.g. Neville's algorithm. The cost is O(n2) operations. Furthermore, you only need to do O(n) extra work if an extra point is added to the data set, while for the other methods, you have to redo the whole computation.
Another method is preferred when the aim is not to compute the coefficients of p(x), but only a single value p(a) at a point x = a not in the original data set. The Lagrange form computes the value p(a) with complexity O(n2).R.Bevilaqua, D. Bini, M.Capovani and O. Menchi (2003). Appunti di Calcolo Numerico. Chapter 5, p. 89. Servizio Editoriale Universitario Pisa - Azienda Regionale Diritto allo Studio Universitario.
The Bernstein form was used in a constructive proof of the Weierstrass approximation theorem by Bernstein and has gained great importance in computer graphics in the form of Bézier curves.
Interpolations as linear combinations of values