Weighted Least-Squares for a Nearly Perfect Min-Max Fit

In this note, we experimentally demonstrate, on a variety of analytic and nonanalytic functions, the novel observation that if the least squares polynomial approximation is repeated as weight in a second, now weighted, least squares approximation, then this new, second, approximation is nearly perfect in the uniform sense, barely needing any further, say, Remez correction.


Introduction
Finding the min-max, or best L ∞ , polynomial approximation to a function, in some standard interval, is of the greatest interest in numerical analysis [1] [2].
For a polynomial function the least error distribution is a Chebyshev polynomial [3] [4] [5].
The usual procedure [6] [7] to find the best L ∞ approximation to a general function is to start with a good approximation, say in the 2 L sense, easily ob- tained by the minimization of a quadratic functional for the coefficients, then iteratively improving this initial approximation by a Remez-like correction procedure [8] [9] that strives to produce an error distribution that oscillates with a constant amplitude in the interval of interest.
In this note, we bring ample and varied computational evidence in support of the novel, worthy of notice, empirical numerical observation that taking the error distribution of a least squares, 2 L , best polynomial fit to a function, squared, as weight in a second, weighted, least squares approximation, results in an error distribution that is remarkably close to the best L ∞ , or uniform, approximation.

Fixing Ideas; The Best Quadratic in [−1, 1]
The monic Chebyshev polynomial is the solution of the min-max problem a This min-max solution, the least function in the L ∞ sense, is a polynomial that has two distinct roots, and oscillates with a constant amplitude in to have the value 1 3 0.3333 a = = .
Minimizing next ( ) I p , under the weight ( ) now with respect to p, we obtain 11 21 0.5238 p = = , which is surprisingly much closer to the optimal value of one half.
We may replace the difficult L ∞ measure by the computationally easier m L measure with an even 1 m  .Let a 0 be a good approximation, and 1 0 a a δ = + be an improved one.Minimization cum linearization produces the equation where Starting with 0 11 21 0.5238 a = = , we obtain from the above equation, for , as compared with the optimal 0.5 a = .

Optimal Cubic in [−1, 1]
Seeking to reproduce the optimal monic Chebyshev polynomial of degree three we start by minimizing ( ) and have 1 3 5 0.6 a = = .
Then we return to minimize the weighted ( ) and obtain 1 195 253 0.770751 p = = , which is considerably closer to the optimal value of 0.75.See Figure 1.
We are ready now for a Remez-like correction to bring the error function closer to optimal.The minimum of ( ) 3 0.770751 as compared with the Chebyshev optimal value of 1 3 4 0.75 a = = .

Best Cubic Approximation of e x in [0, 1]
To facilitate the integrations we use the approximation with respect to 0 1 2 3 , , , p p p p .
The nearly perfect result of this last minimization is shown in Figure 5.

Best Cubic Approximation of sinx in [0, 1]
To facilitate the integrations we take and obtain the least squares error distribution as in Figure 6.
The subsequent nearly perfect weighted least squares error distribution is shown in Figure 7.

Best Quadratic Fit to x in [0, 1]
We start with ( ) ( ) under the condition and minimize ( ) with respect to 1 a and 2 a , to have ( ) shown as curve a in Figure 8. ( )

Next we minimize
1 121 13 d 10 70 14  and obtain the nearly optimal error distribution as in Figure 10.

Another Difficult Function
We now look at the error distribution ( ) ( ) ( ) Figure 9. Least squares cubic fit to 1 4  x .
Figure 10.Weighted least squares cubic fit to 1 4  x .

Conclusion
We experimentally demonstrate, on a variety of continuous, analytic and nonanalytic functions, the remarkable observation that if the least squares polynomial approximation is taken as weight in a repeated, now weighted, least squares approximation, then this new, second, approximation is nearly perfect in the sense of Chebyshev, barely needing any further correction procedure.
previous ( ) e x squared, and obtain the new, nearly perfectly uniform ( ) e x of Figure3.By comparison, the amplitude of the monic Chebyshev polynomial of degree four in [0,1] is 1/128 = 0.0078125.
a a a a .The best ( ) e x obtained from this minimization is shown in Figure4.Then we use the square of the minimal ( ) e x just obtained, as weight in the

Figure 4 .
Figure 4. Least squares cubic fit to e x .

Figure 5 .
Figure 5. Weighted least squares cubic fit to e x .

Figure 8 .
Figure 8.(a) Least squares quadratic fit to x . (b) Weighted least squares quadratic fit to x .
b in Figure8, as compared with the optimal, in the L ∞ sense