The B-Spline Basis

4.4.3 The B-Spline Basis

In the following we will introduce a more convenient B-spline basis for the linear space S 4,k of spline functions of degree k. The term B-spline was coined by I. J. Schoenberg [314] and is short for basis spline.

4.4. Piecewise Polynomial Interpolation 427 It was shown in Sec. 4.4.2 that the set of spline functions of order k, S 4,k , on the grid

4 = {a = x 0 <x 1 < ···<x m = b},

is a linear space of dimension k + m − 1. One basis was shown to be the truncated power basis :

6 1, x, . . . , x k −1 7 6

7 −x 2 ) −1 + , . . . , (x −x m −1 ) −1 + .

(4.4.35) In particular, a basis for S 4, 2 consists of continuous piecewise linear functions

∪ (x −x 1 ) k −1 + , (x

{1, x} ∪ {l 1 (x), . . . , l m −1 (x) }, l i (x) = (x − x i ) + . Another basis for S 4, 2 is obtained by introducing an artificial exterior knot x −1 ≤x 0 . Then

it is easy to see that using the functions l i (x) , i = −1 : m−1, every linear spline on [x 0 ,x m ] can also be written as

m −1

s(x) =

c i l i (x).

i =−1

In anticipation of the fact that it may be desirable to interpolate at other points than the knots, we consider from now on the sequence of knots

(4.4.36) where τ i <τ i +k , i = 0 : m − k, i.e., at most k successive knots are allowed to coincide.

4 = {τ 0 ≤τ 1 ≤···≤τ m },

We start by considering the space S 4, 1 . This consists of piecewise constant functions and a basis is

1 x ∈ [τ i ,τ i +1 ) ,

N i, 1 (x)

0 otherwise, i = 0 : m − 1. (4.4.37) The basis functions are arbitrarily chosen to be continuous from the right, i.e., N i, 1 (τ i ) =

N i, 1 (τ i + 0). For k = 2 we define the hat functions 139 by

i )/(τ i +1 −τ i ),

x ∈ [τ i ,τ i +1 ],

N i, 2 (x) = (τ i +2 − x)/(τ i +2 −τ i +1 ), x ∈ [τ i +1 ,τ i +2 ) , i = −1 : m − 1. (4.4.38) 0,

i ,τ i +2 ) ,

We have here introduced two exterior knots τ −1 ≤τ 0 and τ m +1 ≥τ m at the boundaries. (In the following we refer to the knots τ 0 ,...,τ m as interior knots.) At a distinct knot τ i just one hat function is nonzero, N i +1,2 (τ i ) = 1. If all knots are distinct it follows that the spline function of order k = 2 interpolating the points (τ i ,y i ) ,

i = 0 : m, can be written uniquely as

m −1

s(x) =

c i N i, 2 (x),

i =−1

139 The generalization of hat functions to several dimensions plays a very important role in finite element methods; see Sec. 5.4.4.

428 Chapter 4. Interpolation and Approximation where c i =y i +1 . This shows that the restriction of the functions N i, 2 (x) , i = −1 : m − 1,

to the interval [τ 0 ,τ m ] are (m + 1) linearly independent functions in S 4, 2 and form a basis for S 4, 2 .

If we allow two interior knots to coalesce, τ i =τ i +1 , 0 < i < m − 1, then N i −1,2 (x) and N i, 2 (x) will have a discontinuity at τ i . This generalizes the concept of a B-spline of order 2 given in Definition 4.4.3 and allows us to model functions with discontinuities at certain knots. Figure 4.4.8 illustrates the formation of a double knot for a linear spline.

Figure 4.4.8. Formation of a double knot for a linear spline.

By definition the basis function N i, 2 (x) is nonzero only on the interval (τ i ,τ i +2 ) . It

follows that for x ∈ (τ i ,τ i +1 ) we have N j, 2 (x)

value of x at most two hat functions will be nonzero and s(x) =c i −1 N i −1,2 (x) +c i N i, 2 (x), x ∈ (τ i ,τ i +1 ). The exterior knots are usually taken to coincide with the boundary so that τ −1 =τ 0

and τ m +1 =τ m . In this case N −1,1 and N m −1,1 become “half-hats” with a discontinuity at τ 0 and τ m , respectively. It is easily verified that the functions N i, 2 (x) can be written as a linear combination of the basis function l i (x) = (x − τ i ) + ,i = 1 : m + 1. We have

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

− (x −τ i +1 ) + − (x − τ i ) + /(τ i +1 −τ i ) = [τ i +1 ,τ i +2 ] t (t − x) + − [τ i ,τ i +1 ] t (t − x) +

(4.4.40) = (τ i +2 −τ i ) [τ i ,τ i +1 ,τ i +2 ] t (t − x) + , i = 1 : m. Here [τ i ,τ i +1 ,τ i +2 ] t means the second order divided-difference functional 140 operating on

a function of t; i.e., the values τ i are to be substituted for t, not for x. Recall that divided differences are defined also for coincident values of the argument; see Sec. 4.3.1. The Peano kernel and its basic properties were given in Sec. 3.3.3. The last expression in (4.4.40) tells us that N i, 2 is the Peano kernel of a second order divided-difference functional

140 The notation is defined in Sec. 4.2.1.

4.4. Piecewise Polynomial Interpolation 429 multiplied by the constant τ i +2 −τ i . This observation suggests a definition of B-splines of

arbitrary order k and a B-spline basis for the space S 4,k .

Definition 4.4.9.

Let 4 = {τ 0 ≤τ 1 ≤···≤τ m } be an arbitrary sequence of knots such that τ i <τ i +k ,

i = 0 : m − k. Then a B-spline of order k (apart from a stepsize factor) equals the Peano kernel of a kth order divided-difference functional; more precisely, we define (with the notations used in this chapter)

, (4.4.41) where [τ i ,τ i

N i,k (x) = (τ k i +k −τ i ) [τ i ,τ i +1 ,...,τ i +k ] t (t − x) −1

x −1 denotes the kth divided difference of the function l x −1 ( ·) with respect to the set of points τ i ,τ i +1 ,...,τ i +k . This definition remains valid for knots that are not distinct.

+1 k ,...,τ i +k ]l

It can be shown that N i,k (x) is defined for all x. If the knots are distinct, then by Problem 4.2.7

(x j ), (4.4.42)

which shows that N i,k is a linear combination of functions (τ j − x) k −1

, j = i : i +k. Hence it is a spline of order k (as anticipated in the terminology). For equidistant knots the B-spline is related to the probability density of the sum of

2 , 2 ]. This was known already to Laplace. B-splines of order k = 1, 2, and 3 are shown in Figure 4.4.9.

1 uniformly distributed random variables on [− 1

Figure 4.4.9. B-splines of order k = 1, 2, 3.

Theorem 4.4.10. The B-splines of order k have the following properties: (i) Positivity:

N i,k (x) > 0, x ∈ (τ i ,τ i +k ).

(ii) Compact support:

N i,k (x) = 0, x

i ,τ i +k ].

(iii) Summation property:

i N i,k (x) = 1 for all x ∈ [τ 0 ,τ m ].

430 Chapter 4. Interpolation and Approximation

A proof can be based on the general facts concerning Peano kernels found in Sec. 3.3.3, where also an expression for the B-spline (k = 3) is calculated for the equidistant

Proof.

case. (Unfortunately the symbol x means different things here and in Sec. 3.3.3.)

(i) By (4.2.11), Rf = [τ (k) i ,τ i +1 ,...,τ i +k ]f = f (ξ )/ k !, ξ ∈ (τ i ,τ i +k ) , and Rp = 0,

for p ∈ P k . It then follows from the corollary of Peano’s remainder theorem that the Peano kernel does not change sign in [τ i ,τ i +k ]. It must then have the same sign as

K(u) du = R(x − a) k /k ! = 1. This proves a somewhat weaker statement than (i) (N i,k (x) ≥ 0 instead of N i,k (x) > 0).

(ii) This property follows since a Peano kernel always vanishes outside its interval of support of the functional, in this case [τ i ,τ i +k ]. (A more general result concerning

the number of zeros is found, e.g., in Powell [292, Theorem 19.1]. Among other things this theorem implies that the jth derivative of a B-spline, j ≤ k − 2, changes

sign exactly j times. This explains the “bell shape” of B-splines.) (iii) For a sketch of a proof of the summation property, 141 see Problem 4.4.11.

To get a basis of B-splines for the space S 4,k , 4 = {τ 0 ≤τ 1 ≤···≤τ m }, (m + k − 1) B-splines of order k are needed. We therefore choose 2(k − 1) additional knots τ −k+1 ≤

···≤τ −1 ≤τ 0 ,τ m +k−1 ≥···≥τ m +1 ≥τ m , and B-splines N i,k (x) , i = −k + 1 : m − 1. As for k = 2 it is convenient to let the exterior knots coincide with the endpoints,

τ m =τ m +1 =···=τ m +k−1 . It can be shown that this choice tends to optimize the conditioning of the B-spline ba-

τ −k+1 =···=τ −1 =τ 0 ,

sis. Figure 4.4.10 shows the first four cubic B-splines for k = 4 (the four last B-splines are

0.7 N −3,4 N −2,4

Figure 4.4.10. The four cubic B-splines nonzero for x ∈ (t 0 ,t 1 ) with coalescing

exterior knots t −3 =t −2 =t −1 =t 0 .

141 The B-splines M i,k originally introduced by Schoenberg in 1946 were normalized so that ∞ −∞ M i,k dx = 1.

4.4. Piecewise Polynomial Interpolation 431

a mirror image of these). We note that N −3,4 is discontinuous, N −2,4 has a nonzero first derivative, and N −2,4 has a nonzero second derivative at the left boundary. Interior knots of multiplicity r > 1 are useful when we want to model a function which has less than k − 2 continuous derivatives at a particular knot. If r ≤ k interior knots coalesce, then the spline will only have k − 1 − r continuous derivatives at this knot.

Lemma 4.4.11.

Let τ i

be a knot of multiplicity r ≤ k, i.e.,

τ i −1 <τ i =···=τ i +r−1 <τ i +r .

Then N i,k is at least (k − r − 1) times continuously differentiable at τ i . For r = k, the B-spline becomes discontinuous.

Proof. The truncated power (t − τ i ) k −1 + is (k − 2) times continuously differentiable and [τ i ,...,τ i +k ]g contains at most the (r − 1)st derivative of g. Hence the lemma

follows. Consider the spline function

m −1

s(x) =

c i N i,k (x).

i =−k+1

If s(x) = 0, x ∈ [τ (k 0 ,τ m ], then s(τ 0 ) =s ′ (τ 0 ) =···=s −1) (τ 0 ) = 0, and s(τ i ) = 0,

i = 1 : m − 1. From this it can be determined by induction that in (4.4.43) c i = 0,

i = −k + 1 : m − 1. This shows that the (m + k − 1) B-splines N i,k (x) , i = −k +1 : m−1, are linearly independent and form a basis for the space S 4,k . (A more general result is given in de Boor [37, Theorem IX.1].) Thus any spline function s(x) of order k (degree k − 1) on 4 can be uniquely written in the form (4.4.43). Note that from the compact support

property it follows that for any fixed value of x ∈ [τ 0 ,τ m ] at most k terms will be nonzero in the sum in (4.4.43), and thus we have

s(x) =

c i N i,k (x), x ∈ [τ j ,τ j +1 ). (4.4.44)

i =j−k+1

We will now develop a very important stable recurrence relation for computing B- splines. For this we need the following difference analogue of Leibniz’ formula. 142

Theorem 4.4.12 (Leibniz’ Formula). Let f (x) = g(x)h(x), and x i ≤x i +1 ≤···≤x i +k . Then

i +k

[x i ,...,x i +k ]f = [x i ,...,x r ]g · [x r ,...,x i +k ]h, (4.4.45)

r =i

142 Gottfried Wilhelm von Leibniz (1646–1716), a German mathematician who developed his version of calculus at the same time as Newton. Many of the notations he introduced are still used today.

432 Chapter 4. Interpolation and Approximation provided that g(x) and f (x) are sufficiently many times differentiable so that the divided

differences on the right-hand side are defined for any coinciding points x j . Proof. Note that the product polynomial

i +k

P (x) = (x −x i ) · · · (x − x r −1 ) [x i ,...,x r ]g

r =i

i +k

(x −x s +1 ) · · · (x − x i +k ) [x s ,...,x i +k ]h

s =i

agrees with f (x) at x i ,...,x i +k since by Newton’s interpolation formula the first factor agrees with g(x) and the second with h(x) there. If we multiply out we can write P (x) as

a sum of two polynomials:

... =P 1 (x) +P 2 (x).

Since in P 2 (x) each term in the sum has 2 i +k j =i (x −x j ) as a factor, it follows that P 1 (x) will also interpolate f (x) at x i ,...,x

i i +k . The theorem now follows since the leading coefficient of P 1 (x) , which equals

r =i [x i ,...,x r ]g · · · [x r ,...,x i +k ]h, must equal the leading coefficient [x i ,...,x i +k ]f of the unique interpolation polynomial of degree k .

+k

Theorem 4.4.13.

The B-splines satisfy the recurrence relation x

(x). (4.4.46) τ i

N i,k −1 (x) +

+k−1 −τ i

τ i +k −τ i +1

+1,k−1

Proof. (de Boor [37, pp. 130–131]) The recurrence is derived by applying Leibniz’ formula for the kth divided difference to the product

(t k − x) −1

= (t − x)(t − x) + .

k −2

This gives

[τ k +k ] − x) −1

i ,...,τ i t (t

= (τ i − x)[τ i ,...,τ i +k ] t (t − x) −2 + + 1 · [τ i +1 ,...,τ i +k ] t (t

, (4.4.47) since [τ i ] t (t − x) = (τ i − x), [τ i ,τ i +1 ] t (t − x) = 1, and [τ i ,...,τ j ] t (t − x) = 0 for

− x) k −2

j>i + 1. By the definition of a divided difference

τ i −x

(τ i − x)[τ i ,...,τ i +k ] t = ( [τ i +1 ,...,τ i ] t − [τ i ,...,τ i ] t ).

Substitute this in (4.4.47), simplify, and apply the definition of B-splines. This yields (4.4.46).

4.4. Piecewise Polynomial Interpolation 433 Note that with k multiple knots at the boundaries the denominators in (4.4.46) can

become zero. In this case the corresponding numerator is also zero and the term should be set equal to zero.

From Property (ii) in Theorem 4.4.10 we conclude that only k B-splines of order k may be nonzero on a particular interval [τ j ,τ j +1 ]. Starting from N i, 1 (x) = 1, x ∈ [τ i ,τ i +1 )

and 0 otherwise (cf. (4.4.37)), these B-splines of order k can be simultaneously evaluated using this recurrence by forming successively their values for order 1 : k in only about 3

2 k 2 flops. This recurrence is very stable, since it consists of taking a convex combination of

two lower-order splines to get the next one. Suppose that x ∈ [τ i ,τ i +1 ], and τ i

i +1 . Then the B-splines of order k = 1, 2, 3, . . . nonzero at x can be simultaneously evaluated by computing the following triangular array.

0 N i −3,4

0 N i −2,3

N i −1,2

N i −2,4

N i, 1 N i −1,3

N i, 2 N i −1,4

The boundary of zeros in the array is due to the fact that all other B-splines not mentioned explicitly vanish at x. This array can be generated column by column. The first column is known from (4.4.37), and each entry in a subsequent column can be computed as a linear combination with nonnegative coefficients of its two neighbors using (4.4.46). Note that if this is arranged in a suitable order the elements in the new column can overwrite the elements in the old column.

To evaluate s(x), we first determine the index i such that x ∈ [τ i ,τ i +1 ) using, for example, a linear search or bisection (see Sec. 6.1.2). The recurrence above is then used to

generate the triangular array (4.4.48) which provides N j,k (x) , j = i − k + 1 : i, in the sum (4.4.44).

Assume now that τ 0 <τ 1 < ···<τ m are distinct knots. Using the B-spline basis we can formulate a more general interpolation problem, where the n = m + k − 1 interpolation

points (knots) x j do not necessarily coincide with the knots τ i . We consider determining a spline function s(x) ∈ S 4,k such that

s(x j ) =f j , j = 1 : m + k − 1.

Since any spline s(x) ∈ S 4,k can be written as a linear combination of B-splines, the interpolation problem can equivalently be written

m −1

c i N i,k (x j ) =f j , j = 1 : m + k − 1. (4.4.49)

i =−k+1

434 Chapter 4. Interpolation and Approximation These equations form a linear system Ac = f for the coefficients, where

i, j = 1 : m + k − 1, (4.4.50) and

a ij =N i −k,k (x j ),

f = (f 1 ,...,f m +k−1 ) . The elements a ij =N i −k,k (x j ) of the matrix A can be evaluated by the recurrence (4.4.46).

c = (c −k+1 ,...,c

m −1 ) ,

The matrix A will have a banded structure since a ij = 0 unless x j ∈ [τ i ,τ i +k ]. Hence at most k elements are nonzero in each row of A. (Note that if x j =τ i for some i only k − 1 elements will be nonzero. This explains why tridiagonal systems were encountered in cubic spline interpolation in earlier sections.)

Schoenberg and Whitney [315] showed that the matrix A is nonsingular if and only if its diagonal elements are nonzero ,

a jj =N j −k,k (x j )

j = 1 : n,

or, equivalently, if the knots x j satisfy

(4.4.51) Further, the matrix can be shown to be totally nonnegative, i.e., the determinant of every

τ j −k <x j <τ j , j = 1 : n.

submatrix is nonnegative. For such systems, if Gaussian elimination is carried out without pivoting , the error bound is particularly favorable; see [40]. This will also preserve the banded structure of A during the elimination.

When the B-spline representation (4.4.43) of the interpolant has been determined it can

be evaluated at a given point using the recursion formula (4.4.46). If it has to be evaluated more than two or three times per polynomial piece it is more efficient to first convert the B-spline to pp-form (4.4.22). For hints on how to do that, see Problem 4.4.12 (b) and (c).

A detailed discussion is found in de Boor [37, Chapter X]. Unless the Schoenberg–Whitney condition (4.4.51) is well-satisfied the system may become ill-conditioned. For splines of even order k the interior knots

τ 0 =x 0 , τ j +1 =x j +k/2 , j = 0 : n − k − 1, τ m =x n , is a good choice in this respect. In the important case of cubic splines this means that

knots are positioned at each data point except the second- and next-last (cf. the not-a-knot condition in Sec. 4.4.2).

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