2.1 Interpolation and Polynomials

2.1.1 Problem Setup and the Interpolation Condition

Want approximation in a linear subspace with and basis :

→ not a least-squares fit: the interpolant passes through all data points .
for least squares we would want the one “closest” to all points equally.

has many different bases, each of which gives us different properties (numerical stability, ease of use, adding new datapoints, etc…)

Note: Taylor formula around is not suitable for numerical computation

  • only approximates locally
  • requires derivatives (hard or impossible to compute)

→ smoother ⇒ better convergence (approaches analytical)

2.1.5 The Space and the Monomial Basis

Space of Polynomials

The space of polynomials of degree , , is

Properties of

is a vector space of dimension , and .

Proof: The monomials of degree form a basis of , so . All polynomials are infinitely often continuously differentiable, hence .

Uniqueness

A polynomial is uniquely determined by its values at pairwise distinct nodes.

→ see Diskmath for proof

We can use the monomial basis to approximate a function. This corresponds to solving the following system: For through :

→ Vandermonde matrix = very badly conditioned

  • small perturbations will amplify a lot. Thus it’s bad for use with computers.
    ⇒ computed coefficients are very inaccurate

Note: If we had infinite precision, we would get a correct answer (as guaranteed by the linear algebra). There is nothing wrong with the approach, only with computers.

Note: In the Vandermonde matrix, because look very similar on interval , so in floating point precision they look linearly dependent.

  • i.e. no inverse / we don’t span the space

This has a runtime of for solving and for evaluation.

Note: This is what polyfit computes internally (warns: RankWarning: Polyfit may be poorly conditioned.)

→ The fix is to use a better basis.

Extra: Condition Number

The condition number basically tells us how much a slight numerical error in the input affects the output → “amplification factor”

Condition Number

Let be a problem between normed spaces and let with and . The relative condition number of at is

Note problem is well-conditioned at if is small and ill-conditioned if is large

  • property of the problem not of the algorithm

Note: A backward-stable algorithm achieves a relative forward error of order .

Condition Number of a Matrix

For an invertible matrix and an induced matrix norm , the condition number of is

In the -norm, .

2.1.7 Evaluation via the Horner Scheme

Using the horner schema, we can evauluate with a monomial basis, using the least number of operations. It has a very small backwards error.

Horner Scheme

Note: equivalent to the normal polynomial evaluation, but is more numerically stable

numpy.polyval(p, x) evaluates it via Horner:

def horner(p, x):
    y = p[0]
    for i in range(1, len(p)):
        y = x * y + p[i]
    return y

2.2 Newton Basis and Divided Differences

Monomial basis: new data points → recomputing the whole interpolant.

WARNING

Why choose Newton? The Newton basis allows adding nodes without redoing everything.

By uniqueness (a polynomial of degree can be uniquely determined by datapoints), these polynomials coincide with those obtained naively.

2.2.2 The Newton Basis

Dividierte Differenzen sind diskrete Analoga der Taylor-Koeffizienten , und die Newton-Form ist das diskrete Analogon der Taylor-Entwicklung, mit Entwicklung um mehrere Punkte statt um einen.

Runtime:

  • solving via divided differences
  • für Auswertung
  • for adding new point! → the previous are not affected

Newton Basis

The polynomials

with

form a basis of .

The coefficients of solve the lower triangular system (→ we expand it gradually, each depends only on previous)

2.2.3 Divided Differences

Via divided differences, we can evaluate the coefficients of the polynomial quickly.

Divided Differences

They are computed with the tableau (each denotes one application of the recursion, basically DP on the coefficients):

Which gives the final polynomial:

→ the coefficients are the leftmost diagonal in the tableau

Interpolation Error: the error for Stützstellen in is at most

→ Proof siehe Skript

Note that for numerical stability, it matters a lot in which orders we consider the nodes! For divided difference we subtract in the denominator → this leads to blow-up if we choose nodes close together.
The Leja order maximises this distance →

2.3 Lagrange and Barycentric Interpolation

WARNING

Warum Lagrange? Wir wollen Basis die basically nichts zum rechnen hat

  • Lagrange ist eine Cardinal basis mit und für .

→ Die coefficients sind einfach die values selbst!

2.3.1 Lagrange Polynomials

Lagrange Polynomials

For nodes define

Diese Polynome formen eine Basis des Raums , wir können sie daher also auch verwenden um unsere Interpolation durchzuführen.

Properties:

  1. for all
  2. for all
  3. for all
  4. and for

Proof: Lagrange ist eine Basis:

  • Assume for contradiction
  • Da bei Lagrange coefficients und hier gilt
    • müssen alle Koeffizienten auch 0 sein.

2.3.2 The Barycentric Formula

Runtime:

  • solving via barycentric
  • für Auswertung
  • for adding new point!

With and

we get .

For the constant polynomial this gives , hence the barycentric formula:

  • extremely stable for
    • because orthogonal, no fighting on the ‘s?
  • costs per evaluation after precomputing the in

→ weil es nur ein Polynom gibt mit Grad k für k+1 Terme, ist es auch sicher das richtige (egal wie weird es aussieht).

2.3.5 Fehler

The error depends only on the choice of nodes! The optimal choice are Chebychev-Nodes as we’ll see next.

Interpolation Error vs. Best Approximation

Let and its interpolation polynomial at . Then

Note: Für gleichmässig auf verteilte Stützstellen gilt .

Deswegen sollten wir niemals gleichverteilte Stützstellen wählen → sie führen zum Runge-Phänomen.

2.4 Chebyshev Interpolation

Runtime

MethodOperations
Direct computation of
Divided differences (comparison)
via FFT

Um das Runge-Phänomen zu vermeiden, wählen wir die Stützstellen so, dass am Rand mehr sind.

Chebyshev Polynomials of the First Kind

→ Schaut eigentlich nicht nach Polynomial aus???
ist es aber trotzdem → siehe Rekursionsformel.

is a polynomial of degree , and for :

  1. , ,
  2. for
  3. for

Proof (Recursion): We have

Setting gives the recurrence, which also shows that is a polynomial.

2.4.3 Chebyshev Nodes and Chebyshev Abscissae

Nodes vs. Abscissae → kein wirklicher Unterschied, sind nur zwei Familien von Stützstellen.

Chebyshev Nodes

The Chebyshev nodes in are the zeros of .

On an arbitrary interval :

Chebyshev Abscissae

The Chebyshev abscissae in are the extrema of ; they are also the zeros of . Depending on context, the points and are added, giving Chebyshev abscissae.

On an arbitrary interval :

Excluding the endpoints and , .

LEMMA

When we use Chebychev Abscissae (second kind), the (for , we have ).
This makes computing the ‘s extremely fast and easy (and stable).

The Chebyshev nodes/abscissae become denser towards the boundary of the interval
→ This is because at the boundary we observe these fluctuations = polynomial trying to “escape”

Note: für glatte Funktionen liefert Lagrange + Chebychev exponentiell schnelle Fehler-Konvergenz in für .

2.4.4 Orthogonality: Continuous and Discrete

Orthogonality I

The Chebyshev polynomials are orthogonal with respect to

Proof: Substituting , :

Orthogonality II

are orthogonal in with respect to the discrete inner product

where are the zeros of .

Wie vorher gesehen, hängt der Fehler nur vom choice der Stützstellen ab.

is minimal for , the zeros of .

The Chebyshev abscissae are therefore the best possible choice and are preferred in practice (because of some extra properties).

Auswertung Chebychev

Der Clenshaw-Algorithmus zur Auswertung ist sehr stabil. Man kann damit mithilfe einer Rückwärts-Rekursion berechnen.

Man kann Chebychev-Polynome sehr stabil berechnen, anhand dieser Rückwertsrekursion.

Clenshaw

Es gilt mit und per Rekursion