<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">AM</journal-id><journal-title-group><journal-title>Applied Mathematics</journal-title></journal-title-group><issn pub-type="epub">2152-7385</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/am.2017.85051</article-id><article-id pub-id-type="publisher-id">AM-76282</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Physics&amp;Mathematics</subject></subj-group></article-categories><title-group><article-title>
 
 
  Weighted Least-Squares for a Nearly Perfect Min-Max Fit
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Isaac</surname><given-names>Fried</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Ye</surname><given-names>Feng</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib></contrib-group><aff id="aff1"><addr-line>Department of Mathematics, Boston University, Boston, MA, USA</addr-line></aff><author-notes><corresp id="cor1">* E-mail:<email>if@math.bu.edu(IF)</email>;</corresp></author-notes><pub-date pub-type="epub"><day>15</day><month>05</month><year>2017</year></pub-date><volume>08</volume><issue>05</issue><fpage>645</fpage><lpage>654</lpage><history><date date-type="received"><day>28,</day>	<month>February</month>	<year>2017</year></date><date date-type="rev-recd"><day>19,</day>	<month>May</month>	<year>2017</year>	</date><date date-type="accepted"><day>22,</day>	<month>May</month>	<year>2017</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  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.
 
</p></abstract><kwd-group><kwd>Least Squares-Approximation of Functions</kwd><kwd> Weighted Approximations</kwd><kwd> Nearly Perfect Uniform Fits</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>Finding the min-max, or best L ∞ , polynomial approximation to a function, in some standard interval, is of the greatest interest in numerical analysis [<xref ref-type="bibr" rid="scirp.76282-ref1">1</xref>] [<xref ref-type="bibr" rid="scirp.76282-ref2">2</xref>] . For a polynomial function the least error distribution is a Chebyshev polynomial [<xref ref-type="bibr" rid="scirp.76282-ref3">3</xref>] [<xref ref-type="bibr" rid="scirp.76282-ref4">4</xref>] [<xref ref-type="bibr" rid="scirp.76282-ref5">5</xref>] .</p><p>The usual procedure [<xref ref-type="bibr" rid="scirp.76282-ref6">6</xref>] [<xref ref-type="bibr" rid="scirp.76282-ref7">7</xref>] to find the best L ∞ approximation to a general function is to start with a good approximation, say in the L 2 sense, easily obtained by the minimization of a quadratic functional for the coefficients, then iteratively improving this initial approximation by a Remez-like correction procedure [<xref ref-type="bibr" rid="scirp.76282-ref8">8</xref>] [<xref ref-type="bibr" rid="scirp.76282-ref9">9</xref>] that strives to produce an error distribution that oscillates with a constant amplitude in the interval of interest.</p><p>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, L 2 , 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.</p></sec><sec id="s2"><title>2. Fixing Ideas; The Best Quadratic in [−1, 1]</title><p>The monic Chebyshev polynomial</p><p>T 2 ( x ) = x 2 − 1 2 ,   − 1 ≤ x ≤ 1 (1)</p><p>is the solution of the min-max problem</p><p>min a max x e ( x ) ,   e ( x ) = x 2 − a ,   − 1 ≤ x ≤ 1. (2)</p><p>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 − 1 ≤ x ≤ 1 , e ( − 1 ) = − e ( 0 ) = e ( 1 ) . Indeed, say e 1 = x 2 + a 0 + a 1 x is such a polynomial, and e 2 = x 2 + p 0 + p 1 x is another quadratic polynomial, then e 1 ≤ e 2 in the interval, for otherwise e 1 and e 2 would intersect at two points, which is absurd; x 2 + a 0 + a 1 x = x 2 + p 0 + p 1 x is either an identity, or has but the one solution x = − ( p 0 − a 0 ) / ( p 1 − a 1 ) .</p><p>Thus, the monic Chebyshev polynomial of degree n is the least, uniform, or pointwise, error distribution in approximating x n by a polynomial of degree n − 1 .</p><p>To obtain a least squares, a best L 2 , approximation to T 2 ( x ) we first minimize I ( a )</p><p>I ( a ) = ∫ − 1 1 ( x 2 − a ) 2 d x ,   I ′ ( a ) = ∫ − 1 1 ( x 2 − a ) d x = 0 (3)</p><p>to have the value a = 1 / 3 = 0.3333 .</p><p>Minimizing next I ( p ) , under the weight ( x 2 − a ) 2 , a = 1 / 3</p><p>#Math_28# (4)</p><p>now with respect to p, we obtain p = 11 / 21 = 0.5238 , which is surprisingly much closer to the optimal value of one half.</p><p>We may replace the difficult L ∞ measure by the computationally easier L m measure with an even m ≫ 1 . Let a<sub>0</sub> be a good approximation, and a 1 = a 0 + δ be an improved one. Minimization cum linearization produces the equation</p><p>∫ − 1 1 ( x 2 − a 0 ) n d x − n δ ∫ − 1 1 ( x 2 − a 0 ) n − 1 d x = 0 (5)</p><p>where n ≫ 1 is odd.</p><p>Starting with a 0 = 11 / 21 = 0.5238 , we obtain from the above equation, for n = 17 , the value a 1 = 0.495 , as compared with the optimal a = 0.5 .</p></sec><sec id="s3"><title>3. Optimal Cubic in [−1, 1]</title><p>Seeking to reproduce the optimal monic Chebyshev polynomial of degree three</p><p>T 3 ( x ) = x 3 − 3 4 x ,   − 1 ≤ x ≤ 1 (6)</p><p>we start by minimizing I ( a 1 )</p><p>I ( a 1 ) = ∫ − 1 1 ( x 3 − a 1 x ) 2   d x ,     I ′ ( a 1 ) = ∫ − 1 1   x ( x 3 − a 1 x ) d x = 0 (7)</p><p>and have a 1 = 3 / 5 = 0.6 .</p><p>Then we return to minimize the weighted I ( p 1 ) with respect to p 1</p><p>I ( p 1 ) = ∫ − 1 1 ( x 3 − a 1 x ) 2 ( x 3 − p 1 x ) 2 d x , I ′ ( p 1 ) = ∫ − 1 1     x ( x 3 − a 1 x ) 2 ( x 3 − p 1 x ) d x = 0 (8)</p><p>and obtain p 1 = 195 / 253 = 0.770751 , which is considerably closer to the optimal value of 0.75. See <xref ref-type="fig" rid="fig1">Figure 1</xref>.</p><p>We are ready now for a Remez-like correction to bring the error function closer to optimal. The minimum of e ( x ) = x 3 − 0.770751 x occurs at m = 0.50687. We write a new tentative e ( x ) = x 3 − a 1 x and request that − e ( m ) = e ( 1 ) , by which we have</p><p>a 1 = 1 + m 3 1 + m = 0.750047 (9)</p><p>as compared with the Chebyshev optimal value of a 1 = 3 / 4 = 0.75 .</p></sec><sec id="s4"><title>4. Optimal Quartic in [0, 1]</title><p>Starting with</p><p>e ( x ) = x 4 + a 3 x 3 + a 2 x 2 + a 1 x + a 0 (10)</p><p>we minimize</p><p>I ( a 0 , a 1 , a 2 , a 3 ) = ∫ 0 1     e ( x ) 2 d x (11)</p><p>and obtain the best, in the L 2 sense, e ( x ) shown in <xref ref-type="fig" rid="fig2">Figure 2</xref>.</p><p>Then we return to minimize</p><p>I ( p 0 , p 1 , p 2 , p 3 ) = ∫ 0 1     e ( x ) 2 ( x 4 + p 3 x 3 + p 2 x 2 + p 1 x + p 0 ) 2 d x (12)</p><p>weighted by the previous e ( x ) squared, and obtain the new, nearly perfectly uniform e ( x ) of <xref ref-type="fig" rid="fig3">Figure 3</xref>.</p><p>By comparison, the amplitude of the monic Chebyshev polynomial of degree four in [0,1] is 1/128 = 0.0078125.</p></sec><sec id="s5"><title>5. Best Cubic Approximation of e<sup>x</sup> in [0, 1]</title><p>To facilitate the integrations we use the approximation</p><p>e x = 1 + x + 1 2 ! x 2 + 1 3 ! x 3 + 1 4 ! x 4 + 1 5 ! x 5 + 1 6 ! x 6 + 1 7 ! x 7 (13)</p><p>and minimize</p><p>I ( a 0 , a 1 , a 2 , a 3 ) = ∫ 0 1     e ( x ) 2 d x ,   e ( x ) = e x + a 0 + a 1 x + a 2 x 2 + a 3 x 3 (14)</p><p>with respect to a 0 , a 1 , a 2 , a 3 . The best e ( x ) obtained from this minimization is shown in <xref ref-type="fig" rid="fig4">Figure 4</xref>.</p><p>Then we use the square of the minimal e ( x ) just obtained, as weight in the next minimization of</p><p>I ( p 0 , p 1 , p 2 , p 3 ) = ∫ 0 1     e ( x ) 2 ( e x + p 0 + p 1 x + p 2 x 2 + p 3 x 3 ) 2 d x (15)</p><p>with respect to p 0 , p 1 , p 2 , p 3 .</p><p>The nearly perfect result of this last minimization is shown in <xref ref-type="fig" rid="fig5">Figure 5</xref>.</p></sec><sec id="s6"><title>6. Best Cubic Approximation of sinx in [0, 1]</title><p>To facilitate the integrations we take</p><p>sin x = x − 1 3 ! x 3 + 1 5 ! x 5 − 1 7 ! x 7 + 1 9 ! x 9 (16)</p><p>and obtain the least squares error distribution as in <xref ref-type="fig" rid="fig6">Figure 6</xref>.</p><p>The subsequent nearly perfect weighted least squares error distribution is shown in <xref ref-type="fig" rid="fig7">Figure 7</xref>.</p></sec><sec id="s7"><title>7. Best Quadratic Fit to x in [0, 1]</title><p>We start with</p><p>e ( x ) = x − ( a 0 + a 1 x + a 2 x 2 ) ,   0 ≤ x ≤ 1 (17)</p><p>under the condition</p><p>e ( 0 ) = − e ( 1 ) ,   a 0 = 1 2 ( 1 − a 1 − a 2 ) (18)</p><p>and minimize</p><p>I ( a 1 , a 2 ) = ∫ 0 1 ( x − 1 2 − a 1 ( x − 1 2 ) − a 2 ( x 2 − 1 2 ) ) 2 d x (19)</p><p>with respect to a 1 and a 2 , to have</p><p>e ( x ) = x − ( 1 10 + 121 70 x − 13 14 x 2 ) ,   0 ≤ x ≤ 1 (20)</p><p>shown as curve a in <xref ref-type="fig" rid="fig8">Figure 8</xref>.</p><p>Next we minimize</p><p>I ( p 1 , p 2 ) = ∫ 0 1 ( x − 1 2 − p 1 ( x − 1 2 ) − p 2 ( x 2 − 1 2 ) ) 2                                     ⋅ ( x − ( 1 10 + 121 70 x − 13 14 x 2 ) ) 2 d x (21)</p><p>and obtain</p><p>e ( x ) = x − ( 0.064 + 1.949 x − 1.077 x 2 ) ,   0 ≤ x ≤ 1 (22)</p><p>shown as graph b in <xref ref-type="fig" rid="fig8">Figure 8</xref>, as compared with the optimal, in the L ∞ sense</p><p>e ( x ) = x − ( 0.0674385 + 1.93059 x − 1.06547 x 2 ) ,   0 ≤ x ≤ 1. (23)</p></sec><sec id="s8"><title>8. Best Cubic Fit to x<sup>1/4</sup> in [0, 1]</title><p>We start with</p><p>e ( x ) = x 1 / 4 + a 0 + a 1 x + a 2 x 2 + a 3 x 3 ,   0 ≤ x ≤ 1 (24)</p><p>under the restriction e ( 0 ) = e ( 1 ) , or a 3 = − 1 − a 1 − a 2 , and minimize</p><p>I ( a 0 , a 1 , a 2 ) = ∫ 0 1 ( x 1 / 4 − x 3 + a 0 + a 1 ( x − x 3 ) + a 2 ( x 2 − x 3 ) ) 2 d x (25)</p><p>with respect to a 0 , a 1 , a 2 to have the minimal e ( x ) shown in <xref ref-type="fig" rid="fig9">Figure 9</xref>.</p><p>Then we minimize</p><p>I ( p 0 , p 1 , p 2 ) = ∫ 0 1     e ( x ) 2 ( x 1 / 4 − x 3 + p 0 + p 1 ( x − x 3 ) + p 2 ( x 2 − x 3 ) ) 2 d x (26)</p><p>and obtain the nearly optimal error distribution as in <xref ref-type="fig" rid="fig1">Figure 1</xref>0.</p></sec><sec id="s9"><title>9. Another Difficult Function</title><p>We now look at the error distribution</p><p>e ( x ) = ln ( 1.001 + x ) − ( a 3 x 3 + a 2 x 2 + a 1 x + a 0 ) ,   − 1 ≤ x ≤ 1 (27)</p><p>under the condition that e ( 1 ) = e ( − 1 ) , or a 3 = 3.8007012 − a 1 .</p><p>Least squares minimization of e ( x ) yields the error distribution in <xref ref-type="fig" rid="fig1">Figure 1</xref>1.</p><p>Next we minimize</p><p>#Math_100# (28)</p><p>under the restriction that p 3 = 3.8007012 − p 1 , and obtain the nearly perfect error distribution shown in <xref ref-type="fig" rid="fig1">Figure 1</xref>2.</p></sec><sec id="s10"><title>10. Conclusion</title><p>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.</p></sec><sec id="s11"><title>Cite this paper</title><p>Fried, I. and Feng, Y. (2017) Weighted Least-Squares for a Nearly Perfect Min-Max Fit. Applied Mathematics, 8, 645-654. https://doi.org/10.4236/am.2017.85051</p></sec></body><back><ref-list><title>References</title><ref id="scirp.76282-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Linz, P. and Wang, R. (2003) Exploring Numerical Methods: An introduction to Scientific Computing Using MATLAB. Jones and Bartlett, Boston.</mixed-citation></ref><ref id="scirp.76282-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Meinardus, G. (1967) Approximation of Functions: Theory and Numerical Methods, Springer, Berlin. https://doi.org/10.1007/978-3-642-85643-3</mixed-citation></ref><ref id="scirp.76282-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Veidinger, L. (1960) On the Numerical Determination of the Best Approximations in the Chebychev Sense. Numerische Mathematik, 2, 99-105.  
https://doi.org/10.1007/BF01386215</mixed-citation></ref><ref id="scirp.76282-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Snyder, M.A. (1966) Chebyshev Methods in Numerical Approximation. Prentice-Hall, New Jersey.</mixed-citation></ref><ref id="scirp.76282-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Cody, W.J. (1970) A Survey of Practical Rational and Polynomial Approximation of Functions. SIAM Review, 12, 400-423. https://doi.org/10.1137/1012082</mixed-citation></ref><ref id="scirp.76282-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Fraser, W. (1965) A Survey of Methods of Computing Minimax and Near-Minimax Polynomial Approximations for Functions of a Single Independent Variable. J. ACM, 12, 295-314. https://doi.org/10.1145/321281.321282</mixed-citation></ref><ref id="scirp.76282-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Psarakis, E.Z. and Moustakides G.V. (2003) A Robust Initialization Scheme for the Remez Exchange Algorithm. IEEE Signal Processing Letters, 10, 1-3.  
https://doi.org/10.1109/LSP.2002.806701</mixed-citation></ref><ref id="scirp.76282-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Huddleston, R.E. (1974) On the Conditional Equivalence of Two Starting Methods for the Second Algorithm of Remez. Mathematics of Computation, 28, 569-572.  
https://doi.org/10.1090/S0025-5718-1974-0341804-6</mixed-citation></ref><ref id="scirp.76282-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Pachon, R. and Trefethen, L.N. (2009) Barycentric-Remez Algorithms for Best Polynomial Approximation in the chebfun System. BIT Numerical Mathematics, 49, 721-741. https://doi.org/10.1007/s10543-009-0240-1</mixed-citation></ref></ref-list></back></article>