Sum-of-squares optimization

From HandWiki
Revision as of 22:42, 6 February 2024 by Gametune (talk | contribs) (link)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A sum-of-squares optimization program is an optimization problem with a linear cost function and a particular type of constraint on the decision variables. These constraints are of the form that when the decision variables are used as coefficients in certain polynomials, those polynomials should have the polynomial SOS property. When fixing the maximum degree of the polynomials involved, sum-of-squares optimization is also known as the Lasserre hierarchy of relaxations in semidefinite programming.

Sum-of-squares optimization techniques have been applied across a variety of areas, including control theory (in particular, for searching for polynomial Lyapunov functions for dynamical systems described by polynomial vector fields), statistics, finance and machine learning.[1][2][3][4]

Optimization problem

Given a vector [math]\displaystyle{ c\in \R^n }[/math] and polynomials [math]\displaystyle{ a_{k,j} }[/math] for [math]\displaystyle{ k=1, \dots N_s }[/math], [math]\displaystyle{ j = 0, 1, \dots, n }[/math], a sum-of-squares optimization problem is written as

[math]\displaystyle{ \begin{aligned} \underset{u\in\R^n}{\text{maximize}} \quad & c^T u \\ \text{subject to} \quad & a_{k,0}(x) + a_{k,1}(x)u_1 + \cdots + a_{k,n}(x)u_n \in \text{SOS} \quad (k=1,\ldots, N_s). \end{aligned} }[/math]

Here "SOS" represents the class of sum-of-squares (SOS) polynomials. The quantities [math]\displaystyle{ u\in \R^n }[/math] are the decision variables. SOS programs can be converted to semidefinite programs (SDPs) using the duality of the SOS polynomial program and a relaxation for constrained polynomial optimization using positive-semidefinite matrices, see the following section.

Dual problem: constrained polynomial optimization

Suppose we have an [math]\displaystyle{ n }[/math]-variate polynomial [math]\displaystyle{ p(x): \mathbb{R}^n \to \mathbb{R} }[/math] , and suppose that we would like to minimize this polynomial over a subset [math]\displaystyle{ A \subseteq \mathbb{R}^n }[/math]. Suppose furthermore that the constraints on the subset [math]\displaystyle{ A }[/math] can be encoded using [math]\displaystyle{ m }[/math] polynomial equalities of degree at most [math]\displaystyle{ 2d }[/math], each of the form [math]\displaystyle{ a_i(x) = 0 }[/math] where [math]\displaystyle{ a_i: \mathbb{R}^n \to \mathbb{R} }[/math] is a polynomial of degree at most [math]\displaystyle{ 2d }[/math]. A natural, though generally non-convex program for this optimization problem is the following: [math]\displaystyle{ \min_{x \in \mathbb{R}^{n}} \langle C, x^{\le d} (x^{\le d})^\top \rangle }[/math] subject to:

[math]\displaystyle{ \langle A_i, x^{\le d}(x^{\le d})^\top \rangle = 0 \qquad \forall \ i \in [m], }[/math]

 

 

 

 

(1)

[math]\displaystyle{ x_{\emptyset} = 1, }[/math] where [math]\displaystyle{ x^{\le d} }[/math] is the [math]\displaystyle{ n^{O(d)} }[/math]-dimensional vector with one entry for every monomial in [math]\displaystyle{ x }[/math] of degree at most [math]\displaystyle{ d }[/math], so that for each multiset [math]\displaystyle{ S \subset [n], |S| \le d, }[/math] [math]\displaystyle{ x_S = \prod_{i \in S}x_i }[/math], [math]\displaystyle{ C }[/math] is a matrix of coefficients of the polynomial [math]\displaystyle{ p(x) }[/math] that we want to minimize, and [math]\displaystyle{ A_i }[/math] is a matrix of coefficients of the polynomial [math]\displaystyle{ a_i(x) }[/math] encoding the [math]\displaystyle{ i }[/math]-th constraint on the subset [math]\displaystyle{ A \subset \R^n }[/math]. The additional, fixed constant index in our search space, [math]\displaystyle{ x_{\emptyset} = 1 }[/math], is added for the convenience of writing the polynomials [math]\displaystyle{ p(x) }[/math] and [math]\displaystyle{ a_i(x) }[/math] in a matrix representation.

This program is generally non-convex, because the constraints (1) are not convex. One possible convex relaxation for this minimization problem uses semidefinite programming to replace the rank-one matrix of variables [math]\displaystyle{ x^{\le d} (x^{\le d})^\top }[/math] with a positive-semidefinite matrix [math]\displaystyle{ X }[/math]: we index each monomial of size at most [math]\displaystyle{ 2d }[/math] by a multiset [math]\displaystyle{ S }[/math] of at most [math]\displaystyle{ 2d }[/math] indices, [math]\displaystyle{ S \subset [n], |S| \le 2d }[/math]. For each such monomial, we create a variable [math]\displaystyle{ X_S }[/math] in the program, and we arrange the variables [math]\displaystyle{ X_S }[/math] to form the matrix [math]\displaystyle{ X \in \mathbb{R}^{[n]^{\le d} \times [n]^{\le d}} }[/math], where [math]\displaystyle{ \R^{[n]^{\le d}\times [n]^{\le d}} }[/math]is the set of real matrices whose rows and columns are identified with multisets of elements from [math]\displaystyle{ n }[/math] of size at most [math]\displaystyle{ d }[/math]. We then write the following semidefinite program in the variables [math]\displaystyle{ X_S }[/math]: [math]\displaystyle{ \min_{X \in \R^{[n]^{\le d} \times [n]^{\le d} }}\langle C, X \rangle }[/math] subject to: [math]\displaystyle{ \langle A_i, X \rangle =0 \qquad \forall \ i \in [m], Q }[/math] [math]\displaystyle{ X_{\emptyset} = 1 , }[/math] [math]\displaystyle{ X_{U \cup V} = X_{S \cup T} \qquad \forall \ U,V,S,T \subseteq [n], |U|,|V|,|S|,|T| \le d,\text{ and} \ U \cup V = S \cup T , }[/math] [math]\displaystyle{ X \succeq 0, }[/math]

where again [math]\displaystyle{ C }[/math] is the matrix of coefficients of the polynomial [math]\displaystyle{ p(x) }[/math] that we want to minimize, and [math]\displaystyle{ A_i }[/math] is the matrix of coefficients of the polynomial [math]\displaystyle{ a_i(x) }[/math] encoding the [math]\displaystyle{ i }[/math]-th constraint on the subset [math]\displaystyle{ A \subset \R^n }[/math].

The third constraint ensures that the value of a monomial that appears several times within the matrix is equal throughout the matrix, and is added to make [math]\displaystyle{ X }[/math] respect the symmetries present in the quadratic form [math]\displaystyle{ x^{\le d}(x^{\le d})^\top }[/math].

Duality

One can take the dual of the above semidefinite program and obtain the following program: [math]\displaystyle{ \max_{y \in \mathbb{R}^{m'}} y_0 , }[/math] subject to: [math]\displaystyle{ C - y_0 e_{\emptyset}- \sum_{i \in [m]} y_i A_i - \sum_{S\cup T = U\cup V} y_{S,T,U,V} (e_{S,T} - e_{U,V})\succeq 0. }[/math]

We have a variable [math]\displaystyle{ y_0 }[/math] corresponding to the constraint [math]\displaystyle{ \langle e_{\emptyset}, X\rangle = 1 }[/math] (where [math]\displaystyle{ e_{\emptyset} }[/math] is the matrix with all entries zero save for the entry indexed by [math]\displaystyle{ (\varnothing,\varnothing) }[/math]), a real variable [math]\displaystyle{ y_i }[/math]for each polynomial constraint [math]\displaystyle{ \langle X,A_i \rangle = 0 \quad s.t. i \in [m], }[/math] and for each group of multisets [math]\displaystyle{ S,T,U,V \subset [n], |S|,|T|,|U|,|V| \le d, S\cup T = U \cup V }[/math], we have a dual variable [math]\displaystyle{ y_{S,T,U,V} }[/math]for the symmetry constraint [math]\displaystyle{ \langle X, e_{S,T} - e_{U,V} \rangle = 0 }[/math]. The positive-semidefiniteness constraint ensures that [math]\displaystyle{ p(x) - y_0 }[/math] is a sum-of-squares of polynomials over [math]\displaystyle{ A \subset \R^n }[/math]: by a characterization of positive-semidefinite matrices, for any positive-semidefinite matrix [math]\displaystyle{ Q\in \mathbb{R}^{m \times m} }[/math], we can write [math]\displaystyle{ Q = \sum_{i \in [m]} f_i f_i^\top }[/math] for vectors [math]\displaystyle{ f_i \in \mathbb{R}^m }[/math]. Thus for any [math]\displaystyle{ x \in A \subset \mathbb{R}^n }[/math], [math]\displaystyle{ \begin{align} p(x) - y_0 &= p(x) - y_0 - \sum_{i \in [m']} y_i a_i(x) \qquad \text{since } x \in A\\ &=(x^{\le d})^\top \left( C - y_0 e_{\emptyset} - \sum_{i\in [m']} y_i A_i - \sum_{S\cup T = U \cup V} y_{S,T,U,V}(e_{S,T}-e_{U,V}) \right)x^{\le d}\qquad \text{by symmetry}\\ &= (x^{\le d})^\top \left( \sum_{i} f_i f_i^\top \right)x^{\le d} \\ &= \sum_{i} \langle x^{\le d}, f_i\rangle^2 \\ &= \sum_{i} f_i(x)^2, \end{align} }[/math]

where we have identified the vectors [math]\displaystyle{ f_i }[/math] with the coefficients of a polynomial of degree at most [math]\displaystyle{ d }[/math]. This gives a sum-of-squares proof that the value [math]\displaystyle{ p(x) \ge y_0 }[/math] over [math]\displaystyle{ A \subset \mathbb{R}^n }[/math].

The above can also be extended to regions [math]\displaystyle{ A \subset \mathbb{R}^n }[/math] defined by polynomial inequalities.

Sum-of-squares hierarchy

The sum-of-squares hierarchy (SOS hierarchy), also known as the Lasserre hierarchy, is a hierarchy of convex relaxations of increasing power and increasing computational cost. For each natural number [math]\displaystyle{ d \in \mathbb{N} }[/math] the corresponding convex relaxation is known as the [math]\displaystyle{ d }[/math]th level or [math]\displaystyle{ d }[/math]-th round of the SOS hierarchy. The [math]\displaystyle{ 1 }[/math]st round, when [math]\displaystyle{ d=1 }[/math], corresponds to a basic semidefinite program, or to sum-of-squares optimization over polynomials of degree at most [math]\displaystyle{ 2 }[/math]. To augment the basic convex program at the [math]\displaystyle{ 1 }[/math]st level of the hierarchy to [math]\displaystyle{ d }[/math]-th level, additional variables and constraints are added to the program to have the program consider polynomials of degree at most [math]\displaystyle{ 2d }[/math].

The SOS hierarchy derives its name from the fact that the value of the objective function at the [math]\displaystyle{ d }[/math]-th level is bounded with a sum-of-squares proof using polynomials of degree at most [math]\displaystyle{ 2d }[/math] via the dual (see "Duality" above). Consequently, any sum-of-squares proof that uses polynomials of degree at most [math]\displaystyle{ 2d }[/math] can be used to bound the objective value, allowing one to prove guarantees on the tightness of the relaxation.

In conjunction with a theorem of Berg, this further implies that given sufficiently many rounds, the relaxation becomes arbitrarily tight on any fixed interval. Berg's result[5][6] states that every non-negative real polynomial within a bounded interval can be approximated within accuracy [math]\displaystyle{ \varepsilon }[/math] on that interval with a sum-of-squares of real polynomials of sufficiently high degree, and thus if [math]\displaystyle{ OBJ(x) }[/math] is the polynomial objective value as a function of the point [math]\displaystyle{ x }[/math], if the inequality [math]\displaystyle{ c + \varepsilon - OBJ(x) \ge 0 }[/math] holds for all [math]\displaystyle{ x }[/math] in the region of interest, then there must be a sum-of-squares proof of this fact. Choosing [math]\displaystyle{ c }[/math] to be the minimum of the objective function over the feasible region, we have the result.

Computational cost

When optimizing over a function in [math]\displaystyle{ n }[/math] variables, the [math]\displaystyle{ d }[/math]-th level of the hierarchy can be written as a semidefinite program over [math]\displaystyle{ n^{O(d)} }[/math] variables, and can be solved in time [math]\displaystyle{ n^{O(d)} }[/math] using the ellipsoid method.

Sum-of-squares background

Main page: Polynomial SOS

A polynomial [math]\displaystyle{ p }[/math] is a sum of squares (SOS) if there exist polynomials [math]\displaystyle{ \{f_i\}_{i=1}^m }[/math] such that [math]\displaystyle{ p = \sum_{i=1}^m f_i^2 }[/math]. For example, [math]\displaystyle{ p=x^2 - 4xy + 7y^2 }[/math] is a sum of squares since [math]\displaystyle{ p = f_1^2 + f_2^2 }[/math] where [math]\displaystyle{ f_1 = (x-2y)\text{ and }f_2 = \sqrt{3}y. }[/math] Note that if [math]\displaystyle{ p }[/math] is a sum of squares then [math]\displaystyle{ p(x) \ge 0 }[/math] for all [math]\displaystyle{ x \in \R^n }[/math]. Detailed descriptions of polynomial SOS are available.[7][8][9]

Quadratic forms can be expressed as [math]\displaystyle{ p(x)=x^T Q x }[/math] where [math]\displaystyle{ Q }[/math] is a symmetric matrix. Similarly, polynomials of degree ≤ 2d can be expressed as [math]\displaystyle{ p(x)=z(x)^\mathsf{T} Q z(x) , }[/math] where the vector [math]\displaystyle{ z }[/math] contains all monomials of degree [math]\displaystyle{ \le d }[/math]. This is known as the Gram matrix form. An important fact is that [math]\displaystyle{ p }[/math] is SOS if and only if there exists a symmetric and positive-semidefinite matrix [math]\displaystyle{ Q }[/math] such that [math]\displaystyle{ p(x) = z(x)^\mathsf{T} Q z(x) }[/math]. This provides a connection between SOS polynomials and positive-semidefinite matrices.

Software tools

  • SOSTOOLS, licensed under the GNU GPL. The reference guide is available at arXiv:1310.4716 [math.OC], and a presentation about its internals is available here.
  • CDCS-sos, a package from CDCS, an augmented Lagrangian method solver, to deal with large scale SOS programs.
  • The SumOfSquares extension of JuMP for Julia.
  • TSSOS for Julia, a polynomial optimization tool based on the sparsity adapted moment-SOS hierarchies.
  • For the dual problem of constrained polynomial optimization, GloptiPoly for MATLAB/Octave, Ncpol2sdpa for Python and MomentOpt for Julia.

References

  1. Sum of squares : theory and applications : AMS short course, sum of squares : theory and applications, January 14-15, 2019, Baltimore, Maryland. Parrilo, Pablo A.; Thomas, Rekha R.. Providence, Rhode Island: American Mathematical Society. 2020. ISBN 978-1-4704-5025-0. OCLC 1157604983. https://www.worldcat.org/oclc/1157604983. 
  2. Tan, W., Packard, A., 2004. "Searching for control Lyapunov functions using sums of squares programming". In: Allerton Conf. on Comm., Control and Computing. pp. 210–219.
  3. Tan, W., Topcu, U., Seiler, P., Balas, G., Packard, A., 2008. Simulation-aided reachability and local gain analysis for nonlinear dynamical systems. In: Proc. of the IEEE Conference on Decision and Control. pp. 4097–4102.
  4. A. Chakraborty, P. Seiler, and G. Balas, "Susceptibility of F/A-18 Flight Controllers to the Falling-Leaf Mode: Nonlinear Analysis," AIAA Journal of Guidance, Control, and Dynamics, vol. 34 no. 1 (2011), pp. 73–85.
  5. Berg, Christian (1987). Landau, Henry J.. ed. "The multidimensional moment problem and semigroups". Proceedings of Symposia in Applied Mathematics 37: 110–124. doi:10.1090/psapm/037/921086. ISBN 9780821801147. https://books.google.com/books?id=IEo2Iu_uogUC&dq=%22The+multidimensional+moment+problem+and+semigroups%22&pg=PA110. 
  6. Lasserre, J. (2007-01-01). "A Sum of Squares Approximation of Nonnegative Polynomials". SIAM Review 49 (4): 651–669. doi:10.1137/070693709. ISSN 0036-1445. http://epubs.siam.org/doi/abs/10.1137/070693709. 
  7. Parrilo, P., (2000) Structured semidefinite programs and semialgebraic geometry methods in robustness and optimization. Ph.D. thesis, California Institute of Technology.
  8. Parrilo, P. (2003) "Semidefinite programming relaxations for semialgebraic problems". Mathematical Programming Ser. B 96 (2), 293–320.
  9. Lasserre, J. (2001) "Global optimization with polynomials and the problem of moments". SIAM Journal on Optimization, 11 (3), 796{817.