ConvexSpring25_Week_1_2
ConvexSpring25_Week_1_2
Processing
Instructor: Prof. Ashish R. Hota
1
Content
Theory:
Formal definition of an optimization problem
Basic topology of sets and existence of optimal solutions
Gradient, Hessian, and optimality conditions for unconstrained problems
Convex sets and properties
Convex functions and properties
Convex optimization problems and their classifications
Separating Hyperplane Theorems, Theorems of the Alternative, LP Duality
Lagrangian duality and KKT optimality conditions
Algorithms:
First order gradient based algorithms under smoothness, strong convexity
Accelerated, stochastic and distributed gradient descent
Applications:
Regression, support vector machines, ML estimation, hypothesis testing
Stability analysis and controller synthesis for linear dynamical systems
Robust optimization
2
References
Primary References:
Optimization Models by G.C. Calafiore and L. El Ghaoui, Cambridge Univer-
sity Press, 2014. Link: https://people.eecs.berkeley.edu/~elghaoui/
optmodbook.html
Convex Optimization by Stephen Boyd and L. Vandenberghe, Cambridge
University Press. Available online at: https://web.stanford.edu/~boyd/
cvxbook/
Algorithms for Convex Optimization by Nisheeth K. Vishnoi, Cambridge
University Press. Available online at: https://convex-optimization.
github.io
Advanced References on Theory:
Lectures on Modern Convex Optimization, Aharon Ben-Tal and Arkadi Ne-
mirovski, SIAM. Available online at: https://epubs.siam.org/doi/book/
10.1137/1.9780898718829
Convex Analysis and Optimization, Bertsekas, Athena Scientific. More in-
formation at: http://www.athenasc.com/convexity.html
Convex Analysis and Minimization Algorithms, Jean-Baptiste Hiriart-Urruty,
Claude Lemarechal, Springer. Available online at: https://link.springer.
com/book/10.1007/978-3-662-02796-7
Advanced References on Algorithms:
Optimization for Modern Data Analysis, Benjamin Recht and Stephen
J. Wright, Available online at: https://people.eecs.berkeley.edu/
~brecht/opt4ml_book/
Numerical Optimization by Jorge Nocedal, Stephen J. Wright, Springer.
Available online at: https://link.springer.com/book/10.1007/
978-0-387-40065-5
3
Introductory Lectures on Convex Optimization A Basic Course, by Yurii
Nesterov. Available online at: https://link.springer.com/book/10.
1007/978-1-4419-8853-9
First-order Methods in Optimization, by Amir Beck, SIAM. For more infor-
mation: https://epubs.siam.org/doi/10.1137/1.9781611974997.
Advanced References on Applications in Control:
Linear Matrix Inequalities in System and Control Theory, by Stephen Boyd,
Laurent El Ghaoui, E. Feron, and V. Balakrishnan, Society for Industrial and
Applied Mathematics (SIAM), 1994. Available online at: https://web.
stanford.edu/~boyd/lmibook/
A Course in Robust Control Theory: A Convex Approach, Springer.
Available online at: https://link.springer.com/book/10.1007/
978-1-4757-3290-0
Predictive Control for Linear and Hybrid Systems, Cambridge Univer-
sity Press. More information at: http://www.mpc.berkeley.edu/
mpc-course-material
4
Computing Resources
MATLAB Toolbox
YALMIP: https://yalmip.github.io/
CVX: http://cvxr.com/cvx/
Python Toolbox
CVXOPT: https://cvxopt.org/index.html
CVXPY: https://www.cvxpy.org/
PYOMO: http://www.pyomo.org/
Solvers
MOSEK: https://www.mosek.com/
Gurobi: https://www.gurobi.com/
IPOPT: https://github.com/coin-or/Ipopt
COIN-OR: https://github.com/coin-or/
For optimal control, Casadi: https://web.casadi.org/
5
Preliminaries
See https://www.stat.cmu.edu/~ryantibs/convexopt/prerequisite_topics.
pdf for refresher.
Please also see the Appendices of Boyd’s Book and Chapter 2 of ACO Book.
6
Optimization in Abstract Form
where
x decision variable, often a vector in Rn
X set of feasible solutions, often a subset of Rn
– often specified in terms of equality and inequality constraints
X := x 2 Rn |gi (x) 0, hj (x) = 0, i 2 {1, 2, . . . , m}, j 2 {1, 2, . . . , p} .
f : Rn ! R cost function
Goal:
Find x⇤ 2 X that minimizes the cost function, i.e., f (x⇤ ) f (x) for every
x 2 X.
Optimal value: f ⇤ := inf x2X f (x)
Optimal solution: x⇤ 2 X if f (x⇤ ) = f ⇤ .
7
Infimum vs. Minimum
f ⇤ := inf x2X f (x) if f ⇤ is the greatest lower bound on the value of the
function f (x) over x 2 X.
For any ✏ > 0, there exists some x̄ 2 X such that f ⇤ < f (x̄) < f ⇤ + ✏.
8
Examples
Let f (x) = e x
and X = [0, 1). Find f ⇤ and x⇤ .
Now suppose X = [0, 1] and f (x) = x for x > 0 and f (x) = 1 for x = 0.
9
Infeasible optimization problem
Example:
10
Unbounded optimization problem
Example:
11
Basic Topology of Sets
12
Bounded and Compact Set
13
Global and Local Optimum
Example:
When X is not bounded, then the above theorem still holds when an ↵-sublevel
set of f , defined as
S↵ (f ) := {x 2 X|f (x) ↵},
is non-empty and bounded for some ↵ 2 R.
14
Notes
15
Gradient (rf (x))
Compute gradient of
f (x) = x> a
f (x) = x> Ax
16
Hessian (H(x))
Compute Hessian of
f (x) = x> a
f (x) = x> Ax
17
Directional Derivative and Descent Direction
18
Necessary Condition of Optimality for Unconstrained
Problems
Theorem 2
If x⇤ is a local optimum for the problem minx2Rn f (x), then rf (x⇤ ) = 0.
Proof by contradiction:
19
Sufficient Condition of Optimality for Unconstrained
Problems
Theorem 3
If for x⇤ 2 Rn , we have rf (x⇤ ) = 0 and the Hessian of the cost function
f at x⇤ is a positive definite matrix, then x⇤ is a local optimum for the
problem minx2Rn f (x).
20
Least Sqaures Problem
21
Convex Sets
1
Basic Examples of Convex Sets
2
Sets Defined by Norms
8⇣ ⌘ p1
< P p
||z||p := i2[n] |xi | , 1 p < 1,
:max
i2[n] |xi |, p = 1.
Recall that norm satisfies triangle inequality and positive homogeneity. We define
[n] := {1, 2, . . . , n}.
3
Positive Semidefinite Matrices
25
Operations that preserve convexity of sets
26
Operations that preserve convexity of sets
27
Operations that preserve convexity of sets
X := X1 ⇥ X2 ⇥ . . . ⇥ Xm := {(x1 , x2 , . . . , xm ) | xi 2 Xi , i 2 [m]}
is a convex set.
Proposition
P 6 (Weighted
P Sum). If X1 , X2 , . . . , Xm are convex sets, then
i2[m] ↵i Xi := {y | y = i2[m] ↵i xi , xi 2 Xi } is a convex set for ↵i 2 R.
Example:
28
Operations that preserve convexity of sets
29
Ellipsoid
30
Convex Combination
Equivalent Definition:
Definition 4 (Convex Set). A set is convex if it contains all convex combi-
nations of its points.
31
Combination of points
Pn
Convex if i 0 and i=1 i = 1.
Conic if i 0,
Pn
Affine if i=1 i = 1,
Linear if i 2 R.
Note: Every cone must include the origin. Union of two cones is a cone.
32
Projection
Main idea:
Existence due to Weierstrass Theorem
Uniqueness via contradiction exploiting convexity
33
Supporting Hyperplane
H := {x 2 Rn | a> x b}.
34
Separating Hyperplane
Equivalently
sup a> x inf a> x
x2X1 x2X2
35
Separating Hyperplane Theorem
36
Theorem of the Alternative (Farkas’ Lemma)
Insight: If unable to show a system of linear inequalities does not have a solution,
try to show that its alternative system does.
Main Idea:
1. Easy to show that if (2) is feasible, (1) is infeasible.
2. For the converse, suppose (1) is infeasible. Then, b 2 / cone(a1 , a2 , . . . , an )
where ai is the i-th column of A. Find a hyperplane separating b from
cone(a1 , a2 , . . . , an ) and show that (2) is feasible.
37
Proof
38
Domain of a Function
39
Convex Functions
The Line segment joining (x, f (x)) and (y, f (y)) lies “above” the function.
Examples:
f (x) = x2
f (x) = ex
f (x) = a> x + b for x 2 Rn
40
Example: Norms
Examples:
P 1
||x||p := ( ni=1 |xi |p ) p for p 1.
p
||x||Q := x> Qx where Q is a positive definite matrix.
P Pn
||A||F := ( m i=1
2 1/2
j=1 |Ai,j | ) Frobenius norm on Rm⇥n .
41
Example: Indicator Function
42
Example: Support Function
Proposition 12. Support function of a set C is defined as IC⇤ (x) := supy2C x> y.
Support function of a set is always a convex function.
43
Special Types of Convex Functions
44
Jensen’s Inequality
45
Epigraph Characterization
46