Documente Academic
Documente Profesional
Documente Cultură
Interpolating Functions
In the next series of lectures we will discuss methods for nding functions that best t a given set of data.
We shall call such functions interpolating functions, and we shall consider several dierent methods for
nding such functions. We shall begin this discussion with the problem of interpolating data by means of
polynomial functions.
1. Polynomial Interpolation
Consider the following problem:
Problem 15.1. Given a table of n + 1 distinct data points (x ; y ); i = 0; : : : ; n , nd a polynomial of P of
i
P (x ) = y 8 i
(15.1)
That this problem has a solution is fairly easy to see. For if we set
P(x) = a x + a ,1x ,1 + + a1 x + a0
then, so long as the x are all distinct, equations (15.1) will constitute a system of n+1 linearly independent
equations
(15.2)
(x0) a + (x0 ) ,1 a ,1 + + x0a1 + a0 = y0
(x1) a + (x1 ) ,1 a ,1 + + x1a1 + a0 = y1
..
.
(x ) a + (x ) ,1 a ,1 + + x a1 + a0 = y
for n + 1 unknowns a0; : : : ; a . (That these equations are linearly independent may not be immediately
obvious; but it follows from the fact that the monomials x , i = 0; : : : ; n are linearly independent functions.)
We can thus expect a unique solution of degree n.
n
n
n
n
n
The formal linear algebraic argument for the existence of solutions is, however, not really the best way to
nding a solution. For, it takes on the order of n3 operations to solve a linear system such as (15.1) on a
computer, if we had a million or so data points to t, we would need to carry out at least 1018 operations
to calculate a solution. While such a calculation might actually be feasible on modern hardware, there are
much better ways to procede.
This function clearly satises P0(x0 ) = y0 , but it won't satisfy P0 (x ) = y unless y = y0 . The next step
is to write down a function P1(x) that satises at least P1(x0 ) = y0 and P1(x1) = y1 . This can be had by
simply adding a term to P0
P1(x) = y0 + c1(x , x0)
and choosing c so that
, y0
P1(x1 ) = y1 ) c1 = xy1 ,
1 x0
Now we have a polynomial function that at least agrees with the data at two points. To create a function
that is correct for the rst three data points we set
P2 (x) = P1(x) + c2 (x , x0 ) (x , x1 )
and choose c so that
1 (x2)
y2 = P2(x2 ) ) c2 = (x y,2 x, )P(x
,x )
i
Note that the reason why this procedure words is that we have a function P1 (x) that is already correct at
the rst two points and we are adding to it a function that makes no contribution to the values at x0 and
x1 but which can be adjusted to correct value y2 at x2 .
Now suppose we have carried out this procedure to construct a (degree k) polynomial P (x) that replicates
the rst k data points. To obtain a polynomial function that replicates all the data points up to (x ; y )
we set
P (x) = P ,1(x) + c (x , x0 ) (x , x1 ) (x , x ,1)
where c is chosen so that P (x ) = y
y , P ,1(x )
) c = (x , x ) (x
, x1) (x , x ,1)
0
Clearly, so long as the points x , i = 0; : : : ; n are all distinct, there is no obstruction to this program and so
we'll be able to construct a polynomial P (x) of degress m n that interpolates the data (it could happen
that some of the numbers c = 0, that's why perhaps the degree of P (x) might be less than n).
Example 15.1. Find the Newton form of the interpolation polynomial for the following set of data
x0 = 0 y0 = ,1
x1 = 1 y1 = ,1
x2 = 2 y2 = 1
x3 = 3 y3 = 11
k
Set
Then
P0(x) = y0 = ,1
1 , P0(x) = ,1 , (,1) = 0
c1 = y(x
1,0
1 , x0 )
) P1(x) = P0(x) + c1(x , x0) = ,1 + 0 = ,1
P1(x) = 1 , (,1) = 1
c2 = (x ,y2x,)(x
2
1 2 , x0) (2 , 1)(2 , 0)
) P2 (x) = P1(x) + c2 (x , x0 )(x , x1 ) = ,1 + (x , 1)x
y3 , P2 (x)
11 , 5
c3 = (x , x )(x
= (3 , 2)(3
,
x
)(x
,
x
)
, 1)(3 , 0) = 1
3
2 3
1 3
0
) P3(x) = P2(x) + c3(x , x0)(x , x1)(x , x2) = ,1 + (x , 1)x + (x , 2)(x , 1)x
=0
,1
Y
X @
c
(x , x )A
n
=0
n
n
collect all the terms in the interpolation polynomial that are proportional to each of the y to obtain an
expression of the form
i
Now the polynomials ` (x) depend only on the variables data points x and not at all on their values y .
Therefore, by looking at special sets of potential data, we can gure out what they must be. For example,
suppose we x i and demand
i
(15.3)
y =
j
1 if i = j
0 if i 6= j
Then the interpolating polynomial for this set of data would look like
P(x) =
X
n
=0
y ` (x) = l (x)
j j
and so we could conclude that, since this polynomial interpolates the data (15.3)
0 = P(x ) = ` (x ) for all i 6= j
j
which tells us that ` (x) has n distinct roots x , i 2 f0; 1; : : : ; n j i 6= j g. Since the degree of ` (x) is at most
n, and because the trivial solution ` (x) is not allowed (otherwise P(x ) 6= 1), and because the interpolating
polynomial must be unique we can conclude that
i
l (x) =
i
Y (x , x )
j
=6 (x , x )
i
simply because it has the property that it interpolates the data (15.3).
Having identied the cardinal functions ` (x), we can now write
i
P(x) =
X
n
=0
0
1
X @Y (x , x ) A
y ` (x) = y
n
i i
=0
=6 (x , x )
i
This presentation of the interpolation polynomial is known as the Lagrange form of the interpolation
polynomial.
Example 15.4. Find the Lagrange form of the interpolation polynomial for the following set of data
x0 = 0
x1 = 1
x2 = 2
x3 = 3
y0 = ,1
y1 = ,1
y2 = 1
y3 = 11
The nal expression is the Lagrange form of the interpolation polynomial. While tedious, it is
nevertheless straightforward to verify that
, 2)(x , 3) x(x , 2)(x , 3) x(x , 1)(x , 3)
x(x , 1)(x , 2)
P (x) = , (x ,(,1)(x
1)(,2)(,3) , (1)(,1)(,2) + (2)(1)(,1) + (11) (3)(2)(1)
= x3 , 2x2 + x = 1
and so we recover the same interpolation polynomial as in the rst example.