Least Squares Splines Approximation

4.4.4 Least Squares Splines Approximation

In some application we are given function values f j = f (x j ) , j = 1 : n, that we want to approximate with a spline functions with much fewer knots so that m + k − 1 ≤ n.

Then (4.4.49) is an overdetermined linear system and the interpolation conditions cannot

be satisfied exactly. We therefore consider the linear least squares spline approximation problem:

i =−k+1

4.4. Piecewise Polynomial Interpolation 435 Using the same notation as above this can be written in matrix form as

(4.4.53) The matrix A will have full column rank equal to m + k − 1 if and only if there is a subset

min

of points τ j satisfying the Schoenberg–Whitney conditions (4.4.51). If A has full column rank, then the least squares solution c is uniquely determined by the normal equations A T Ac =A T f . Since A has at most k nonzero elements in each row the matrix A T A will have symmetric banded form with at most 2k + 1 nonzero elements in each row; see Figure 4.4.11.

A arising in cubic spline approximation with B-splines (nonzero elements shown).

Figure 4.4.11. Banded structure of the matrices A and A T

Example 4.4.3 (de Boor [37]). Consider experimental data describing a property of titanium as a function of tem- perature. Experimental values for t i = 585 + 10i, i = 1 : 49, are given. We want to fit these data using a least squares cubic spline. Figure 4.4.12 shows results from using a least squares fitted cubic spline with 17 knots. The spline with 9 knots shows oscillations near the points where the curve flattens out and the top of the peak is not well matched. Increasing the number of knots to 17 we get a very good fit.

We have in the treatment above assumed that the set of (interior) knots {τ 0 ≤τ 1 ≤ ···≤τ m } is given. In many spline approximation problems it is more realistic to consider

the location of knots to be free and try to determine a small set of knots such that the given data can be approximated to a some preassigned accuracy. Several schemes have been developed to treat this problem.

One class of algorithms start with only a few knots and iteratively add more knots guided by some measure of the error; see de Boor [36, Chapter XII]. The placement of the

436Chapter 4. Interpolation and Approximation

Figure 4.4.12. Least squares cubic spline approximation of titanium data using

17 knots marked on the axes by an “o.”

knots is chosen so that the Schoenberg–Whitney conditions are always satisfied. The itera- tions are stopped when the approximation is deemed satisfactory. If a knot ¯τ ∈ [τ j ,τ j +1 ) is

inserted, then the B-spline series with respect to the enlarged set of knots can cheaply and stably be computed from the old one (see Dierckx [99]).

Other algorithms start with many knots and successively remove knots which are not contributing much to the quality of the approximation. In these two classes of algorithms one does not seek an optimal knot placement at each step. This is done in more recent algorithms; see Schwetlick and Schütze [319].

ReviewQuestions

4.4.1 What is meant by a cubic spline function? Give an example where such a function is better suited than a polynomial for approximation over the whole interval.

4.4.2 (a) What is the dimension of the space S 4,k of spline functions of order k on a grid

4 = {x 0 ,x 1 ,...,x m }? Give a basis for this space. (b) Set up the linear system for cubic spline interpolation in the equidistant case for

some common boundary conditions. What do the unknown quantities mean, and what conditions are expressed by the equations? About how many operations are required to interpolate a cubic spline function to m + 1, m ≫ 1, given values of a function?

4.4.3 What error sources have influence on the results of cubic spline interpolation? How fast do the boundary errors die out? How do the results in the interior of the interval depend on the step size (asymptotically)? One of the common types of boundary conditions yields much larger error than the others. Which one? Compare it quanti- tatively with one of the others.

Problems and Computer Exercises 437

4.4.4 Approximately how many arithmetic operations are required to evaluate the function values of all cubic B-splines that are nonzero at a given point?

4.4.5 Express the restrictions of f (x) = 1 and f (x) = x to the interval [x 0 ,x m ] as linear combinations of the hat functions defined by (4.4.38).

4.4.6 The Schoenberg–Whitney conditions give necessary and sufficient conditions for a certain interpolation problem with B-splines of order k. What is the interpolation problem and what are the conditions?

Problems and Computer Exercises

4.4.1 Consider a cubic Bézier curve defined by the four control points p 0 ,p 1 ,p 2 , and p 3 . Show that at t = 1/2

1 p 0 +p 3 3 p 1 +p 2

and interpret this formula geometrically.

4.4.2 (G. Eriksson) Approximate the function y = cos x on [−π/2, π/2] by a cubic Bézier curve. Determine the four control points in such a way that it interpolates cos x and its derivative at −π/2, 0, and π/2. Hint: Use symmetry and the result of Problem 4.4.1 to find the y-coordinate of p 1

and p 2 .

4.4.3 Suppose that f (x) and the grid 4 are symmetric around the midpoint of the interval [a, b]. You can then considerably reduce the amount of computation needed for the

construction of the cubic spline interpolant by replacing the boundary condition at x = b by an adequate condition at the midpoint. Which? (a) Set up the matrix and right-hand side for this in the case of constant step size h. (b) Do the same for a general case of variable step size.

4.4.4 (a) Write a program for solving a tridiagonal linear system by Gaussian elimination without pivoting. Assume that the nonzero diagonals are stored in three vectors.

Adapt it to cubic spline interpolation with equidistant knots with several types of boundary conditions.

(b) Consider the tridiagonal system resulting from the not-a-knot boundary condi- tions. Show that after eliminating k 0 between the first two equations and k m between the last two equations the remaining tridiagonal system for k 1 ,...,k m −1 is diago- nally dominant.

(c) Interpolate a cubic spline s(x) through the points (x i , f (x i )) , where

f (x) = (1 + 25x 2 ) −1

, x i = −1 +

10 (i − 1), i = 1 : 11. Compute a natural spline, a complete spline (here f ′ (x 1 ) and f ′ (x 11 ) are needed) and

a not-a-knot spline. Compute and compare error curves (natural and logarithmic). (d) Conduct similar runs as in (b), though for f (x) = 1/x, 1 ≤ x ≤ 2, with h = 0.1

438 Chapter 4. Interpolation and Approximation and h = 0.05. Compare the “almost complete,” as described in the text, with the

complete and the natural boundary condition.

4.4.5 If f ′′ is known at the boundary points, then the boundary conditions can be chosen so that f ′′ =s ′′ at the boundary points. Show that this leads to the conditions

2k 0 +k 1 = 3d 1 −h 1 f ′′ (x 0 ), k m −1 + 2k m = 3d m +h m f ′′ (x m ).

4.4.6 Show that the formula

s(x)dx =

is exact for all cubic spline functions s(x). How does the formula simplify if all

h i = h? Hint: Integrate (4.4.16) from x i −1 to x i .

4.4.7 In (4.4.16) the cubic spline q i (x) on the interval [x i −1 ,x i ) is expressed in terms of function values y i −1 ,y i , and the first derivatives k i −1 ,k i .

(a) Show that if M i =s ′′ (x i ) , i = 0 : m, are the second derivatives (also called moments ) of the spline function, then

h i k i −d i = ( 2M i +M i −1 ), k i −1 −d i =− (M i + 2M i

6 6 −1 ). Hence q i (x) can also be uniquely expressed in terms of y i −1 ,y i and M i −1 ,M i .

(b) Show that, using the parametrization in (a), the continuity of the first derivative of the spline function at an interior point x i gives the equation

h i M i −1 + 2(h i +h i +1 )M i +h i +1 M i +1 = 6(d i +1 −d i ).

4.4.8 (a) Develop an algorithm for solving the arrowhead linear system T k = g (4.4.32), using Gaussian elimination without pivoting. Show that about twice the number of arithmetic operations are needed compared to a tridiagonal system.

(b) At the end of Sec. 4.4.2 parametric spline interpolation to given points (x i ,y i ) ,

i = 0 : m, is briefly mentioned. Work out the details on how to use this to represent

a closed curve. Try it out on a boomerang, an elephant, or what have you.

4.4.9 (a) Compute and plot a B-spline basis of order k = 3 (locally quadratic) and m = 6 subintervals of equal length. Hint: In the equidistant case there is some translation invariance and symmetry, so you do not really need more than essentially three different B-splines. You need one

spline with triple knot at x 0 and a single knot at x 1 (very easy to construct), and two more splines.

(b) Set up a scheme to determine a locally quadratic B-spline which interpolates given values at the midpoints

x i = (τ i +1 +τ i )/ 2, (τ i +1

i ), i = 0 : m − 1,

4.5. Approximation and Function Spaces 439 and the boundary points τ 0 ,τ m . Show that the spline is uniquely determined by these

interpolation conditions.

4.4.10 Derive the usual formula of Leibniz for the kth derivative from (4.4.45) by a passage to the limit.

4.4.11 Use the recurrence (4.4.46)

+1,k−1 (x)

+k −τ +1 to show that

+k−1 −τ

N i,k (x) =

N i,k −1 (x), τ 0 ≤x≤τ m ,

where the sum is taken over all nonzero values. Use this to give an induction proof of the summation property in Theorem 4.4.10.

= −(k − 1)(t − k) + , k ≥ 1, show the formula for differentiating a B-spline,

dx (t − x) −1

4.4.12 (a) Using the result d k

= (k − 1) +1,k−1 − . dx

τ i +k −τ i +1 Then use the relation (4.4.46) to show

τ i +k−1 −τ i

d s +1 c

= (k − 1) −1 N i,k −1 dx (x),

i −c i

c i N i,k (x)

i =r τ i +k−1 −τ i where c r −1 := c s +1 := 0.

i =r

(b) Given the B-spline representation of a cubic spline function s(x). Show how to find its polynomial representation (4.4.22) by computing the function values and first derivatives s(τ i ), s ′ (τ i ) , i = 0 : m.

(c) Apply the idea in (a) recursively to show how to compute all derivatives of s(x) up to order k − 1. Use this to develop a method for computing the polynomial

representation of a spline of arbitrary order k from its B-spline representation.

4.4.13 Three different bases for the space of cubic polynomials of degree ≤ 3 on the interval [0, 1] are the monomial basis {1, t, t 2 ,t 3 3 3 }, the Bernštein basis {B 3

0 (t ), B 1 (t ), B 2 (t ),

B 3 (t ) }, and the Hermite basis. Determine the matrices for these basis changes.

Dokumen yang terkait

Analisis Komparasi Internet Financial Local Government Reporting Pada Website Resmi Kabupaten dan Kota di Jawa Timur The Comparison Analysis of Internet Financial Local Government Reporting on Official Website of Regency and City in East Java

19 819 7

ANTARA IDEALISME DAN KENYATAAN: KEBIJAKAN PENDIDIKAN TIONGHOA PERANAKAN DI SURABAYA PADA MASA PENDUDUKAN JEPANG TAHUN 1942-1945 Between Idealism and Reality: Education Policy of Chinese in Surabaya in the Japanese Era at 1942-1945)

1 29 9

Improving the Eighth Year Students' Tense Achievement and Active Participation by Giving Positive Reinforcement at SMPN 1 Silo in the 2013/2014 Academic Year

7 202 3

An Analysis of illocutionary acts in Sherlock Holmes movie

27 148 96

The Effectiveness of Computer-Assisted Language Learning in Teaching Past Tense to the Tenth Grade Students of SMAN 5 Tangerang Selatan

4 116 138

The correlation between listening skill and pronunciation accuracy : a case study in the firt year of smk vocation higt school pupita bangsa ciputat school year 2005-2006

9 128 37

Existentialism of Jack in David Fincher’s Fight Club Film

5 71 55

Phase response analysis during in vivo l 001

2 30 2

The Risk and Trust Factors in Relation to the Consumer Buying Decision Process Model

0 0 15

PENERAPAN ADING (AUTOMATIC FEEDING) PINTAR DALAM BUDIDAYA IKAN PADA KELOMPOK PETANI IKAN SEKITAR SUNGAI IRIGASI DI KELURAHAN KOMET RAYA, BANJARBARU Implementation of Ading (Automatic Feeding) Pintar in Fish Farming on Group of Farmer Close to River Irriga

0 0 5