Lecture 8
Lecture 8
Spring 2017
https://www.youtube.com/watch?v=LgodR7pwwW8
Quadratic splines
Cubic splines
Formal definition
I Assume f (xi ) = fi of the function f (x) at the points
x0 < x1 < . . . < xn .
I A cubic interpolating spline s(x) is a function on the interval
[x0 , xn ] satisfying
I s(x) is a cubic polynomial on each node-to-node interval
[xi , xi+1 ]
I s(xi ) = fi at each node xi
I the second order derivative s00 (x) exists and is continuous
throughout the entire interval [x0 , xn ]
I at the terminal nodes, s00 (x0 ) = s00 (xn ) = 0
I Cubic splines are derived from the physical laws that govern
bending of thin beams.
I An approximate solution of the minimum energy bending
equation, valid when the amount of bending is small.
Properties of spline
M = LDLT
where
1 ... 0
a1 1 ..
.
L=
.. ..
. .
..
.. ..
. .
.
0 ... an−2 1
and D is a diagonal matrix.
This enables efficient inverse of the matrix
σi σi+1
si (x) = (xi+1 − x)3 + (x − xi )3
6hi 6hi
fi+1 σi+1 hi fi σi hi
+ − (x − xi ) + − (xi+1 − x)
hi 6 hi 6
i = 0, 1, . . . , n − 1.
Minimum energy property
f (x) = sin(2x)/x.
Problem with fitting a global polynomial
Runge’s example
1
f (x) =
1 + x2
High order interpolation using a global polynomial often exhibit
these oscillations
yi = f (xi ) + i , i = 0, . . . , n
Jα (f ) = α(y − f )T W (y − f ) + (1 − α)f T QT M −1 Qf
where W = diag{w0 , . . . , wn }
I spline function s parameterized by f
I solution
λ = (1 − α)/α
I Define leave-one-out cost function, for 1 ≤ k ≤ n
n Z xn
(−k)
X
hλ (x) = arg min 2
wi [yi − s(xi )] + λ [s00 (x)]2 dx
s x0
i=0,i6=k
2
2.16
1.5
GCV( )
2.15
2.14
0.5
2.13
0
2.12 -0.5
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 -4 -3 -2 -1 0 1 2 3 4
x
Bi-cubic interpolation