Remez algorithm

From HandWiki
Short description: Algorithm to approximate functions

The Remez algorithm or Remez exchange algorithm, published by Evgeny Yakovlevich Remez in 1934, is an iterative algorithm used to find simple approximations to functions, specifically, approximations by functions in a Chebyshev space that are the best in the uniform norm L sense.[1] It is sometimes referred to as Remes algorithm or Reme algorithm.[citation needed]

A typical example of a Chebyshev space is the subspace of Chebyshev polynomials of order n in the space of real continuous functions on an interval, C[a, b]. The polynomial of best approximation within a given subspace is defined to be the one that minimizes the maximum absolute difference between the polynomial and the function. In this case, the form of the solution is precised by the equioscillation theorem.

Procedure

The Remez algorithm starts with the function [math]\displaystyle{ f }[/math] to be approximated and a set [math]\displaystyle{ X }[/math] of [math]\displaystyle{ n + 2 }[/math] sample points [math]\displaystyle{ x_1, x_2, ...,x_{n+2} }[/math] in the approximation interval, usually the extrema of Chebyshev polynomial linearly mapped to the interval. The steps are:

  • Solve the linear system of equations
[math]\displaystyle{ b_0 + b_1 x_i+ ... +b_n x_i ^ n + (-1)^ i E = f(x_i) }[/math] (where [math]\displaystyle{ i=1, 2, ... n+2 }[/math]),
for the unknowns [math]\displaystyle{ b_0, b_1...b_n }[/math] and E.
  • Use the [math]\displaystyle{ b_i }[/math] as coefficients to form a polynomial [math]\displaystyle{ P_n }[/math].
  • Find the set [math]\displaystyle{ M }[/math] of points of local maximum error [math]\displaystyle{ |P_n(x) - f(x)| }[/math].
  • If the errors at every [math]\displaystyle{ m \in M }[/math] are of equal magnitude and alternate in sign, then [math]\displaystyle{ P_n }[/math] is the minimax approximation polynomial. If not, replace [math]\displaystyle{ X }[/math] with [math]\displaystyle{ M }[/math] and repeat the steps above.

The result is called the polynomial of best approximation or the minimax approximation algorithm.

A review of technicalities in implementing the Remez algorithm is given by W. Fraser.[2]

Choice of initialization

The Chebyshev nodes are a common choice for the initial approximation because of their role in the theory of polynomial interpolation. For the initialization of the optimization problem for function f by the Lagrange interpolant Ln(f), it can be shown that this initial approximation is bounded by

[math]\displaystyle{ \lVert f - L_n(f)\rVert_\infty \le (1 + \lVert L_n\rVert_\infty) \inf_{p \in P_n} \lVert f - p\rVert }[/math]

with the norm or Lebesgue constant of the Lagrange interpolation operator Ln of the nodes (t1, ..., tn + 1) being

[math]\displaystyle{ \lVert L_n\rVert_\infty = \overline{\Lambda}_n(T) = \max_{-1 \le x \le 1} \lambda_n(T; x), }[/math]

T being the zeros of the Chebyshev polynomials, and the Lebesgue functions being

[math]\displaystyle{ \lambda_n(T; x) = \sum_{j = 1}^{n + 1} \left| l_j(x) \right|, \quad l_j(x) = \prod_{\stackrel{i = 1}{i \ne j}}^{n + 1} \frac{(x - t_i)}{(t_j - t_i)}. }[/math]

Theodore A. Kilgore,[3] Carl de Boor, and Allan Pinkus[4] proved that there exists a unique ti for each Ln, although not known explicitly for (ordinary) polynomials. Similarly, [math]\displaystyle{ \underline{\Lambda}_n(T) = \min_{-1 \le x \le 1} \lambda_n(T; x) }[/math], and the optimality of a choice of nodes can be expressed as [math]\displaystyle{ \overline{\Lambda}_n - \underline{\Lambda}_n \ge 0. }[/math]

For Chebyshev nodes, which provides a suboptimal, but analytically explicit choice, the asymptotic behavior is known as[5]

[math]\displaystyle{ \overline{\Lambda}_n(T) = \frac{2}{\pi} \log(n + 1) + \frac{2}{\pi}\left(\gamma + \log\frac{8}{\pi}\right) + \alpha_{n + 1} }[/math]

(γ being the Euler–Mascheroni constant) with

[math]\displaystyle{ 0 \lt \alpha_n \lt \frac{\pi}{72 n^2} }[/math] for [math]\displaystyle{ n \ge 1, }[/math]

and upper bound[6]

[math]\displaystyle{ \overline{\Lambda}_n(T) \le \frac{2}{\pi} \log(n + 1) + 1 }[/math]

Lev Brutman[7] obtained the bound for [math]\displaystyle{ n \ge 3 }[/math], and [math]\displaystyle{ \hat{T} }[/math] being the zeros of the expanded Chebyshev polynomials:

[math]\displaystyle{ \overline{\Lambda}_n(\hat{T}) - \underline{\Lambda}_n(\hat{T}) \lt \overline{\Lambda}_3 - \frac{1}{6} \cot \frac{\pi}{8} + \frac{\pi}{64} \frac{1}{\sin^2(3\pi/16)} - \frac{2}{\pi}(\gamma - \log\pi)\approx 0.201. }[/math]

Rüdiger Günttner[8] obtained from a sharper estimate for [math]\displaystyle{ n \ge 40 }[/math]

[math]\displaystyle{ \overline{\Lambda}_n(\hat{T}) - \underline{\Lambda}_n(\hat{T}) \lt 0.0196. }[/math]

Detailed discussion

This section provides more information on the steps outlined above. In this section, the index i runs from 0 to n+1.

Step 1: Given [math]\displaystyle{ x_0, x_1, ... x_{n+1} }[/math], solve the linear system of n+2 equations

[math]\displaystyle{ b_0 + b_1 x_i+ ... +b_n x_i ^ n + (-1) ^ i E = f(x_i) }[/math] (where [math]\displaystyle{ i=0, 1, ... n+1 }[/math]),
for the unknowns [math]\displaystyle{ b_0, b_1, ...b_n }[/math] and E.

It should be clear that [math]\displaystyle{ (-1)^i E }[/math] in this equation makes sense only if the nodes [math]\displaystyle{ x_0, ...,x_{n+1} }[/math] are ordered, either strictly increasing or strictly decreasing. Then this linear system has a unique solution. (As is well known, not every linear system has a solution.) Also, the solution can be obtained with only [math]\displaystyle{ O(n^2) }[/math] arithmetic operations while a standard solver from the library would take [math]\displaystyle{ O(n^3) }[/math] operations. Here is the simple proof:

Compute the standard n-th degree interpolant [math]\displaystyle{ p_1(x) }[/math] to [math]\displaystyle{ f(x) }[/math] at the first n+1 nodes and also the standard n-th degree interpolant [math]\displaystyle{ p_2(x) }[/math] to the ordinates [math]\displaystyle{ (-1)^i }[/math]

[math]\displaystyle{ p_1(x_i) = f(x_i), p_2(x_i) = (-1)^i, i = 0, ..., n. }[/math]

To this end, use each time Newton's interpolation formula with the divided differences of order [math]\displaystyle{ 0, ...,n }[/math] and [math]\displaystyle{ O(n^2) }[/math] arithmetic operations.

The polynomial [math]\displaystyle{ p_2(x) }[/math] has its i-th zero between [math]\displaystyle{ x_{i-1} }[/math] and [math]\displaystyle{ x_i,\ i=1, ...,n }[/math], and thus no further zeroes between [math]\displaystyle{ x_n }[/math] and [math]\displaystyle{ x_{n+1} }[/math]: [math]\displaystyle{ p_2(x_n) }[/math] and [math]\displaystyle{ p_2(x_{n+1}) }[/math] have the same sign [math]\displaystyle{ (-1)^n }[/math].

The linear combination [math]\displaystyle{ p(x) := p_1 (x) - p_2(x)\!\cdot\!E }[/math] is also a polynomial of degree n and

[math]\displaystyle{ p(x_i) = p_1(x_i) - p_2(x_i)\!\cdot\! E \ = \ f(x_i) - (-1)^i E,\ \ \ \ i =0, \ldots, n. }[/math]

This is the same as the equation above for [math]\displaystyle{ i = 0, ... ,n }[/math] and for any choice of E. The same equation for i = n+1 is

[math]\displaystyle{ p(x_{n+1}) \ = \ p_1(x_{n+1}) - p_2(x_{n+1})\!\cdot\!E \ = \ f(x_{n+1}) - (-1)^{n+1} E }[/math] and needs special reasoning: solved for the variable E, it is the definition of E:
[math]\displaystyle{ E \ := \ \frac{p_1(x_{n+1}) - f(x_{n+1})}{p_2(x_{n+1}) + (-1)^n}. }[/math]

As mentioned above, the two terms in the denominator have same sign: E and thus [math]\displaystyle{ p(x) \equiv b_0 + b_1x + \ldots + b_nx^n }[/math] are always well-defined.

The error at the given n+2 ordered nodes is positive and negative in turn because

[math]\displaystyle{ p(x_i) - f(x_i) \ = \ -(-1)^i E,\ \ i = 0, ... , n\!+\!1. }[/math]

The theorem of de La Vallée Poussin states that under this condition no polynomial of degree n exists with error less than E. Indeed, if such a polynomial existed, call it [math]\displaystyle{ \tilde p(x) }[/math], then the difference [math]\displaystyle{ p(x)-\tilde p(x) = (p(x) - f(x)) - (\tilde p(x) - f(x)) }[/math] would still be positive/negative at the n+2 nodes [math]\displaystyle{ x_i }[/math] and therefore have at least n+1 zeros which is impossible for a polynomial of degree n. Thus, this E is a lower bound for the minimum error which can be achieved with polynomials of degree n.

Step 2 changes the notation from [math]\displaystyle{ b_0 + b_1x + ... + b_nx^n }[/math] to [math]\displaystyle{ p(x) }[/math].

Step 3 improves upon the input nodes [math]\displaystyle{ x_0, ..., x_{n+1} }[/math] and their errors [math]\displaystyle{ \pm E }[/math] as follows.

In each P-region, the current node [math]\displaystyle{ x_i }[/math] is replaced with the local maximizer [math]\displaystyle{ \bar{x}_i }[/math] and in each N-region [math]\displaystyle{ x_i }[/math] is replaced with the local minimizer. (Expect [math]\displaystyle{ \bar{x}_0 }[/math] at A, the [math]\displaystyle{ \bar {x}_i }[/math] near [math]\displaystyle{ x_i }[/math], and [math]\displaystyle{ \bar{x}_{n+1} }[/math] at B.) No high precision is required here, the standard line search with a couple of quadratic fits should suffice. (See [9])

Let [math]\displaystyle{ z_i := p(\bar{x}_i) - f(\bar{x}_i) }[/math]. Each amplitude [math]\displaystyle{ |z_i| }[/math] is greater than or equal to E. The Theorem of de La Vallée Poussin and its proof also apply to [math]\displaystyle{ z_0, ... ,z_{n+1} }[/math] with [math]\displaystyle{ \min\{|z_i|\} \geq E }[/math] as the new lower bound for the best error possible with polynomials of degree n.

Moreover, [math]\displaystyle{ \max\{|z_i|\} }[/math] comes in handy as an obvious upper bound for that best possible error.

Step 4: With [math]\displaystyle{ \min\,\{|z_i|\} }[/math] and [math]\displaystyle{ \max\,\{|z_i|\} }[/math] as lower and upper bound for the best possible approximation error, one has a reliable stopping criterion: repeat the steps until [math]\displaystyle{ \max\{|z_i|\} - \min\{|z_i|\} }[/math] is sufficiently small or no longer decreases. These bounds indicate the progress.

Variants

Some modifications of the algorithm are present on the literature.[10] These include:

  • Replacing more than one sample point with the locations of nearby maximum absolute differences.[citation needed]
  • Replacing all of the sample points with in a single iteration with the locations of all, alternating sign, maximum differences.[11]
  • Using the relative error to measure the difference between the approximation and the function, especially if the approximation will be used to compute the function on a computer which uses floating point arithmetic;
  • Including zero-error point constraints.[11]
  • The Fraser-Hart variant, used to determine the best rational Chebyshev approximation.[12]

See also

References

  1. E. Ya. Remez, "Sur la détermination des polynômes d'approximation de degré donnée", Comm. Soc. Math. Kharkov 10, 41 (1934);
    "Sur un procédé convergent d'approximations successives pour déterminer les polynômes d'approximation, Compt. Rend. Acad. Sc. 198, 2063 (1934);
    "Sur le calcul effectiv des polynômes d'approximation des Tschebyscheff", Compt. Rend. Acade. Sc. 199, 337 (1934).
  2. 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 (3): 295–314. doi:10.1145/321281.321282. 
  3. Kilgore, T. A. (1978). "A characterization of the Lagrange interpolating projection with minimal Tchebycheff norm". J. Approx. Theory 24 (4): 273–288. doi:10.1016/0021-9045(78)90013-8. 
  4. de Boor, C.; Pinkus, A. (1978). "Proof of the conjectures of Bernstein and Erdös concerning the optimal nodes for polynomial interpolation". Journal of Approximation Theory 24 (4): 289–303. doi:10.1016/0021-9045(78)90014-X. 
  5. Luttmann, F. W.; Rivlin, T. J. (1965). "Some numerical experiments in the theory of polynomial interpolation". IBM J. Res. Dev. 9 (3): 187–191. doi:10.1147/rd.93.0187. 
  6. T. Rivlin, "The Lebesgue constants for polynomial interpolation", in Proceedings of the Int. Conf. on Functional Analysis and Its Application, edited by H. G. Garnier et al. (Springer-Verlag, Berlin, 1974), p. 422; The Chebyshev polynomials (Wiley-Interscience, New York, 1974).
  7. Brutman, L. (1978). "On the Lebesgue Function for Polynomial Interpolation". SIAM J. Numer. Anal. 15 (4): 694–704. doi:10.1137/0715046. Bibcode1978SJNA...15..694B. 
  8. Günttner, R. (1980). "Evaluation of Lebesgue Constants". SIAM J. Numer. Anal. 17 (4): 512–520. doi:10.1137/0717043. Bibcode1980SJNA...17..512G. 
  9. David G. Luenberger: Introduction to Linear and Nonlinear Programming, Addison-Wesley Publishing Company 1973.
  10. Egidi, Nadaniela; Fatone, Lorella; Misici, Luciano (2020), Sergeyev, Yaroslav D.; Kvasov, Dmitri E., eds., "A New Remez-Type Algorithm for Best Polynomial Approximation" (in en), Numerical Computations: Theory and Algorithms (Cham: Springer International Publishing) 11973: pp. 56–69, doi:10.1007/978-3-030-39081-5_7, ISBN 978-3-030-39080-8, http://link.springer.com/10.1007/978-3-030-39081-5_7, retrieved 2022-03-19 
  11. 11.0 11.1 Temes, G.C.; Barcilon, V.; Marshall, F.C. (1973). "The optimization of bandlimited systems". Proceedings of the IEEE. 61 (2): 196–234. doi:10.1109/PROC.1973.9004. ISSN 0018-9219.
  12. Dunham, Charles B. (1975). "Convergence of the Fraser-Hart algorithm for rational Chebyshev approximation" (in en). Mathematics of Computation 29 (132): 1078–1082. doi:10.1090/S0025-5718-1975-0388732-9. ISSN 0025-5718. https://www.ams.org/mcom/1975-29-132/S0025-5718-1975-0388732-9/. 

External links