• Aucun résultat trouvé

Chapter 1 Numerical approximation of data : interpolation, least squares method

N/A
N/A
Protected

Academic year: 2021

Partager "Chapter 1 Numerical approximation of data : interpolation, least squares method"

Copied!
93
0
0

Texte intégral

(1)

Chapter 1

Numerical approximation of data :

interpolation, least squares method

(2)

I. Motivation

1

Approximation of functions

(3)

Evaluation of a function

Which functions (f : R → R ) can be effectively evaluated in any point ?

Þ the power functions : f (x) = x m , m ∈ N Þ the polynomial functions :

f (x) = a 0 + a 1 x + a 2 x 2 + · · · + a m x m How can we evaluate other functions in a given point ?

for instance : f(x) = cos(x), f (x) = sin(x) exp(x),... Þ approximation by a polynomial function :

H using a Taylor series about the given point,

H searching a polynomial having the same values as the function in some close points

á Lagrange interpolation

(4)

Evaluation of a function

Which functions (f : R → R ) can be effectively evaluated in any point ?

Þ the power functions : f (x) = x m , m ∈ N Þ the polynomial functions :

f (x) = a 0 + a 1 x + a 2 x 2 + · · · + a m x m

How can we evaluate other functions in a given point ? for instance : f(x) = cos(x), f (x) = sin(x) exp(x),... Þ approximation by a polynomial function :

H using a Taylor series about the given point,

H searching a polynomial having the same values as the function in some close points

á Lagrange interpolation

(5)

Evaluation of a function

Which functions (f : R → R ) can be effectively evaluated in any point ?

Þ the power functions : f (x) = x m , m ∈ N Þ the polynomial functions :

f (x) = a 0 + a 1 x + a 2 x 2 + · · · + a m x m How can we evaluate other functions in a given point ?

for instance : f(x) = cos(x), f (x) = sin(x) exp(x),...

Þ approximation by a polynomial function : H using a Taylor series about the given point,

H searching a polynomial having the same values as the function in some close points

á Lagrange interpolation

(6)

Evaluation of a function

Which functions (f : R → R ) can be effectively evaluated in any point ?

Þ the power functions : f (x) = x m , m ∈ N Þ the polynomial functions :

f (x) = a 0 + a 1 x + a 2 x 2 + · · · + a m x m How can we evaluate other functions in a given point ?

for instance : f(x) = cos(x), f (x) = sin(x) exp(x),...

Þ approximation by a polynomial function : H using a Taylor series about the given point,

H searching a polynomial having the same values as the function in some close points

á Lagrange interpolation

(7)

Principles of Lagrange interpolation

f (x) = sin( πx

2 )(x 2 + 3)

(8)

Principles of Lagrange interpolation

f (x) = sin( πx

2 )(x 2 + 3)

4 points on the curve : (−1, −4),

(1, 4),

(2, 0),

(3, −12)

(9)

Principles of Lagrange interpolation

f (x) = sin( πx

2 )(x 2 + 3) Lagrange interpolating polynomial

4 points on the curve : P polynomial of degree ≤ 3 satisfying

(−1, −4), P (−1) = −4

(1, 4), P (1) = 4

(2, 0), P (2) = 0

(3, −12) P(3) = −12

(10)

Principles of Lagrange interpolation, with 6 points

f (x) = sin( πx

2 )(x 2 + 3) Lagrange interpolating polynomial

6 points on the curve : P polynomial of degree ≤ 5 satisfying

(x i , y i ) 0≤i≤5 , P (x i ) = y i for 0 ≤ i ≤ 5

Remark : ouside the interval defined by the (x i ), the Lagrange

interpolating polynomial has nothing to do with f .

(11)

I. Motivation

1

Approximation of functions

2

Curve approximation

(12)

Piecewise interpolation

f (x) = sin( πx

2 )(x 2 + 3)

piecewise affine approximation

(13)

Piecewise interpolation

f (x) = sin( πx

2 )(x 2 + 3) piecewise affine approximation

(14)

Piecewise interpolation

f (x) = sin( πx

2 )(x 2 + 3) piecewise affine approximation

Applications : Calculation of an approximate value of the length of the curve

the area under the curve (here Z 5

−5

f(x)dx)

Þ see chapter 2

(15)

Piecewise interpolation

f (x) = sin( πx

2 )(x 2 + 3) piecewise affine approximation

Applications : Calculation of an approximate value of the length of the curve

the area under the curve (here Z 5

−5

f (x)dx)

Þ see chapter 2

(16)

Cubic spline

f (x) = sin( πx

2 )(x 2 + 3) s cubic spline

Principle :

between two consecutive points, s is a cubic polynomial s(x i ) = f (x i )

s ∈ C 2

+ two conditions on the boundary points

(17)

Cubic spline

f (x) = sin( πx

2 )(x 2 + 3) s cubic spline

Principle :

between two consecutive points, s is a cubic polynomial s(x i ) = f (x i )

s ∈ C 2

+ two conditions on the boundary points

(18)

B´ ezier curves : principle

P 0 , P 1 , · · · , P n , are n + 1 given control points

The corresponding B´ ezier curve is defined by M (t) =

n

X

i=0

B n i (t)P i , 0 ≤ t ≤ 1 where B n i are Bernstein polynomial defined by

B n i = C n i X i (1 − X) n−i , with C n i = n!

i!(n − i)! .

(19)

B´ ezier curves : principle

P 0 , P 1 , · · · , P n , are n + 1 given control points The corresponding B´ ezier curve is defined by

M (t) =

n

X

i=0

B n i (t)P i , 0 ≤ t ≤ 1 where B n i are Bernstein polynomial defined by

B n i = C n i X i (1 − X) n−i , with C n i = n!

i!(n − i)! .

(20)

B´ ezier curves : with more points

(21)

Application of the B´ ezier curves

(22)

I. Motivation

1

Approximation of functions

2

Curve approximation

3

Fitting of statistical data

(23)

Study of statistical data

Some experimental measurements

H X : noise level in the factory (in dB),

H Y : time used to do a definite work (in minutes)

X 73 78 76 63 81 70 75 81 79 84 50 76 65 58 Y 77 85 79 67 83 73 72 83 81 82 52 77 65 58

A physical measure always contains some noise. Can we find a law linking Y and X (Y = f (X)) ?

Can we predict the value of

Y for X = 66dB ?

(24)

Linear regression

Principle

We are looking for a and b such that d(a, b) = X

(y i − (ax i + b)) 2 is minimal.

The straight line y = ax + b is the linear regression line.

The polynomial P = aX + b is the least squares fitting

polynomial of the cloud of points.

(25)

II. Lagrange interpolating polynomial : theoretical study

1

Study of an example

(26)

Lagrange interpolation in 1 point

f (x) = sin( πx

2 )(x 2 + 3)

1 point on the curve : Search for P 0 , such that (x 0 , y 0 ) = (1, 4) deg P 0 ≤ 0 and

P 0 (x 0 ) = y 0

P 0 = 4

(27)

Lagrange interpolation in 1 point

f (x) = sin( πx

2 )(x 2 + 3)

1 point on the curve : Search for P 0 , such that (x 0 , y 0 ) = (1, 4) deg P 0 ≤ 0 and

P 0 (x 0 ) = y 0

P 0 = 4

(28)

Lagrange interpolation in 1 point

f (x) = sin( πx

2 )(x 2 + 3)

1 point on the curve : Search for P 0 , such that (x 0 , y 0 ) = (1, 4) deg P 0 ≤ 0 and

P 0 (x 0 ) = y 0

P 0 = 4

(29)

Lagrange interpolation in 2 points

f (x) = sin( πx

2 )(x 2 + 3)

2 points on the curve : Search for P 1 , such that (x 0 , y 0 ) = (1, 4) deg P 1 ≤ 1 and (x 1 , y 1 ) = (−1, −4) P 1 (x 0 ) = y 0 and P 1 (x 1 ) = y 1

P 1 = 4X

(30)

Lagrange interpolation in 2 points

f (x) = sin( πx

2 )(x 2 + 3)

2 points on the curve : Search for P 1 , such that (x 0 , y 0 ) = (1, 4) deg P 1 ≤ 1 and (x 1 , y 1 ) = (−1, −4) P 1 (x 0 ) = y 0 and P 1 (x 1 ) = y 1

P 1 = 4X

(31)

Lagrange interpolation in 2 points

f (x) = sin( πx

2 )(x 2 + 3)

2 points on the curve : Search for P 1 , such that (x 0 , y 0 ) = (1, 4) deg P 1 ≤ 1 and (x 1 , y 1 ) = (−1, −4) P 1 (x 0 ) = y 0 and P 1 (x 1 ) = y 1

P 1 = 4X

(32)

Lagrange interpolation in 3 points

f (x) = sin( πx

2 )(x 2 + 3)

3 points on the curve : Search for P 2 , such that (x 0 , y 0 ) = (1, 4) deg P 2 ≤ 2 and (x 1 , y 1 ) = (−1, −4) P 2 (x 0 ) = y 0 , P 2 (x 1 ) = y 1

(x 2 , y 2 ) = (3, −12) and P 2 (x 2 ) = y 2

(33)

Lagrange interpolation in 3 points

f (x) = sin( πx

2 )(x 2 + 3)

3 points on the curve : Search for P 2 , such that (x 0 , y 0 ) = (1, 4) deg P 2 ≤ 2 and (x 1 , y 1 ) = (−1, −4) P 2 (x 0 ) = y 0 , P 2 (x 1 ) = y 1

(x 2 , y 2 ) = (3, −12) and P 2 (x 2 ) = y 2

(34)

Lagrange interpolation in 3 points

Idea

Search for L 0 , such that deg L 0 = 2 and

L 0 (x 1 ) = L 0 (x 2 ) = 0 and L 0 (x 0 ) = 1.

Search for L 1 , such that deg L 1 = 2 and

L 1 (x 0 ) = L 1 (x 2 ) = 0 and L 1 (x 1 ) = 1.

Search for L 2 , such that deg L 0 = 2 and

L 2 (x 0 ) = L 2 (x 1 ) = 0 and L 2 (x 2 ) = 1.

Prove that P 2 = y 0 L 0 + y 1 L 1 + y 2 L 2 is a solution of the pb.

Give the expression of P .

á P 2 = −3X 2 + 4X + 3

(35)

Lagrange interpolation in 3 points

Idea

Search for L 0 , such that deg L 0 = 2 and

L 0 (x 1 ) = L 0 (x 2 ) = 0 and L 0 (x 0 ) = 1.

Search for L 1 , such that deg L 1 = 2 and

L 1 (x 0 ) = L 1 (x 2 ) = 0 and L 1 (x 1 ) = 1.

Search for L 2 , such that deg L 0 = 2 and

L 2 (x 0 ) = L 2 (x 1 ) = 0 and L 2 (x 2 ) = 1.

Prove that P 2 = y 0 L 0 + y 1 L 1 + y 2 L 2 is a solution of the pb.

Give the expression of P .

á P 2 = −3X 2 + 4X + 3

(36)

Lagrange interpolation in 3 points

Other idea

P 1 = 4X satisfies P 1 (1) = 4, P 1 (−1) = −4 and deg P 1 = 1.

Q = (X + 1)(X − 1) satisfies Q(1) = Q(−1) = 0 and deg Q = 2 (in fact Q = −L 2 )

Search for P 2 under the form

P 2 = P 1 + αQ = 4X + α(X + 1)(X − 1).

P 2 (3) = −12 ⇐⇒ α = −3 and

P 2 = 4X − 3(X + 1)(X − 1) = −3X 2 + 4X + 3

(37)

Lagrange interpolation in 3 points

Other idea

P 1 = 4X satisfies P 1 (1) = 4, P 1 (−1) = −4 and deg P 1 = 1.

Q = (X + 1)(X − 1) satisfies Q(1) = Q(−1) = 0 and deg Q = 2 (in fact Q = −L 2 )

Search for P 2 under the form

P 2 = P 1 + αQ = 4X + α(X + 1)(X − 1).

P 2 (3) = −12 ⇐⇒ α = −3 and

P 2 = 4X − 3(X + 1)(X − 1) = −3X 2 + 4X + 3

(38)

II. Lagrange interpolating polynomial : theoretical study

1

Study of an example

2

Existence and uniqueness of the Lagrange interpolating

polynomial

(39)

The mathematical problem

Formulation

Let (n + 1) points be given :

(x i , y i ) 0≤i≤n with (x i , y i ) ∈ R 2 for all i, x i 6= x j for all i 6= j.

Is it possible to find a polynomial P with real coefficients satisfying P (x i ) = y i ∀0 ≤ i ≤ n?

Degree of P ?

number of equations : n + 1

Þ number of unknowns (coefficients (a i )) less that n + 1

Þ deg P ≤ n

(40)

The Lagrange basis

For 0 ≤ j ≤ n, let us define L j =

n

Y

i=0,i6=j

X − x i x j − x i . It satisfies :

L j (x j ) = 1 and L j (x i ) = 0 for all i 6= j

⇐⇒ L j (x i ) = δ i,j . and

deg L j = n ∀0 ≤ j ≤ n.

(41)

Solution of the problem + uniqueness

Existence of a solution Let P =

n

X

j=0

y j L j , we have deg P ≤ n,

P (x i ) =

n

X

j=0

y j L j (x i ) = y i for all 0 ≤ i ≤ n.

á P is a solution of the Lagrange interpolation problem.

Uniqueness

Can we find another solution to the problem, Q ? If Q exists, deg Q ≤ n and deg(P − Q) ≤ n,

P (x i ) − Q(x i ) = (P − Q)(x i ) = 0 for 0 ≤ i ≤ n.

á P − Q = 0 and the solution is unique.

(42)

Main theorem

Theorem Hypotheses :

Let us consider (n + 1) points of R 2 : (x i , y i ) 0≤i≤n , x i 6= x j for all i 6= j

Then, there exists a unique polynomial P ∈ R n [X] satisfying P (x i ) = y i ∀0 ≤ i ≤ n.

P is the Lagrange interpolating polynomial that passes through the (n + 1) points (x i , y i ) 0≤i≤n .

In the case where y i = f (x i ) for all 0 ≤ i ≤ n (with f a given

function), P is the Lagrange interpolating polynomial of f in the

points (x i ) 0≤i≤n .

(43)

II. Lagrange interpolating polynomial : theoretical study

1

Study of an example

2

Existence and uniqueness of the Lagrange interpolating polynomial

3

Interpolation error result

(44)

Presentation of the problem

Comparison of f and P (4 points)

E(x) = f (x) − P (x)

(45)

Presentation of the problem

Comparison of f and P (4 points)

E(x) = f (x) − P (x)

with a zoom around the points

(46)

Presentation of the problem

Comparison of f and P (6 points)

E(x) = f (x) − P (x)

(47)

Presentation of the problem

Comparison of f and P (6 points)

E(x) = f (x) − P (x)

with a zoom around the points

What can be said about E(x) ? Can it be bounded ?...

(48)

Interpolation error

Theorem Hypotheses :

f : [a, b] → R , f ∈ C n+1 ([a, b]),

(x i ) 0≤i≤n , n + 1 distinct real numbers of [a, b].

P n : Lagrange interpolating polynomial of f in the points (x i ) 0≤i≤n . Then, for all x ∈ [a, b], there exists ξ x ∈ [a, b] such that

f(x) − P n (x) = 1

(n + 1)! Π n (x)f (n+1)x ), with Π n =

n

Y

i=0

(X − x i ).

(49)

Consequence

As a consequence, we get :

∀x ∈ [a, b] |f (x) − P n (x)| ≤ 1

(n + 1)! M n+1n (x)|,

with M n+1 = max

ξ∈[a,b] |f (n+1) (ξ)|.

It does not imply the convergence of P n (x) towards f(x).

It is not necessary interesting to increase n.

(50)

III. Lagrange interpolating polynomial : practical computation

1

Cost of the computation of the interpolating polynomial

(51)

With the Lagrange basis

L j (x) =

n

Y

i=0,i6=j

(x − x i )

n

Y

i=0,i6=j

(x j − x i ) ,

for j = 0 to n

Cost of the computation :

(n + 1) ×

2(n − 1) mult. + 1 div.

P (x) =

n

X

j=0

y j L j (x) Þ final cost ≈ 2n 2 .

Other main drawback of the method : what happens if we finally want to add one more point (x n+1 , y n+1 ) ?

Þ All must be started again from zero.

(52)

With the Lagrange basis

L j (x) =

n

Y

i=0,i6=j

(x − x i )

n

Y

i=0,i6=j

(x j − x i )

, for j = 0 to n

Cost of the computation : (n + 1) ×

2(n − 1) mult. + 1 div.

P (x) =

n

X

j=0

y j L j (x) Þ final cost ≈ 2n 2 .

Other main drawback of the method : what happens if we finally want to add one more point (x n+1 , y n+1 ) ?

Þ All must be started again from zero.

(53)

With the Lagrange basis

L j (x) =

n

Y

i=0,i6=j

(x − x i )

n

Y

i=0,i6=j

(x j − x i )

, for j = 0 to n

Cost of the computation : (n + 1) ×

2(n − 1) mult. + 1 div.

P (x) =

n

X

j=0

y j L j (x) Þ final cost ≈ 2n 2 .

Other main drawback of the method : what happens if we finally want to add one more point (x n+1 , y n+1 ) ?

Þ All must be started again from zero.

(54)

With the Lagrange basis

L j (x) =

n

Y

i=0,i6=j

(x − x i )

n

Y

i=0,i6=j

(x j − x i )

, for j = 0 to n

Cost of the computation : (n + 1) ×

2(n − 1) mult. + 1 div.

P (x) =

n

X

j=0

y j L j (x) Þ final cost ≈ 2n 2 .

Other main drawback of the method : what happens if we finally want to add one more point (x n+1 , y n+1 ) ?

Þ All must be started again from zero.

(55)

With an other basis

Idea

Write the polynomial in the basis

1, (X − x 0 ), (X − x 0 )(X − x 1 ), · · · ,

n−1

Y

j=0

(X − x j )

 .

Þ P

n

= α 0 + α 1 (X − x 0 ) + · · · + α n n−1

Y

j=0

(X − x j ).

Now, if we add one point (x n+1 , y n+1 ) , we have : P n+1 = P n + α n+1

n

Y

j=0

(X − x j )

Þ we just need to calculate α n+1 to get P n+1 .

(56)

With an other basis

Idea

Write the polynomial in the basis

1, (X − x 0 ), (X − x 0 )(X − x 1 ), · · · ,

n−1

Y

j=0

(X − x j )

 .

Þ P n = α 0 + α 1 (X − x 0 ) + · · · + α n n−1

Y

j=0

(X − x j ).

Now, if we add one point (x n+1 , y n+1 ) , we have : P n+1 = P n + α n+1

n

Y

j=0

(X − x j )

Þ we just need to calculate α n+1 to get P n+1 .

(57)

With an other basis

Idea

Write the polynomial in the basis

1, (X − x 0 ), (X − x 0 )(X − x 1 ), · · · ,

n−1

Y

j=0

(X − x j )

 .

Þ P n = α 0 + α 1 (X − x 0 ) + · · · + α n n−1

Y

j=0

(X − x j ).

Now, if we add one point (x n+1 , y n+1 ) , we have : P n+1 = P n + α n+1

n

Y

j=0

(X − x j )

Þ we just need to calculate α n+1 to get P n+1 .

(58)

Cost of the computation of P n (x)

P n (x) = α 0 + α 1 (x − x 0 ) + · · · + α n

n−1

Y

j=0

(x − x j )

= α 0 + (x − x 0 )

α 1 + (x − x 1 )

α 2 + · · · .

H¨ orner’s algorithm for the computation of p = P n (x) p ← α n

for k from n − 1 to 0 p ← α k + (x − x k )p end

Cost

n additions + n multiplications

Þ and the computation of the coefficients α i ?

(59)

Cost of the computation of P n (x)

P n (x) = α 0 + α 1 (x − x 0 ) + · · · + α n

n−1

Y

j=0

(x − x j )

= α 0 + (x − x 0 )

α 1 + (x − x 1 )

α 2 + · · · .

H¨ orner’s algorithm for the computation of p = P n (x) p ← α n

for k from n − 1 to 0 p ← α k + (x − x k )p end

Cost

n additions + n multiplications

Þ and the computation of the coefficients α i ?

(60)

III. Lagrange interpolating polynomial : practical computation

1

Cost of the computation of the interpolating polynomial

2

The divided difference method

(61)

Calculation of the first α i

n = 0, 1 first point (x 0 , y 0 ), P 0 = α 0 : P 0 (x 0 ) = y 0 = ⇒ α 0 = y 0

n = 1, + (x 1 , y 1 ), P 1 = y 0 + α 1 (X − x 0 ) : P 1 (x 1 ) = y 1 = ⇒ α 1 = y 1 − y 0

x 1 − x 0 n = 2, + (x 2 , y 2 ),

P 2 = y 0 + y 1 − y 0

x 1 − x 0

(X − x 0 ) + α 2 (X − x 0 )(X − x 1 )

P 2 (x 2 ) = y 2 = ⇒ α 2 =

y 2 − y 1

x 2 − x 1 − y 1 − y 0

x 1 − x 0

x 2 − x 0

(62)

Recurrence formula

Assume we have :

Interpolating points : (x 0 , y 0 ) · · · (x n−1 , y n−1 ), P n−1 = α 0 +

n−1

X

j=1

α j j−1

Y

k=0

(X − x k ), (α j ) 0≤j≤n−1 known Interpolating points : (x 1 , y 1 ) · · · (x n , y n ),

Q n−1 = β 0 +

n−1

X

j=1

β j

j

Y

k=1

(X − x k ), (β j ) 0≤j≤n−1 known Then,

X − x 0

x n − x 0 Q n−1 + x n − X x n − x 0 P n−1

= P n

and

α n = 1

x n − x 0 β n−1 − 1

x n − x 0 α n−1 = β n−1 − α n−1

x n − x 0 .

(63)

Recurrence formula

Assume we have :

Interpolating points : (x 0 , y 0 ) · · · (x n−1 , y n−1 ), P n−1 = α 0 +

n−1

X

j=1

α j j−1

Y

k=0

(X − x k ), (α j ) 0≤j≤n−1 known Interpolating points : (x 1 , y 1 ) · · · (x n , y n ),

Q n−1 = β 0 +

n−1

X

j=1

β j

j

Y

k=1

(X − x k ), (β j ) 0≤j≤n−1 known Then,

X − x 0

x n − x 0 Q n−1 + x n − X

x n − x 0 P n−1 = P n

and

α n = 1

x n − x 0 β n−1 − 1

x n − x 0 α n−1 = β n−1 − α n−1

x n − x 0 .

(64)

Recurrence formula

Assume we have :

Interpolating points : (x 0 , y 0 ) · · · (x n−1 , y n−1 ), P n−1 = α 0 +

n−1

X

j=1

α j j−1

Y

k=0

(X − x k ), (α j ) 0≤j≤n−1 known Interpolating points : (x 1 , y 1 ) · · · (x n , y n ),

Q n−1 = β 0 +

n−1

X

j=1

β j

j

Y

k=1

(X − x k ), (β j ) 0≤j≤n−1 known Then,

X − x 0

x n − x 0 Q n−1 + x n − X

x n − x 0 P n−1 = P n and

α n = 1

x n − x 0 β n−1 − 1

x n − x 0 α n−1 = β n−1 − α n−1

x n − x 0 .

(65)

The divided differences

x 0 f (x 0 ) x 1 f (x 1 ) x 2 f (x 2 )

.. . .. .

.. . .. . . ..

x n−1 f (x n−1 )

. ..

x n f (x n )

· · · · f [x 0 , · · · , x n ] with

f [x 0 , · · · , x n ] = f[x 1 , · · · , x n ] − f [x 0 , · · · , x n−1 ] x n − x 0

.

(66)

The divided differences

x 0 f [x 0 ] x 1 f [x 1 ] x 2 f [x 2 ]

.. . .. .

.. . .. . . ..

x n−1 f [x n−1 ]

. ..

x n f [x n ]

· · · · f [x 0 , · · · , x n ] with

f [x 0 , · · · , x n ] = f[x 1 , · · · , x n ] − f [x 0 , · · · , x n−1 ] x n − x 0

.

(67)

The divided differences

x 0 f [x 0 ]

x 1 f [x 1 ] f [x 1 ] − f [x 0 ] x 1 − x 0

x 2 f [x 2 ] f [x 2 ] − f [x 1 ] x 2 − x 1

.. . .. . .. .

.. . . ..

x n−1 f [x n−1 ] f[x n−1 ] − f [x n−2 ] x n−1 − x n−2

. ..

x n f [x n ] f[x n ] − f [x n−1 ] x n − x n−1

· · · · f [x 0 , · · · , x n ] with

f [x 0 , · · · , x n ] = f[x 1 , · · · , x n ] − f [x 0 , · · · , x n−1 ]

x n − x 0 .

(68)

The divided differences

x 0 f [x 0 ]

x 1 f [x 1 ] f [x 0 , x 1 ] x 2 f [x 2 ] f [x 1 , x 2 ]

.. . .. . .. .

.. . . ..

x n−1 f [x n−1 ] f [x n−2 , x n−1 ]

. ..

x n f [x n ] f [x n−1 , x n ]

· · · · f[x 0 , · · · , x n ] with

f [x 0 , · · · , x n ] = f[x 1 , · · · , x n ] − f [x 0 , · · · , x n−1 ] x n − x 0

.

(69)

The divided differences

x 0 f [x 0 ]

x 1 f [x 1 ] f [x 0 , x 1 ]

x 2 f [x 2 ] f [x 1 , x 2 ] f [x 1 , x 2 ] − f [x 0 , x 1 ] x 2 − x 0

.. . .. . .. . .. .

. ..

x n−1 f [x n−1 ] f [x n−2 , x n−1 ] f [x n−1 , x n ] − f [x n−2 , x n−1 ] x n − x n−2

. ..

x n f [x n ] f [x n−1 , x n ] f [x n−1 , x n ] − f [x n−2 , x n−1 ] x n − x n−2

· · · · f [x 0 , · · · , x n ] with

f [x 0 , · · · , x n ] = f[x 1 , · · · , x n ] − f [x 0 , · · · , x n−1 ] x n − x 0

.

(70)

The divided differences

x 0 f [x 0 ]

x 1 f [x 1 ] f [x 0 , x 1 ]

x 2 f [x 2 ] f [x 1 , x 2 ] f [x 0 , x 1 , x 2 ]

.. . .. . .. . .. .

. ..

x n−1 f [x n−1 ] f [x n−2 , x n−1 ] f [x n−3 , x n−2 , x n−1 ]

. ..

x n f [x n ] f [x n−1 , x n ] f [x n−2 , x n−1 , x n ]

· · · · f [x 0 , · · · , x n ] with

f [x 0 , · · · , x n ] = f[x 1 , · · · , x n ] − f [x 0 , · · · , x n−1 ] x n − x 0

.

(71)

The divided differences

x 0 f [x 0 ]

x 1 f [x 1 ] f [x 0 , x 1 ]

x 2 f [x 2 ] f [x 1 , x 2 ] f [x 0 , x 1 , x 2 ]

.. . .. . .. . .. . . ..

x n−1 f [x n−1 ] f [x n−2 , x n−1 ] f [x n−3 , x n−2 , x n−1 ] . ..

x n f [x n ] f [x n−1 , x n ] f [x n−2 , x n−1 , x n ] · · · · f [x 0 , · · · , x n ] with

f[x 0 , · · · , x n ] = f[x 1 , · · · , x n ] − f [x 0 , · · · , x n−1 ] x n − x 0

.

(72)

The divided differences

x 0 f [x 0 ]

x 1 f [x 1 ] f [x 0 , x 1 ]

x 2 f [x 2 ] f [x 1 , x 2 ] f [x 0 , x 1 , x 2 ]

.. . .. . .. . .. . . ..

x n−1 f [x n−1 ] f [x n−2 , x n−1 ] f [x n−3 , x n−2 , x n−1 ] . ..

x n f [x n ] f [x n−1 , x n ] f [x n−2 , x n−1 , x n ] · · · · f[x 0 , · · · , x n ]

Þ P n = f[x 0 ] + f[x 0 , x 1 ](X − x 0 ) + f [x 0 , x 1 , x 2 ](X − x 0 )(X − x 1 ) + · · · + f [x 0 , · · · , x n ]

n−1

Y

j=0

(X − x j ).

(73)

The divided differences

x 0 f [x 0 ]

x 1 f [x 1 ] f [x 0 , x 1 ]

x 2 f [x 2 ] f [x 1 , x 2 ] f [x 0 , x 1 , x 2 ]

.. . .. . .. . .. . . ..

x n−1 f [x n−1 ] f [x n−2 , x n−1 ] f [x n−3 , x n−2 , x n−1 ] . ..

x n f [x n ] f [x n−1 , x n ] f [x n−2 , x n−1 , x n ] · · · · f[x 0 , · · · , x n ]

Cost of the computation ≈ n 2

2 div. and n 2 sub.

(74)

Result

Theorem

The Lagrange interpolating polynomial of f in the points (x i ) 0≤i≤n

reads

P n = f [x 0 ] +

n

X

j=1

f[x 0 , · · · , x j ]

j−1

Y

k=0

(X − x k ),

where f [ ] denotes the divided difference of f defined by induction f [x i ] = f (x i ) for 0 ≤ i ≤ n

f [x i , · · · , x i+k ] = f [x i+1 , · · · , x i+k ] − f [x i , · · · , x i+k−1 ] x i+k − x i

for 0 ≤ i ≤ n − k, 1 ≤ k ≤ n.

(75)

IV. A few words about Hermite interpolation

1

Presentation of the problem

(76)

One example

f (x) = sin( πx

2 )(x 2 + 3)

Consider two points : (x 0 , y 0 ) = (−1, −4) (x 1 , y 1 ) = (3, −12)

P = −4 − 2(X + 1) = −6 − 2X Q = P + (X + 1)(X − 3)(αX + β)

= P + (X + 1)(X − 3)(−1)

= −X 2 − 3

(77)

One example

f (x) = sin( πx

2 )(x 2 + 3)

Consider two points : (x 0 , y 0 ) = (−1, −4) (x 1 , y 1 ) = (3, −12) Search P such that

P (x 0 ) = f (x 0 ), P (x 1 ) = f (x 1 )

P = −4 − 2(X + 1) = −6 − 2X Q = P + (X + 1)(X − 3)(αX + β)

= P + (X + 1)(X − 3)(−1)

= −X 2 − 3

(78)

One example

f (x) = sin( πx

2 )(x 2 + 3)

Consider two points : (x 0 , y 0 ) = (−1, −4) (x 1 , y 1 ) = (3, −12) Search P such that

P (x 0 ) = f (x 0 ), P (x 1 ) = f (x 1 )

P = −4 − 2(X + 1) = −6 − 2X

Q = P + (X + 1)(X − 3)(αX + β)

= P + (X + 1)(X − 3)(−1)

= −X 2 − 3

(79)

One example

f (x) = sin( πx

2 )(x 2 + 3)

Consider two points : (x 0 , y 0 ) = (−1, −4) (x 1 , y 1 ) = (3, −12) Search Q such that

Q(x 0 ) = f (x 0 ), Q(x 1 ) = f (x 1 ) Q 0 (x 0 ) = f 0 (x 0 ), Q 0 (x 1 ) = f 0 (x 1 )

P = −4 − 2(X + 1) = −6 − 2X

Q = P + (X + 1)(X − 3)(αX + β)

= P + (X + 1)(X − 3)(−1)

= −X 2 − 3

(80)

One example

f (x) = sin( πx

2 )(x 2 + 3)

Consider two points : (x 0 , y 0 ) = (−1, −4) (x 1 , y 1 ) = (3, −12) Search Q such that

Q(x 0 ) = f (x 0 ), Q(x 1 ) = f (x 1 ) Q 0 (x 0 ) = f 0 (x 0 ), Q 0 (x 1 ) = f 0 (x 1 )

P = −4 − 2(X + 1) = −6 − 2X Q = P + (X + 1)(X − 3)(αX + β)

= P + (X + 1)(X − 3)(−1)

= −X 2 − 3

(81)

One example

f (x) = sin( πx

2 )(x 2 + 3)

Consider two points : (x 0 , y 0 ) = (−1, −4) (x 1 , y 1 ) = (3, −12) Search Q such that

Q(x 0 ) = f (x 0 ), Q(x 1 ) = f (x 1 ) Q 0 (x 0 ) = f 0 (x 0 ), Q 0 (x 1 ) = f 0 (x 1 )

P = −4 − 2(X + 1) = −6 − 2X Q = P + (X + 1)(X − 3)(αX + β)

= P + (X + 1)(X − 3)(−1)

= −X 2 − 3

(82)

With 2 other points

f (x) = sin( πx

2 )(x 2 + 3)

P = 0 Q = − π

2 X 3 + π

4 X 2 + 3π

2 X

(83)

The mathematical problem

Generalities

The Hermite interpolation takes into account

the values of the function in some points (x i ) 0≤i≤k ,

the values of the successive derivatives of the function until order α i in x i .

Formulation

f is a sufficiently smooth function defined on [a, b], x 0 , . . . , x k are (k + 1) given points of [a, b],

α 0 , . . . , α k are (k + 1) integers.

Is it possible to find P satisfying

∀0 ≤ i ≤ k, P (j) (x i ) = f (j) (x i ), ∀0 ≤ j ≤ α i ?

(84)

IV. A few words about Hermite interpolation

1

Presentation of the problem

2

Main results

(85)

Analysis of the problem

Degree of P

Number of equations :

k

X

i=0

(α i + 1) = k + 1 +

k

X

i=0

α i .

Degree : n = k +

k

X

i=0

α i .

Definition

P is the Hermite interpolating polynomial of f in the

points (x i ) 0≤i≤k with the orders (α i ) 0≤i≤k

(86)

Theorem

Theorem : existence and uniqueness + interpolation error Hypotheses :

(x i ) 0≤i≤k , (k + 1) points in [a, b],

i ) 0≤i≤k , (k + 1) integers, n = k +

k

X

i=0

α i f : [a, b] → R , f ∈ C n+1 ([a, b]),

Then, there exists a unique polynomial P n ∈ R n [X] such that

∀0 ≤ i ≤ k, P n (j) (x i ) = f (j) (x i ), ∀0 ≤ j ≤ α i . Furthermore, for all x ∈ [a, b], there exists ξ x ∈ [a, b] such that

f (x) − P n (x) = 1

(n + 1)! Ω n (x)f (n+1)x ), with Ω n =

k

Y

i=0

(X − x i ) α

i

+1 .

(87)

V. Least squares method

1

The case of linear regression

(88)

Linear regression

We are looking for a 0 and b 0 such that the following distance is mini- mal :

d(a, b) =

n

X

i=1

(y i − (ax i + b)) 2 .

Necessary condition

∂d

∂a (a 0 , b 0 ) = 0 and ∂d

∂b (a 0 , b 0 ) = 0

⇐⇒

 

 

 

 

 a 0

n

X

i=1

x 2 i + b 0

n

X

i=1

x i =

n

X

i=1

x i y i

a 0 n

X

i=1

x i + b 0 n =

n

X

i=1

y i

(89)

Existence of a unique candidate (a 0 , b 0 )

Matrix of the linear system

A =

n

X

i=1

x 2 i

n

X

i=1

x i

n

X

i=1

x i n

= n

 1 n

n

X

i=1

x 2 i X ¯ X ¯ 1

Invertibility det A = n 2 ( 1

n

n

X

i=1

x 2 i − X ¯ 2 ) = n

n

X

i=1

(x i − X) ¯ 2 = n 2 V(X).

Conclusion

As soon as two x i are different, det A 6= 0 and there exists a unique (a 0 , b 0 ) susceptible to be a minimum of d :

a 0 = Cov(X, Y )

V(X) and b 0 = ¯ Y − a 0 X. ¯

(90)

(a 0 , b 0 ) is a minimizer of d

After some computations, we prove that d(a, b) − d(a 0 , b 0 ) =

n

X

i=1

((a 0 − a)x i + b 0 − b) 2 It yields

∀(a, b) ∈ R 2 d(a, b) ≥ d(a 0 , b 0 ).

Remark on the matrix A

A =

n

X

i=1

x 2 i

n

X

i=1

x i n

X

i=1

x i n

= B T B with B =

 x 1 1 x 2 1 .. . .. . x n 1

(91)

V. Least squares method

1

The case of linear regression

2

Generalization

(92)

Presentation of the problem

Given points

The cloud of points is still given by (x i ) 1≤i≤n and (y i ) 1≤i≤n . A space of functions

For some independent functions (ϕ 1 , · · · , ϕ m ), let us define U = {ϕ; ϕ =

m

X

i=1

u i ϕ i }

Search for a minimizer

We are looking for ϕ ∈ U such that

n

X

i=0

|y i − ϕ (x i )| 2 = min

ϕ∈U n

X

i=0

|y i − ϕ(x i )| 2 .

(93)

Main result

Theorem

As soon as two x i are different, the least squares problem admits a unique solution

ϕ =

m

X

i=1

u i ϕ i .

Futhermore, the vector u = (u 1 , · · · , u m ) is the unique solution of the linear system

B T Bu = B T y, with

B =

ϕ 1 (x 1 ) · · · ϕ m (x 1 )

.. . .. .

ϕ 1 (x n ) · · · ϕ m (x n )

Remark

In the linear case, m = 2 and ϕ 1 (x) = x, ϕ 2 (x) = 1.

Références

Documents relatifs

The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.. L’archive ouverte pluridisciplinaire HAL, est

While the discriminative framework is based on convex relaxations and has led to interesting developments and applications [Zhang et al., 2009, Li et al., 2009, Joulin et al.,

Keywords: Finite volume method - High order method - k-exact method - Cubic reconstruction - Numerical flux - Linear stability - Irregular grid - Coupled Least Squares.. Finite

Indeed, it generalizes the results of Birg´e and Massart (2007) on the existence of minimal penalties to heteroscedastic regression with a random design, even if we have to restrict

For each school, we observe the median starting salary of its graduates?. What signs do you expect for the other

Under sharp growth assumptions, the existence of controls has been obtained in [Fern´ andez-Cara & Zuazua, Null and approximate controllability for weakly blowing up

The purpose of this paper is twofold: stating a more general heuristics for designing a data- driven penalty (the slope heuristics) and proving that it works for penalized

Let’s matrix XXXX n x m be the brain activity data for n number of participants and m data points of the neuroimaging data (averaged ERP amplitude for each