30
制約つき最適化に基づく 1変数多項式の近似GCDの反復算法 照井 章(筑波大学 数理物質科学研究科) 第18回日本数式処理学会大会 2009年6月12日

制約つき最適化に基づく1変数多項式の近似GCDの反復算法

Embed Size (px)

DESCRIPTION

An Iterative Method for Calculating Approximate GCDof Univariate polynomials (in Japanese). Presented at the annual meeting of Japan Society for Symbolic and Algebraic Computation. Ryukoku University, Shiga, Japan, June 12, 2009. http://www.jssac.org/Conference/Tai/jssac2009.html

Citation preview

Page 1: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

制約つき最適化に基づく1変数多項式の近似GCDの反復算法

照井 章(筑波大学 数理物質科学研究科)第18回日本数式処理学会大会

2009年6月12日

Page 2: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

近似GCDの計算近似代数計算の代表的な算法の一つ

F (x) = x2 + 0.9x! 6.55

G(x) = x2 ! 5.7x + 11.25

F (x) = F (x)! 2.1x! 1.5 = (x! 3.5)(x + 2.3)

G(x) = G(x)! 2.3x + 4.5 = (x! 3.5)(x! 4.5)

摂動項 共通因子

互いに素

Page 3: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

問題:与えられたF(x), G(x), dに対し、FとGのd次の近似GCD: Hを求める

F (x) = F (x) + !F (x) = H(x) · F (x)

G(x) = G(x) + !G(x) = H(x) · G(x)

F (x), G(x) : 互いに素

: m次, F (x) : n次G(x) (m ! n)

H(x) : d次 (d < n)

Page 4: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

「よりよい」近似GCDを「よりよく」求める算法の追求が

行われている

F (x) = F (x) + !F (x) = H(x) · F (x)

G(x) = G(x) + !G(x) = H(x) · G(x)

摂動をなるべく小さく! なるべく効率よく!

算法多項式剰余列 (PRS) Sylvester行列の

特異値分解 (SVD)

Sylvester行列のQR分解 最適化法 等々…

Page 5: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

最適化法

修正Newton法

講演の内容制約つき最適化問題に帰着させた

反復算法の提案

最適化法を用いた従来の方法と比較して 係数の摂動を従来程度に抑えつつ

スピードアップに成功した(最大約30倍)

Page 6: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

問題解決のステップ

1近似GCDの問題を制約付最適化問題に帰着させる

2制約付最適化問題を解く

Page 7: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

目的関数の導出与えられた多項式(既知)

F (x) = fmxm + · · · + f0x0

G(x) = gnxn + · · · + g0x0

求める多項式(未知)

F (x) = fmxm + · · · + f0x0

G(x) = gnxn + · · · + g0x0

Page 8: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

f(fm, . . . , f0, gn, . . . , g0) = !F " F!22 + !G"G!2

2

=(fm " fm)2 + (fm!1 " fm!1)2 + · · · + (f0 " f0)2

+ (gn " gn)2 + (gn!1 " gn!1)2 + · · · + (g0 " g0)2

x = (fm, . . . , f0, gn, . . . , g0)

f(x)

目的関数の導出目的関数はこうなる

Page 9: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

F (x) (m次), G(x) (n次) がd次のGCDをもつ

A(x) (n - d 次), B(x) (m - d 次) が存在して

AF + BG = 0

制約条件の導出

Page 10: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

制約条件の導出

A(x) = an!dxn!d + · · · + a0x

0

B(x) = bm!dxm!d + · · · + b0x

0

を行列・ベクトル積で表すAF + BG = 0

.

!

""""""#

fm gn...

. . ....

. . .f0 fm g0 gn

. . ....

. . ....

f0 g0

$

%%%%%%&

!

""""""""#

an!d...

a0

bm!d...b0

$

%%%%%%%%&

=

!

"#0...0

$

%& .

Page 11: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

x = (fm, . . . , f0, gn, . . . , g0,

an!d, . . . , a0, bm!d, . . . , b0)

g0 = a2n!d + · · · + a2

0 + b2m!d + · · · + b2

0 ! 1 = 0,g1 = fman!d + gnbm!d = 0,

...gm+n!d+1 = f0a0 + g0b0 = 0,

g(x) = 0

制約条件の導出各行毎の連立方程式にまとめる

Page 12: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

制約付最適化問題はこうなる!

     ( = GCDの次数がd)の下で、

   ( = 与えられた多項式からの摂動) が最小となるような  ( = 多項式の係数)

を求めよ!

g(x) = 0

f(x)

x

Page 13: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

問題解決のステップ

1近似GCDの問題を制約付最適化問題に帰着させる

2制約付最適化問題を解く

Page 14: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

「1次の必要条件」を満たす点を求める(最適解の候補)問題:g(x) = 0 の下で、f(x) を最小化

!f(x0)" t(Jg(x0))! = 0, g(x0) = 0.

定理:点 x0 が、上の問題の局所解であり、   がfull rank、かつ f(x), g(x) が x = x0 の近傍において微分可能ならば、定数ベクトル λ が存在してJg(x0)

Page 15: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

「勾配射影法」に基づく解法

x

xk

g(x) = 0

    上で に最も近い点を求める

xg(x) = 0

与えられた多項式の係数に対応する点

Page 16: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

ステップ (1) : 射影

    を における接平面に射影し、 とおく

x! xk

yk

xk

xk  における接平面上で線形最小二乗問題を解く

x

xk

yk g(x) = 0

Page 17: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

x

xk

yk

xk+1

g(x) = 0

  を     に引き戻し、   とするyk

xk+1

g(x) = 0

ステップ (2) : 引き戻し

Page 18: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

    が  における法線に十分近づいたら計算終了

このときの を用いて近似GCDを求める

xk

x! xk xk

x

xk

g(x) = 0

Page 19: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

修正Newton法(田邉)

•Newton法で用いるLagrange関数のHesse行列を修正

•修正のしかたでさまざまな解法を導出•今回は、勾配射影法を一般化した解法を用いる

Page 20: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

近似GCD算法:GPGCD1.勾配射影法、修正Newton法のいずれかを利用⇒修正Newton法が効率面で有効

2.ヤコビ行列がfull rankであること

3.初期値の設定

4.GCDの実際の計算

5.実際の算法

Page 21: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

GPGCDの実装とテスト

•比較対象:最小二乗法 (STLN) に基づく算法 [Kaltofen et al., 2006]

•問題:10次から100次まで、10次毎の2つの多項式の近似GCDを計算(各100例)

•実装: 数式処理システム Maple 12比較対象の実装はKaltofenらによる

Page 22: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

テスト環境

Intel Core2 Duo Mobile T7400 (2.16 GHz)(Apple MacBook Mid-2007 black)RAM 2GB, MacOS X 10.5

Page 23: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

テスト結果: (1) 係数の摂動

0

1.00

2.00

3.00

4.00

5.00

6.00

10 20 30 40 50 60 70 80 90 100

摂動

次数

STLN (Kaltofen et al.) GPGCD (Terui)!10!3

Page 24: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

テスト結果: (2) 反復回数

0

1.00

2.00

3.00

4.00

5.00

6.00

10 20 30 40 50 60 70 80 90 100

反復回数

次数

STLN (Kaltofen et al.) GPGCD (Terui)

Page 25: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

テスト結果: (3) 計算時間

0

5.0

10.0

15.0

20.0

25.0

30.0

10 20 30 40 50 60 70 80 90 100

計算時間 (s)

次数

STLN (Kaltofen et al.) GPGCD (Terui)

Page 26: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

テスト結果: (3) 計算時間

0

0.5

1.0

1.5

10 20 30 40 50 60 70 80 90 100

計算時間 (s)

次数

GPGCD (Terui)

Page 27: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

1変数多項式に対するSTLN算法との比較

算法多項式/GCDの

次数

動作環境(平均)反復回数(平均)

計算時間(秒)

STLN(Kaltofen et al.)

GPGCD(Terui)

(100次, 100次) / 50次(100次, 100次) / 50次ThinkPad 1.8 GHz,

RAM 1GB

Core2 Duo Mobile T7400 2.16 GHz,RAM 2GB

2 4.56

10 1.28

Page 28: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

テスト結果のまとめ

•近似GCDの計算に要した係数の摂動(平均値)は、比較対象と同程度

• 計算に要した反復回数の平均は、多項式の次数によらずほぼ一定

• 計算の速さ(平均)は、比較対象よりも圧倒的に速かった(最大約30倍)

• 一部、計算がうまくいかない例も存在する

Page 29: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

今後の展望•他の近似GCD算法との比較(性能、効率等)

• 近似GCDがうまく計算されない例題の分析

• 複素係数多項式への拡張• 3つ以上の多項式の近似GCD計算への拡張• その他.....

Page 30: 制約つき最適化に基づく1変数多項式の近似GCDの反復算法

Preprint is available

An Iterative Method for Calculating Approximate GCDof Univariate Polynomials

Akira TeruiGraduate School of Pure and Applied Sciences

University of TsukubaTsukuba, 305-8571 Japan

[email protected]

ABSTRACTWe present an iterative algorithm for calculating approxi-mate greatest common divisor (GCD) of univariate polyno-mials with the real coe!cients. For a given pair of poly-nomials and a degree, our algorithm finds a pair of poly-nomials which has a GCD of the given degree and whosecoe!cients are perturbed from those in the original inputs,making the perturbations as small as possible, along withthe GCD. The problem of approximate GCD is transferedto a constrained minimization problem, then solved withthe gradient-projection method or its variant by searchingthe solution iteratively. We demonstrate that our algorithmcalculates approximate GCD with perturbations as small asthose calculated by a method based on the structured totalleast norm (STLN) method, whereas our method runs signif-icantly faster than theirs by approximately up to 30 times,compared with their implementation. We also show that ouralgorithm properly handles some ill-conditioned problemswith GCD containing small or large leading coe!cient.

Categories and Subject DescriptorsI.1.2 [Computing Methodologies]: Symbolic and Alge-braic Manipulation—Algorithms; G.1.2 [Mathematics ofComputing]: Numerical Analysis—Approximation

General TermsAlgorithms, experimentation

KeywordsApproximate polynomial GCD, the gradient-projection method,ill-conditioned problem, optimization

1. INTRODUCTIONFor algebraic computations on polynomials and matrices,

symbolic-numeric algorithm are attracting broad range ofattentions recently. These algorithms take inputs with some

Permission to make digital or hard copies of all or part of this work forpersonal or classroom use is granted without fee provided that copies arenot made or distributed for profit or commercial advantage and that copiesbear this notice and the full citation on the first page. To copy otherwise, torepublish, to post on servers or to redistribute to lists, requires prior specificpermission and/or a fee.Copyright 200X ACM X-XXXXX-XX-X/XX/XX ...$5.00.

“noise” such as polynomials with floating-point number co-e!cients with rounding errors, or more practical errors suchas measurement errors, then, with minimal changes on theinputs, seek a meaningful answer that reflect desired prop-erty of the input, such as a common factor of a given degree.By this characteristic, approximate algebraic algorithms areexpected to be applicable to more wide range of problems,especially those to which exact algebraic algorithms werenot applicable .

As an approximate algebraic algorithm, we consider cal-culating the approximate greatest common divisor (GCD) ofunivariate polynomials with the real coe!cients, such that,for a given pair of polynomials and a degree d, finding a pairof polynomials which has a GCD of degree d and whose coef-ficients are perturbations from those in the original inputs,with making the perturbations as small as possible, alongwith the GCD. This problem has been extensively studiedwith various approaches including the Euclidean method onthe polynomial remainder sequence (PRS) ([1], [16], [17]),the singular value decomposition (SVD) of the Sylvester ma-trix ([3], [6]), the QR factorization of the Sylvester matrix orits displacements ([4], [19], [21]), Pade approximation [13],optimization strategies ([2], [8], [9], [10], [20]). Furthermore,stable methods for ill-conditioned problems have been dis-cussed ([4], [12], [15]).

Among methods in the above, we focus our attentionon optimization strategy in this paper, especially iterativemethod for approaching an optimal solution, after trans-ferring the approximate GCD problem into a constrainedminimization problem. Already proposed algorithms uti-lize iterative methods including the Levenberg-Marquardtmethod [2], the Gauss-Newton method [20] and the struc-tured total least norm (STLN) method ([8], [9]). Amongthem, STLN-based methods have shown good performancecalculating approximate GCD with su!ciently small pertur-bations e!ciently.

Here, we utilize the gradient-projection method [14] andits variant [18] for solving the constrained minimization prob-lem. The latter method has interesting features such that,whereas it can also be derived as a variant of the Newton’smethod [7], it combines the “projection” and the “restora-tion”steps in the original method, which reduces the numberof solving a linear system, as shown in the below. We demon-strate that our algorithm calculates approximate GCD withperturbations as small as those calculated by the STLN-based methods, whereas our method show significantly bet-ter performance over them in its speed compared with theirimplementation, by approximately up to 30 times. Further-