Professional Documents
Culture Documents
Interpolation With Higher Order Polynomials Is Prone To The Runge Phenomenon
Interpolation With Higher Order Polynomials Is Prone To The Runge Phenomenon
1/27
Piecewise linear interpolation
2/27
Piecewise parabolic interpolation
3/27
Piecewise parabolic interpolation
3/27
Piecewise polynomials. Splines.
a = x0 ⩽ x1 ⩽ · · · ⩽ xm−1 ⩽ xm = b,
5/27
Piecewise cubic polynomials
Given
a = x0 < x1 < · · · < xm−1 < xm = b,
6/27
A single interval: a linear function
x − xa xb − x
p1 (x) = yb + ya
h h
where h = xb − xa .
7/27
A single interval: a cubic function
8/27
A single interval: a cubic function
(x − xa ) (xb − x) [ ]
p3 (x) = p1 (x) + A (x − xa ) + B (xb − x)
h h
8/27
9/27
A single interval: a cubic function
x = xa : sa = p′3 (xa ) = m + B
x = xb : sb = p′3 (xb ) = m − A
with
yb − ya
m= .
h
(x − xa ) (xb − x) [ ]
p3 (x) = p1 (x) + (m−sb ) (x−xa )+(sa −m) (xb −x)
h h
10/27
Cubic splines
11/27
Multiple intervals: a piecewise cubic function
Given
a = x0 < x1 < · · · < xm−1 < xm = b,
(x − xa ) (xb − x) [ ]
p3 (x) = p1 (x) + (m−sb ) (x−xa )+(sa −m) (xb −x)
h h
12/27
Multiple intervals: a piecewise cubic function
continuity : by construction
p3 (x) = p1 (x) + . . .
13/27
Multiple intervals: a piecewise cubic function
continuity : by construction
p3 (x) = p1 (x) + . . .
13/27
Multiple intervals: a piecewise cubic function
continuity : by construction
p3 (x) = p1 (x) + . . .
for k = 1, · · · , m.
sb − m
p′′3 (x) = − 2 [(xb − x) − 2(x − xa )]
h2
sa − m
−2 [2(xb − x) − (x − xa )]
h2
Thus
sb − m sa − m
p′′3 (xa ) = −2 −4
h h
′′ sb − m sa − m
p3 (xb ) = 4 +2
h h
14/27
Match second derivatives at breakpoints
hk = xk − xk−1
yk − yk−1
mk =
hk
15/27
Cubic splines
16/27
Cubic splines
16/27
Cubic splines: boundary conditions
17/27
Cubic spline interpolation: continuity
18/27
Approximation errors
19/27
Local piecewise interpolation
20/27
Piecewise polynomial interpolation
(x − xa ) (xb − x) [ ]
p3 (x) = p1 (x) + (m−sb ) (x−xa )+(sa −m) (xb −x)
h h
21/27
Cubic spline interpolation
▶ C 2 continuous on [a, b]
▶ Need two boundary conditions
▶ Construction is O(N )
22/27
Cubic spline interpolation
▶ C 2 continuous on [a, b]
▶ Need two boundary conditions
▶ Construction is O(N )
▶ Not guaranteed to be monotonic
23/27
Monotone interpolants
24/27
Monotone interpolants
PCHIP algorithm
Let hk = x+1 − xk , and
mk = (yk+1 − yk )/hk
25/27
Monotone piecewise cubic interpolant: PCHIP
26/27
Interpolation
▶ Smoothing splines
▶ Computer graphics, CAD, animation
▶ Image processing, computer vision
27/27