The Nearest Polynomial of Lower Degree Extended Abstract Robert M. Corless
Nargol Rezvani
ORCCA & the Dept. of Applied Mathematics University of Western Ontario London, Canada
Dept. of Computer Science University of Toronto Toronto, Canada
[email protected]
Categories and Subject Descriptors: I.1.4 [Symbolic Manipulation] Applications General Terms: Algorithms Keywords: Nearest polynomial; Lagrange basis; CAGD
1.
INTRODUCTION
When working with empirical polynomials, it is important not to introduce unnecessary changes of basis, because that can destabilize fundamental algorithms such as evaluation and rootfinding: for more details, see e.g. [3, 4]. Moreover, in these references it has been shown to be optimal, in a certain sense, to work solely in the Lagrange basis for evaluation and rootfinding. However, working in the monomial basis sometimes has an efficiency advantage, if the monomial expression happens to be sparse. This extended abstract discusses a way to obtain some of this same advantage for the Lagrange basis by means of polynomial smoothing: that is, approximating the given data by values of a lower-degree polynomial, and then using only a smaller amount of (smoother) data to represent the polynomial. “Optimal degree reduction” is also important and wellstudied for Bernstein basis in the CAGD literature, see for example [1, 2]. In this abstract we first show that well-known work on the nearest (in a sense to be made explicit) polynomial with a given zero (see for example [6]) can be extended to give an explicit solution for the nearest weighted q-norm polynomial of lower degree, in any basis including the Lagrange basis or the Bernstein basis.
2.
on a set of distinct nodes τ = [τ0 , τ1 , . . . , τn ], where `(x) = (x − τ0 )(x Q− τ1 ) · · · (x − τn ) and the barycentric weights are wk = 1/ i6=k (τk −τi ), which is obviously not degree-graded (all φk (x) are of degree n in this case). P The basic problem is, given f (x) = n k=0 ck φk (x) by its vector of coefficients c = [c0 , c1 , . . . , cn ] (which in the case of the Lagrange basis are just the values of f (x) at the nodes x = τk ), find nearby coefficients ˆ c such that fˆ(x) is of lower degree than n. Specifically, we give an analytic solution to the problem min kc−ˆ ck subject to the constraint deg fˆ(x) < n, where k · k is any weighted q-norm for 1 ≤ q ≤ ∞: (not all weights αk may be zero) !1/q n X q kckq,α := |αk ck | (2) k=0
if q < ∞ and as usual kck = max |αk ck | if q = ∞. By interpreting the degree constraint as a linear constraint, the H¨ older mean solution to the ‘nearest polynomial with a given zero’ problem given in [6, 9] and refined in [7] can be adapted to give the solution below. Remark 1. If the basis is degree-graded, that is deg φk (x) = k, then all we need to do is force the leading coefficient to be zero, as is well-known. In [7, 8] there is a generalization of this to other bases, that is encoded in the algorithm in Section 3. To use this algorithm, we need a linear constraint expressing the desired degree reduction. Note that the leading coefficient of f (x) is, in general, [xn ](f (x)) =
THEORETICAL FRAMEWORK
In what follows we use Φ(x) = [φ0 (x), φ1 (x), . . . , φn (x)] to denote a basis for the set of polynomials of degree at most n. The most familiar basis is the monomial basis [1, x, x2 , . . . , xn ]. We will mostly use the Lagrange basis φk (x) = `(x)wk /(x − τk )
[email protected]
(1)
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. SNC’07, July 25–27, 2007, London, Ontario, Canada. Copyright 2007 ACM 978-1-59593-744-5/07/0007 ...$5.00.
n X
ck [xn ](φk (x)) .
(3)
k=0
(the notation [xk ](g(x)), taken from [5], means ‘the coefficient of xk in g(x)’). If deg f ≤ n this can also be expressed as limr→∞ fr(r) n ,showing the analogy of the degree constraint to imposing an extra zero at infinity. Putting u = [xn ]Φ(x) we may express the degree constraint as the linear constraint u · c = 0. We now compute the vector u for the Lagrange basis and for the Bernstein basis. Lemma 1. The vector of leading coefficients of the Lagrange polynomials is the vector of the barycentric weights, [w0 , w1 , . . . , wn ]T . Lemma 2. The vector of leadingcoefficients ofthe Bern]. stein basis is [(−1)n n0 , (−1)n−1 n1 , . . . , (−1)0 n n
2.1 Weights and duality The dual of the weighted q-norm (2) is (see [8]) !1/p n X p ∗ ∗ |αk ck | kckp,α :=
Table 1: Values of the nearest polynomials to f with f = [−1, 0, 1, −1] at x = [−1, −1/3, 1/3, 1] with degree less than 3, keeping the zero at t = −1/3. (4)
k=0
where 1/p + 1/q = 1 (taking limits for either q = 1 or p = 1) and the dual weights are α∗k = α−1 k . If any αk = 0, then unless the kth component of c is zero, we have kckp,α∗ = ∞. Then any witness vector for H¨ older’s inequality, |b · c| ≤ kbkq,α kckp,α∗ namely any vector such that 1/p there exist constants λ and C with λ|αk bk |1/q = |α−1 k ck | and argbk ck = C, gives us our desired minimal perturbation, as laid out in detail in [8]. Remark 2. The simplicity of the relation α∗k = α−1 k , as well as the continuity with respect to p of the formula implemented in Section 3 below, are a consequence of the decision to include the weights αk inside the absolute value signs (and the pth powers) in the formula for the norm.
3.
ALGORITHM
Input: Polynomial f = c · Φ(x) ∈ P , where c is the vector of the coefficients and Φ is the basis in question, a degree bound n, and weights αk (not all zero) for the weighted qnorm. Alternatively, the dual weights α−1 k , not all zero, may be given instead. Output: A perturbed polynomial f˜ such that kf − f˜kq,α is minimal and deg f˜ < n. Steps: I) Compute p = q/(q − 1), taking limits as necessary. II) Choose the vectors of leading coefficients mentioned in the previous section; that is, in the Lagrange case take uk = wk /kwk p,α∗ , and in the Bernstein case take uk = (−1)n−k nk (again normalized so kukp,α∗ = 1).
III) Define a vector v with coefficients vk given by
- if 1 ≤ p < ∞ then (¯ z means conjugate of z) p−2 u ¯k if αk uk = 6 0 −signum(u · c)α−p k |uk | vk = 0 if αk uk = 0 - if p = ∞ then, where k0 is any index where kukq,α is attained (there must be at least one), 0 if k 6= k0 vk = ¯k0 if k = k0 −signum(u · c)α−1 k0 u IV) Compute the perturbation vector: ∆c = |u · c| · v . V) Return f˜ = (c + ∆c) · Φ(x).
4.
EXAMPLE
Let f be the polynomial taking on the values [−1, 0, 1, −1] at the four equally spaced nodes x = [−1, −1/3, 1/3, 1]. We apply our method to get the nearest polynomial of lower degree keeping the value of p(−1/3) = 0. To do this we put the dual weight α∗1 = 0. The results are printed in Table 1.
q 1 2 ∞
f˜ [−1, 0, 0, −1] [−14, 0, 2, −8]/11 [−8, 0, 2, −2]/5
k∆f k1 1.000 1.363 1.800
k∆f k2 1.000 0.905 1.039
k∆f k∞ 1.000 0.818 0.600
5. CONCLUDING REMARKS Since the algorithm passes through vectors only once, the cost to smooth the data by 1 degree is O(n) floating-point operations. After every degree reduction we may throw one piece of data away (in the Lagrange case) or apply one degree-lowering operation in the Bernstein basis case (at a cost of O(n) further floating-point operations). We remark that the technology to do degree reduction in the BernsteinB´ezier case is quite advanced; see for example [1, 2]. The use of weights allows, by specifying a dual weight α−1 k = 0, the imposition of a constraint that the kth coefficient is intrinsic and cannot be varied. This technique will be of interest in preserving sparsity. Acknowledgement. Part of this work was conducted during the Special Semester on Groebner Bases organized by RICAM of the Austrian Academy of Sciences and RISC, Johannes Kepler University, Linz, Austria, under the direction of Prof. Bruno Buchberger.
6. REFERENCES [1] Y. J. Ahn, B.-G. Lee, Y. Park, and J. Yoo. Constrained polynomial degree reduction in the L2 -norm equals best weighted euclidean approximation of B´ezier coefficients. CAGD, 21(2):181–191, 2004. [2] G. Brunnett, T. Schreiber, and J. Braun. The geometry of optimal degree reduction of B´ezier curves. CAGD, 13(8):773–788, 1996. [3] R. M. Corless, N. Rezvani, and A. Amiraslani. Pseudospectra of matrix polynomials that are expressed in alternative bases. Math. & Comp. Sci,, to appear, 2007. [4] R. M. Corless and S. M. Watt. Bernstein bases are optimal, but, sometimes, Lagrange bases are better. In Proc. SYNASC, pp. 141–153, 2004. [5] R. L. Graham, D. E. Knuth, and O. Patashnik. Concrete Mathematics. Addison-Wesley, 1994. [6] M. A. Hitz and E. Kaltofen. Efficient algorithms for computing the nearest polynomial with constrained roots. In Proc. ISSAC, pp. 236–243, 1998. [7] N. Rezvani and R. M. Corless. The nearest polynomial with a given zero, revisited. Sigsam Bulletin, Communications on Computer Algebra, 134(3):71–76, September 2005. [8] N. Rezvani Dehaghani. Approximate polynomials in different bases. Master’s thesis, University of Western Ontario, December 2005. [9] H. J. Stetter. The nearest polynomial with a given zero, and similar problems. Sigsam Bulletin: Communications on Computer Algebra, 33(4):2–4, 1999.