Hermite Interpolation: Week 10: Monday, Apr 2
Hermite Interpolation: Week 10: Monday, Apr 2
Hermite Interpolation: Week 10: Monday, Apr 2
(1) = f
(1) p
(1) = f
(1).
As with polynomial interpolation based just on function values, we can ex-
press the cubic that satises these conditions with respect to several dierent
bases: monomial, Lagrange, or Newton.
For the monomial basis, we have
p(x) = c
0
+ c
1
x + c
2
x
2
+ c
3
x
3
,
which yields the linear system
_
_
1 1 1 1
1 1 1 1
0 1 2 3
0 1 2 3
_
_
_
_
c
0
c
1
c
2
c
3
_
_
=
_
_
f(1)
f(1)
f
(1)
f
(1)
_
_
.
For the Newton basis, we have expressions like
p(x) = f[1]+f[1, 1](x+1)+f[1, 1, 1](x+1)
2
+f[1, 1, 1, 1](x+1)
2
(x1),
Bindel, Spring 2012 Intro to Scientic Computing (CS 3220)
where the divided dierences for f are
f[1] = f(1)
f[1] = f(1)
f[1, 1] = f
(1)
f[1, 1] = f
(1)
f[1, 1] = (f(1) f(1)) /2
f[1, 1, 1] = (f[1, 1] f[1, 1]) /2
f[1, 1, 1] = (f[1, 1] f[1, 1]) /2
f[1, 1, 1, 1] = (f[1, 1, 1] f[1, 1, 1]) /2.
We leave the Lagrange basis as a problem to ponder (or look up).
Piecewise polynomial approximations
Polynomials are convenient for interpolation for a few reasons: we know
how to manipulate them symbolically, we can evaluate them quickly, and
there is a theorem of analysis (the Weierstrass approximation theorem) that
says that any continuous function on some interval [a, b] can be uniformly
approximated by polynomials. In practice, though, high-degree polynomial
interpolation does not always provide fantastic function approximation. An
alternative approach that retains the advantages of working with polynomials
is to work with piecewise polynomial functions.
Piecewise linear interpolation
Perhaps the simplest example is piecewise linear interpolation; if function
values f(x
j
) are given at points x
1
< x
2
< x
3
< . . . < x
n
, then we write the
approximating function
f(x) as
f(x) =
f(x
j
)(x x
j
) + f(x
j+1
)(x
j+1
x)
x
j+1
x
j
, x [x
j
, x
j+1
].
Alternately, we can write
f(x) =
n
j=1
j
(x)f(x
j
)
Bindel, Spring 2012 Intro to Scientic Computing (CS 3220)
where
j
(x) is a hat function:
j
(x) =
_
_
(x x
j+1
)/(x
j
x
j+1
), x [x
j
, x
j+1
],
(x x
j1
)/(x
j
x
j1
), x [x
j1
, x
j
],
0 otherwise.
This last you may recognize as similar in spirit to using a basis of Lagrange
polynomials for polynomial interpolation.
Using piecewise linear interpolation to approximate a function f yields
O(h
2
) error (where h is the distance between interpolation points), assum-
ing f has two continuous derivatives. This level of accuracy is adequate for
many purposes. Beyond the basic error behavior, though, piecewise linear
interpolation has several virtues when structural properties are important.
For example, the maximum and minimum values of a piecewise linear inter-
polant are equal to the maximum and minimum values of the data. And if
f is positive or monotone (like a probability density or cumulative density
function), then any piecewise linear interpolant inherits these properties.
Piecewise cubic interpolation
If f is reasonably smooth and the data points are widely spaced, it may make
sense to use higher-order polynomials. For example, we might decide to use
a cubic spline
f(x) characterized by the properties:
Interpolation:
f(x
i
) = f(x
i
)
Twice dierentiability:
f
and
f
are continuous at {x
2
, . . . , x
n1
}
The interpolation and dierentiability constraints give us 4n 2 constraints
on the 4n-dimensional space of piecewise polynomial functions that are de-
ned by general cubics on each interval [x
j
, x
j+1
]. In order to uniquely de-
termine the spline, we need some additional constraint; common choices are
Specied values of f
at x
1
and x
n
(clamped conditions)
A natural spline: f
(x
1
) = f
(x
n
) = 0
Not-a-knot conditions: f
is continuous at x
2
and x
n1
Periodicity: f
(x
1
) = f
(x
n
), f
(x
1
) = f
(x
n
)
Bindel, Spring 2012 Intro to Scientic Computing (CS 3220)
For the clamped conditions and not-a-knot conditions, one has the error
bound
p f
cf
h
4
where
is the L