Spline Toolbox    

Remez Iteration

Starting from this approximation, we use the Remez algorithm to produce a sequence of splines converging to . This means that we construct new as the extrema of our current approximation to and try again. Here is the entire loop.

We find the new interior as the zeros of , i.e., the first derivative of , in several steps. First, we differentiate:

Next, we take the zeros of the control polygon of as our first guess for the zeros of . For this, we must take apart the spline Dc.

The control polygon has the vertices (tstar(i),coefs(i)), with tstar the knot averages for the spline, provided by aveknt:

Here are the zeros of the resulting control polygon of Dc:

This provides already a very good first guess for the actual zeros.

We refine this estimate for the zeros of by two steps of the secant method, taking tau and the resulting guess as our first approximations. First, we evaluate at both sets:

Now come two steps of the secant method. We guard against division by zero by setting the function value difference to 1 in case it is zero. Since is strictly monotone near the sites sought, this is harmless:

The check

shows the improvement.

Now we take these sites as our new tau,

and check the extrema values of our current approximation there:

The difference

is an estimate of how far we are from total leveling.

We construct a new spline corresponding to our new choice of tau and plot it on top of the old:

Here is the resulting picture.

Figure 2-18: A More Nearly Level Spline

If this is not close enough, one simply reiterates the loop. For this example, the next iteration already produces to graphic accuracy.


  Initial Guess Example: Approximation by Tensor Product Splines