In the mathematical field of numerical analysis, a Newton polynomial, named after its inventor Isaac Newton,[1] is an interpolation polynomial for a given set of data points. The Newton polynomial is sometimes called Newton's divided differences interpolation polynomial because the coefficients of the polynomial are calculated using Newton's divided differences method.
Given a set of k + 1 data points
(x0,y0),\ldots,(xj,yj),\ldots,(xk,yk)
where no two xj are the same, the Newton interpolation polynomial is a linear combination of Newton basis polynomials
N(x):=
k | |
\sum | |
j=0 |
ajnj(x)
with the Newton basis polynomials defined as
nj(x):=
j-1 | |
\prod | |
i=0 |
(x-xi)
for j > 0 and
n0(x)\equiv1
The coefficients are defined as
aj:=[y0,\ldots,yj]
where
[y0,\ldots,yj]
is the notation for divided differences.
Thus the Newton polynomial can be written as
N(x)=[y0]+[y0,y1](x-x0)+ … +[y0,\ldots,yk](x-x0)(x-x1) … (x-xk-1).
The Newton polynomial can be expressed in a simplified form when
x0,x1,...,xk
If
x0,x1,...,xk
{x}i={x}0+ih
{x}={x}0+sh
x-xi
(s-i)h
\begin{align} N(x)&=[y0]+[y0,y1]sh+ … +[y0,\ldots,yk]s(s-1) … (s-k+1){h}k\\ &=
k | |
\sum | |
i=0 |
s(s-1) … (s-i+1){h}i[y0,\ldots,yi]\\ &=
k | |
\sum | |
i=0 |
{s\choosei}i!{h}i[y0,\ldots,yi]. \end{align}
This is called the Newton forward divided difference formula.
If the nodes are reordered as
{x}k,{x}k-1,...,{x}0
N(x)=[yk]+[{y}k,{y}k-1](x-{x}k)+ … +[{y}k,\ldots,{y}0](x-{x}k)(x-{x}k-1) … (x-{x}1).
If
{x}k, {x}k-1, ..., {x}0
{x}i={x}k-(k-i)h
{x}={x}k+sh
\begin{align} N(x)&=[{y}k]+[{y}k,{y}k-1]sh+ … +[{y}k,\ldots,{y}0]s(s+1) … (s+k-1){h}k
k | |
\\ &=\sum | |
i=0 |
{(-1)}i{-s\choosei}i!{h}i[{y}k,\ldots,{y}k-i]. \end{align}
This is called the Newton backward divided difference formula.
Newton's formula is of interest because it is the straightforward and natural differences-version of Taylor's polynomial. Taylor's polynomial tells where a function will go, based on its y value, and its derivatives (its rate of change, and the rate of change of its rate of change, etc.) at one particular x value. Newton's formula is Taylor's polynomial based on finite differences instead of instantaneous rates of change.
See main article: Polynomial interpolation. For a polynomial
pn
f
xi
i=0,1,2,3, … ,n
pn+1
f
xi
i=0,1,2,3, … ,n,n+1
pn+1
where and .
Proof:
This can be shown for the case where
i=0,1,2,3, … ,n
i=n+1
By the uniqueness of interpolated polynomials of degree less than
n+1
where the factors
ai
Taking
yi=f(xi)
x=xj+sh
As with other difference formulas, the degree of a Newton interpolating polynomial can be increased by adding more terms and points without discarding existing ones. Newton's form has the simplicity that the new points are always added at one end: Newton's forward formula can add new points to the right, and Newton's backward formula can add new points to the left.
The accuracy of polynomial interpolation depends on how close the interpolated point is to the middle of the x values of the set of points used. Obviously, as new points are added at one end, that middle becomes farther and farther from the first data point. Therefore, if it isn't known how many points will be needed for the desired accuracy, the middle of the x-values might be far from where the interpolation is done.
Gauss, Stirling, and Bessel all developed formulae to remedy that problem.[4]
Gauss's formula alternately adds new points at the left and right ends, thereby keeping the set of points centered near the same place (near the evaluated point). When so doing, it uses terms from Newton's formula, with data points and x values renamed in keeping with one's choice of what data point is designated as the x0 data point.
Stirling's formula remains centered about a particular data point, for use when the evaluated point is nearer to a data point than to a middle of two data points.
Bessel's formula remains centered about a particular middle between two data points, for use when the evaluated point is nearer to a middle than to a data point.
Bessel and Stirling achieve that by sometimes using the average of two differences, and sometimes using the average of two products of binomials in x, where Newton's or Gauss's would use just one difference or product. Stirling's uses an average difference in odd-degree terms (whose difference uses an even number of data points); Bessel's uses an average difference in even-degree terms (whose difference uses an odd number of data points).
For any given finite set of data points, there is only one polynomial of least possible degree that passes through all of them. Thus, it is appropriate to speak of the "Newton form", or Lagrange form, etc., of the interpolation polynomial. However, different methods of computing this polynomial can have differing computational efficiency. There are several similar methods, such as those of Gauss, Bessel and Stirling. They can be derived from Newton's by renaming the x-values of the data points, but in practice they are important.
The choice between Bessel and Stirling depends on whether the interpolated point is closer to a data point, or closer to a middle between two data points.
A polynomial interpolation's error approaches zero, as the interpolation point approaches a data-point. Therefore, Stirling's formula brings its accuracy improvement where it is least needed and Bessel brings its accuracy improvement where it is most needed.
So, Bessel's formula could be said to be the most consistently accurate difference formula, and, in general, the most consistently accurate of the familiar polynomial interpolation formulas.
Lagrange is sometimes said to require less work, and is sometimes recommended for problems in which it is known, in advance, from previous experience, how many terms are needed for sufficient accuracy.
The divided difference methods have the advantage that more data points can be added, for improved accuracy. The terms based on the previous data points can continue to be used. With the ordinary Lagrange formula, to do the problem with more data points would require re-doing the whole problem.
There is a "barycentric" version of Lagrange that avoids the need to re-do the entire calculation when adding a new data point. But it requires that the values of each term be recorded.
But the ability, of Gauss, Bessel and Stirling, to keep the data points centered close to the interpolated point gives them an advantage over Lagrange, when it isn't known, in advance, how many data points will be needed.
Additionally, suppose that one wants to find out if, for some particular type of problem, linear interpolation is sufficiently accurate. That can be determined by evaluating the quadratic term of a divided difference formula. If the quadratic term is negligible—meaning that the linear term is sufficiently accurate without adding the quadratic term—then linear interpolation is sufficiently accurate. If the problem is sufficiently important, or if the quadratic term is nearly big enough to matter, then one might want to determine whether the sum of the quadratic and cubic terms is large enough to matter in the problem.
Of course, only a divided-difference method can be used for such a determination.
For that purpose, the divided-difference formula and/or its x0 point should be chosen so that the formula will use, for its linear term, the two data points between which the linear interpolation of interest would be done.
The divided difference formulas are more versatile, useful in more kinds of problems.
The Lagrange formula is at its best when all the interpolation will be done at one x value, with only the data points' y values varying from one problem to another, and when it is known, from past experience, how many terms are needed for sufficient accuracy.
With the Newton form of the interpolating polynomial a compact and effective algorithm exists for combining the terms to find the coefficients of the polynomial.[5]
When, with Stirling's or Bessel's, the last term used includes the average of two differences, then one more point is being used than Newton's or other polynomial interpolations would use for the same polynomial degree. So, in that instance, Stirling's or Bessel's is not putting an N−1 degree polynomial through N points, but is, instead, trading equivalence with Newton's for better centering and accuracy, giving those methods sometimes potentially greater accuracy, for a given polynomial degree, than other polynomial interpolations.
For the special case of xi = i, there is a closely related set of polynomials, also called the Newton polynomials, that are simply the binomial coefficients for general argument. That is, one also has the Newton polynomials
pn(z)
pn(z)={z\choosen}=
z(z-1) … (z-n+1) | |
n! |
In this form, the Newton polynomials generate the Newton series. These are in turn a special case of the general difference polynomials which allow the representation of analytic functions through generalized difference equations.
Solving an interpolation problem leads to a problem in linear algebra where we have to solve a system of linear equations. Using a standard monomial basis for our interpolation polynomial we get the very complicated Vandermonde matrix. By choosing another basis, the Newton basis, we get a system of linear equations with a much simpler lower triangular matrix which can be solved faster.
For k + 1 data points we construct the Newton basis as
n0(x):=1, nj(x):=
j-1 | |
\prod | |
i=0 |
(x-xi) j=1,\ldots,k.
Using these polynomials as a basis for
\Pik
\begin{bmatrix} 1&&\ldots&&0\\ 1&x1-x0&&&\\ 1&x2-x0&(x2-x0)(x2-x1)&&\vdots\\ \vdots&\vdots&&\ddots&\\ 1&xk-x0&\ldots&\ldots&
k-1 | |
\prod | |
j=0 |
(xk-xj) \end{bmatrix} \begin{bmatrix}a0\ \ \vdots\ \ ak\end{bmatrix}= \begin{bmatrix}y0\ \ \vdots\ \ yk\end{bmatrix}
to solve the polynomial interpolation problem.
This system of equations can be solved iteratively by solving
j | |
\sum | |
i=0 |
aini(xj)=yj j=0,...,k.
While the interpolation formula can be found by solving a linear system of equations, there is a loss of intuition in what the formula is showing and why Newton's interpolation formula works is not readily apparent. To begin, we will need to establish two facts first:
Fact 1. Reversing the terms of a divided difference leaves it unchanged:
[y0,\ldots,yn]=[yn,\ldots,y0].
n=1
n+1
n+2
We formulate next Fact 2 which for purposes of induction and clarity we also call Statement
n
Stmn
Fact 2. (
Stmn
(x0,y0),\ldots,(xn-1,yn-1)
n
x
P=P(x)
n-1
n
Proof. (It will be helpful for fluent reading of the proof to have the precise statement and its subtlety in mind:
P
(x0,y0),...,(xn-1,yn-1)
(xn,yn)
x
xi
We again prove these statements by induction.To show
Stm1,
(x0,y0)
P(x)
(x0,y0)
P(x)=y0
Proof of
Stmn+1,
Stmn
P(x)
n
(x0,y0),\ldots,(xn,yn).
With
Q(x)
n-1
(x1,y1),\ldots,(xn,yn)
n
Q
The induction hypothesis for
Q
(x0,y0)
Q
Now look at
Q(x)+[y0,\ldots,yn](x-x1) ⋅ \ldots ⋅ (x-xn).
Q
(x1,y1),...,(xn,yn)
(x0,y0).
\leqn
P(x);
P(x)=Q(x)+[y0,\ldots,yn](x-x1) ⋅ \ldots ⋅ (x-xn).
Thus we can write the last line in the first chain of equalities as `
yn+1-P(xn+1)
Stmn+1
Now look at Fact 2: It can be formulated this way: If
P
n-1
(x0,y0),...,(xn-1,yn-1),
P(x)+[y0,\ldots,yn](x-x0) ⋅ \ldots ⋅ (x-xn-1)
n
(x0,y0),...,(xn-1,yn-1),(xn,yn).
The limit of the Newton polynomial if all nodes coincide is a Taylor polynomial, because the divided differences become derivatives.
As can be seen from the definition of the divided differences new data points can be added to the data set to create a new interpolation polynomial without recalculating the old coefficients. And when a data point changes we usually do not have to recalculate all coefficients. Furthermore, if the xi are distributed equidistantly the calculation of the divided differences becomes significantly easier. Therefore, the divided-difference formulas are usually preferred over the Lagrange form for practical purposes.
The divided differences can be written in the form of a table. For example, for a function f is to be interpolated on points
x0,\ldots,xn
\begin{matrix} x0&f(x0)&&\\ &&{f(x1)-f(x0)\overx1-x0}&\\ x1&f(x1)&&{{f(x2)-f(x1)\overx2-x1}-{f(x1)-f(x0)\overx1-x0}\overx2-x0}\\ &&{f(x2)-f(x1)\overx2-x1}&\\ x2&f(x2)&&\vdots\\ &&\vdots&\\ \vdots&&&\vdots\\ &&\vdots&\\ xn&f(xn)&&\\ \end{matrix}
For example, suppose we are to construct the interpolating polynomial to f(x) = tan(x) using divided differences, at the points
n | xn | f(xn) | |
---|---|---|---|
0 | -\tfrac{3}{2} | -14.1014 | |
1 | -\tfrac{3}{4} | -0.931596 | |
2 | 0 | 0 | |
3 | \tfrac{3}{4} | 0.931596 | |
4 | \tfrac{3}{2} | 14.1014 |
Using six digits of accuracy, we construct the table
\begin{matrix} -\tfrac{3}{2}&-14.1014&&&&\\ &&17.5597&&&\\ -\tfrac{3}{4}&-0.931596&&-10.8784&&\\ &&1.24213&&4.83484&\\ 0&0&&0&&0\\ &&1.24213&&4.83484&\\ \tfrac{3}{4}&0.931596&&10.8784&&\\ &&17.5597&&&\\ \tfrac{3}{2}&14.1014&&&&\\ \end{matrix}
\begin{align} &-14.1014+17.5597(x+\tfrac{3}{2})-10.8784(x+\tfrac{3}{2})(x+\tfrac{3}{4})+4.83484(x+\tfrac{3}{2})(x+\tfrac{3}{4})(x)+0(x+\tfrac{3}{2})(x+\tfrac{3}{4})(x)(x-\tfrac{3}{4})\\ ={}&-0.00005-1.4775x-0.00001x2+4.83484x3 \end{align}
Another example:
The sequence
f0
f0(1)=6,f0(2)=9,f0(3)=2
f0(4)=5
6,9,2,5
x0=1
x3=4
You obtain the slope of order
1
f1(x0,x1)=
f0(x1)-f0(x0) | |
x1-x0 |
=
9-6 | |
2-1 |
=3
f1(x1,x2)=
f0(x2)-f0(x1) | |
x2-x1 |
=
2-9 | |
3-2 |
=-7
f1(x2,x3)=
f0(x3)-f0(x2) | |
x3-x2 |
=
5-2 | |
4-3 |
=3
As we have the slopes of order
1
f2(x0,x1,x2)=
f1(x1,x2)-f1(x0,x1) | |
x2-x0 |
=
-7-3 | |
3-1 |
=-5
f2(x1,x2,x3)=
f1(x2,x3)-f1(x1,x2) | |
x3-x1 |
=
3-(-7) | |
4-2 |
=5
Finally, we define the slope of order
3
f3(x0,x1,x2,x3)=
f2(x1,x2,x3)-f2(x0,x1,x2) | |
x3-x0 |
=
5-(-5) | |
4-1 |
=
10 | |
3 |
Once we have the slope, we can define the consequent polynomials:
p0(x)=6
p1(x)=6+3(x-1)
p2(x)=6+3(x-1)-5(x-1)(x-2)
p3(x)=6+3(x-1)-5(x-1)(x-2)+
10 | |
3 |
(x-1)(x-2)(x-3)