296. Convex Analysis

Difficulties of NLP

296.0.0.1. Convexity

Convex Set

If for whatever two points you select in the set, the line segment connecting them also lies in the set, then the set is convex

A set 𝐹 is convex if

𝜆𝑥1+(1𝜆)𝑥2𝐹

for all 𝜆[0,1] and 𝑥1,𝑥2𝐹

Convex Function

For a convex domain 𝐹𝑛, a function 𝑓:𝑛 is convex over 𝐹 if

𝑓(𝜆𝑥1+(1𝜆)𝑥2)𝜆𝑓(𝑥1)+(1𝜆)𝑓(𝑥2)

for all 𝜆[0,1] and 𝑥1,𝑥2𝐹

Concave Function

For a convex domain 𝐹𝑛, a function 𝑓:𝑛 is concave over 𝐹 if 𝑓 is convex

Global Optimality of Convext Functions

Proposition 1. For a convex (concave) function 𝑓 over a convex doain 𝐹, a local minimum (maximum) is a global minimum (maximum)

Two conditions:

Proof

Suppose a local minimum 𝑥 is not a global minimum and there exists 𝑥 such that 𝑓(𝑥)<𝑓(𝑥). Consider a small enough 𝜆>0 such that 𝑥̄=𝜆𝑥+(1𝜆)𝑥 satisfies 𝑓(𝑥̄)>𝑓(𝑥). Such 𝑥̄ exists because 𝑥 is a local minimum. Now, note that

𝑓(𝑥̄)=𝑓(𝜆𝑥+(1𝜆)𝑥)>𝑓(𝑥)=𝜆𝑓(𝑥)+(1𝜆)𝑓(𝑥)>𝜆𝑓(𝑥)+(1𝜆)𝑓(𝑥)

Which violates the fact that 𝑓() is convex. Therefore, by contradiction, the local minimum 𝑥 must be a global minimum.

Minimize a concave function

Proposition 2: For a concave function that has a global minimum over a convex feasible region, there exists a global minimum that is an extreme point

Extreme point: In convex analysis, an extreme point of a convex set 𝐶 is a point in 𝐶 that cannot be expressed as a strict convex combination of two other distinct points in 𝐶

Special Case: LP

When we minimize 𝑓() over a convez feasible region 𝐹:

For any LP we have both

Proposition 3. The feasible region of an LP is convex

The intersections of convex sets are convex

Proposition 4. A linear function 𝑓:𝑛 is both convex and concave

Proof:

𝑓(𝜆𝑥1+(1𝜆)𝑥2)=𝜆𝑓(𝑥1)+(1𝜆)𝑓(𝑥2)

Let 𝑓(𝑥)=𝑐𝑇𝑥+𝑏 be a linear function, 𝑐𝑛,𝑏, then:

𝑓(𝜆𝑥1+(1𝜆)𝑥2)=𝑐𝑇(𝜆𝑥1+(1𝜆)𝑥2)+𝑏=𝜆(𝑐𝑇𝑥1+𝑏)+(1𝜆)(𝑐𝑇𝑥2+𝑏)=𝜆𝑓(𝑥1)+(1𝜆)𝑓(𝑥2)

Convex Programming

Consider a general NLP

min𝑥𝑛𝑓(𝑥)𝑠.𝑡.𝑔𝑖(𝑥)𝑏𝑖𝑖=1,,𝑚

If:

A local minimum is a global minimum

Definition 0: Convex Program (CP)

An NLP is convex if its feasible region is convex and its objective function is convex over the feasible region

Convex Programming:

Subject to a convex feasible region

Local min = Global min

For an NLP

min𝑥𝑛{𝑓(𝑥)|𝑔𝑖(𝑥)𝑏𝑖𝑖1,,𝑚}

if 𝑓 and 𝑔𝑖s are all convex functions, the NLP is a Convex Program

Proof:

We only need to prove that the feasible region is convex, which is implied if 𝐹𝑖={𝑥𝑛|𝑔𝑖(𝑥)𝑏𝑖} is convex for all 𝑖. For two points 𝑥1,𝑥2𝐹𝑖 and an arbitrary 𝜆[0,1], we have

𝑔𝑖(𝜆𝑥1+(1𝜆)𝑥2)𝜆𝑔𝑖(𝑥1)+(1𝜆)𝑔𝑖(𝑥2)𝜆𝑏𝑖+(1𝜆)𝑏𝑖=𝑏𝑖

Which implies that 𝐹𝑖 is convex. repeating this argument for all 𝑖 completes the proof

If each constraint independently given a convex feasible region, then their intersection is convex

Definition 0: Affine Combination

An affine combination of points 𝑥1,𝑥2,,𝑥𝑘𝑛, is any point of the form:

𝛼1𝑥1+𝛼2𝑥2++𝛼𝑘𝑥1+𝑥𝑘

where the coefficients sum to 1:

𝛼1+𝛼2++𝛼𝑘=1

This is like a linear combination, but with the extra condition that the weights add up to 1.

For a twice differentiable function 𝑓: over an interval (𝑎,𝑏):

First order condition (FOC) 𝑓(𝑥)=0

Example

Economic Order Quantity (EOQ)

Determine the order quantity in each order

  • Demand is deterministic and occurs at a constant rate
  • Each order incurs a fixed cost (independent of the order size)
  • No shortage allowed
  • Lead time is zero
  • Holding cost is proportional to the average inventory
  • Constant holding cost

Parameters:

  • 𝐷: annual demand (units/year)
  • 𝐾: unit ordering cost ($/order)
  • : annual holding cost ($/unit/year)
  • 𝑝: unit purchase cost ($/unit)

Decision Variable:

  • 𝑞: order quantity (units/order)

Objective:

  • Minimize the total annual cost

Average inventory level:

𝑞2

Annual holding cost:

𝐻=(𝑞2)=𝑞2

Annual purchase cost:

𝑝𝐷

Annual ordering cost:

𝑂=(𝐷𝑞)𝐾=𝐷𝐾𝑞

NLP, since 𝑝𝐷 does not depend on 𝑞 it does not affect the minimizer:

min𝑞>0𝑓(𝑞)=(𝐷𝑞)𝐾+(𝑞2)=𝐷𝐾𝑞+𝑞2

For:

𝑇𝐶(𝑞)=𝐾𝐷𝑞+𝑞2

we have

𝑇𝐶(𝑞)=𝐾𝐷𝑞2+2

and

𝑇𝐶(𝑞)=2𝐾𝐷𝑞3

Since a twice differentiable function is convex If

𝑓(𝑥)>0𝑥(𝑎,𝑏)

and

𝐾>0,𝐷>0,𝑞>0

we have

𝑇𝐶(𝑞)=2𝐾𝐷𝑞3>0

Therefore, 𝑇𝐶(𝑞) is convex

Let 𝑞 be the quantity satisfying the FOC:

𝑇𝐶(𝑞)=𝐾𝐷(𝑞)2+2=0𝑞=2𝐾𝐷

Implications:

  • If order cost 𝐾 increases, order quantity 𝑞 increases
  • If demand 𝐷 increases, order quantity 𝑞 increases
  • If holding cost increases, order quantity 𝑞 decreases

296.0.1. Multivariate Convex Analysis

An optimal solution either:

If a NLP is a CP, a feasible point satisfying the FOC is optimal (any local minimum is a global minimum)

For a function 𝑓:𝑛, its 𝑖th partial derivative is 𝜕𝑓(𝑥)𝜕𝑥𝑖

For a twice differentiable function 𝑓:𝑛, if all second order partial derivatives are continuous:

𝜕2𝑓(𝑥)𝜕𝑥𝑖𝜕𝑥𝑗=𝜕2𝑓(𝑥)𝜕𝑥𝑗𝜕𝑥𝑖

for all 𝑖=1,,𝑛 and 𝑗=1,,𝑛.

Single variate case:

Multivariate case:

𝑓(𝑥)=[𝜕𝑓(𝑥)𝜕𝑥1𝜕𝑓(𝑥)𝜕𝑥𝑛]2𝑓(𝑥)=𝐻𝑓=[𝜕2𝑓(𝑥)𝜕𝑥12𝜕2𝑓(𝑥)𝜕𝑥1𝜕𝑥𝑛𝜕2𝑓(𝑥)𝜕𝑥𝑛𝜕𝑥1𝜕2𝑓(𝑥)𝜕𝑥𝑛2]
Example
𝑓(𝑥1,𝑥2,𝑥3)=𝑥12+𝑥2𝑥3+𝑥33𝑓(𝑥)=[𝜕𝑓(𝑥)𝜕𝑥1𝜕𝑓(𝑥)𝜕𝑥2𝜕𝑓(𝑥)𝜕𝑥3]=[2𝑥1𝑥3𝑥2+3𝑥32]2𝑓(𝑥)=[𝜕2𝑓(𝑥)𝜕𝑥12𝜕2𝑓(𝑥)𝜕𝑥1𝜕𝑥2𝜕2𝑓(𝑥)𝜕𝑥1𝜕𝑥3𝜕2𝑓(𝑥)𝜕𝑥2𝜕𝑥1𝜕2𝑓(𝑥)𝜕𝑥22𝜕2𝑓(𝑥)𝜕𝑥2𝜕𝑥3𝜕2𝑓(𝑥)𝜕𝑥3𝜕𝑥1𝜕2𝑓(𝑥)𝜕𝑥3𝜕𝑥2𝜕2𝑓(𝑥)𝜕𝑥32]=[200001016𝑥3]

You may ask:

  • What is the gradient at a point: 𝑓(3,2,1)
  • What is the Hessian at a point: 2𝑓(3,2,1)

Single Variate Function

𝑓:
  • 𝑓 is convex in [𝑎,𝑏] if 𝑓(𝑥)0 for all 𝑥[𝑎,𝑏]
  • 𝑥̄ is an interior local minimum if 𝑓(𝑥̄)=0
  • If 𝑓 is convex in [𝑎,𝑏], 𝑥 is a global minimum iff 𝑓(𝑥)=0

Multi Variate Function

𝑓:𝑛
  • 𝑓 is convex in a convex set 𝐹𝑛 if 2𝑓(𝑥) is positive semi-definite for all 𝑥𝐹
  • 𝑥̄ is an interior local minimum if 𝑓(𝑥̄)=𝟎
  • If 𝑓 is convex in a convex set 𝐹, 𝑥 is a global minimum iff 𝑓(𝑥)=0

Definition 0: Positive Semi-Definite (PSD) Matrix

A symmetric matrix 𝐴 is positive semi-definite if 𝐱𝑇𝐴𝐱0 for all 𝐱𝑛

Example

Semi-Definite Matrix

𝐴=[2112]𝑥𝑇𝐴𝑥=[𝑥1𝑥2][2112][𝑥1𝑥2]=2𝑥12+2𝑥1𝑥2+2𝑥22=2(𝑥1+𝑥1)2+𝑥12+𝑥220

Given a function 𝑓, when is its Hessian 2𝑓 PSD?

For a symmetric matrix 𝐴, the following statements are equivalent:

𝐴’s level-𝑘 principal minors is the determinant of a 𝑘×𝑘 submatrix whose diagonal is a subset of 𝐴’s diagonal.

A sufficient condition is for 𝐴’s leading principl minors to all positive

For a function 𝑓:

  1. Find Hessian 2𝑓(𝑥)
  2. Find eigenvalues or principal minors of 2𝑓(𝑥)
  3. Determine over what region 2𝑓(𝑥) is PSD

The function is convex over that region

Example
min𝑥2𝑓(𝑥1,𝑥2)𝑓(𝑥1,𝑥2)=𝑥12+𝑥22+𝑥1𝑥22𝑥14𝑥2𝑓(𝑥)=[2𝑥1+𝑥22𝑥1+2𝑥24]2𝑓(𝑥)=[2112]

Find eigenvalues

𝐴𝑥=𝜆𝑥(𝐴𝜆𝐼)𝑥=0det(𝐴𝜆𝐼)=0|2𝜆112𝜆|=034𝜆+𝜆2=0𝜆=1or3

Or find leading principal minors

|2|=2and|2112|=3

So 2𝑓(𝑥1,𝑥2) is PSD and thus min𝑥2𝑓(𝑥1,𝑥2) is a CP.

The FOC requires 2𝑥1+𝑥22=0 and 𝑥1+2𝑥24=0

I.e., (𝑥1,𝑥2)=(0,2)

Example
min𝑥2𝑓(𝑥1,𝑥2)𝑓(𝑥1,𝑥2)=𝑥13+4𝑥1𝑥2+12𝑥22+𝑥1+𝑥22𝑓(𝑥)=[6𝑥1441]
  • 1st leading principle minor 6𝑥10 (𝑥10)
  • 2nd leading principal minor 6𝑥1160 (𝑥183)
  • 10

Therefore, the function is convex iff 𝑥183

Example

Two-Product Pricing

A retailer sells product 1 and 2 at prices 𝑝1 and 𝑝2. For product 𝑖 the demand 𝑞𝑖 is:

𝑞1=𝑎𝑝1+𝑏𝑝2𝑞2=𝑎𝑝2+𝑏𝑝1

where 𝑎>0 and 𝑏[0,1). The retailer sets 𝑝1 and 𝑝2 to maximize its total profit.

If 𝑝1 and 𝑝2 are substitutes of one another then the price of one will affect the demand of the other.

  1. Why 𝑏[0,1)?

If 𝑏1: the other product’s price will have the equal or greater impact on your own product’s price

If 𝑏<0: Complimentary products (rather than substitutes), the higher the other product’s price, the lower our demand

  1. Formulate problem
max𝑝1,𝑝2𝑝1(𝑎𝑝1+𝑏𝑝2)𝑞1+𝑝2(𝑎+𝑏𝑝1𝑝2)𝑞2

Let

𝑓(𝑝)=[𝑝1(𝑎𝑝1+𝑏𝑝2)+𝑝2(𝑎+𝑏𝑝1𝑝2)
  1. Is it a CP?
2𝑓(𝑝)=[22𝑏2𝑏2]

Which is PSD if 𝑏[0,1) since

  • 1st leading principle minor 20
  • 2nd leading principle minor 44𝑏2 (4(1𝑏)(1+𝑏)0)

Therefore 𝑓(𝑝) is convex and 𝑓(𝑝), the objective function is concave

The problem is a CP

  1. Solve problem

𝑓(𝑝)=0 requires:

  • 𝑎+2𝑝12𝑏𝑝2=0
  • 𝑎+2𝑝22𝑏𝑝1=0

So,

𝑝1=𝑝2=𝑎2(1𝑏)
  1. How does optimal prices change with 𝑎 and 𝑏?

When

  • 𝑎 increases, the two prices increase: price of product increases when demand increases
  • 𝑏 increases, the two prices increase: effective demand becomes larger
Example

Question 1

For each of the following sets, select all that are convex:

  1. 𝑆={(𝑥1,𝑥2)2|𝑥12+𝑥224,𝑥10,𝑥20}

𝑥12+𝑥224, a disk of radius 2, is convex and the 𝑥10,𝑥20 lines are also convex

The intersection of convex sets is convex

  1. 𝑆={(𝑥1,𝑥2)2|𝑥12+𝑥224,𝑥10,𝑥20}

❌ Integer programs are never convex in the usual sense, because the feasible set of integers is discrete

  1. 𝑆={𝑥𝑛|𝑖=1𝑛𝑥𝑖24,𝑥10,𝑥20}

𝑖=1𝑛𝑥𝑖24, a 𝑛-dimensional sphere (hypersphere) of radius 2, is convex and the 𝑥10,𝑥20 lines are also convex

The intersection of convex sets is convex

  1. 𝑆={𝑥𝑛|𝑥1+𝑥2=10(𝑥3+𝑥4)}where𝑛4

(𝑥) is a linear function ((𝑥)=𝑥1+𝑥210𝑥310𝑥4) so (𝑥) is also affine and is therefore convex

  1. 𝑆={𝑥𝑛|max𝑖=1,,𝑛{𝑥𝑖}=10min𝑖=1,,𝑚{𝑥𝑖}}

min(𝑥) and max(𝑥)

Question 2

For each of the following functions, select all that are convex over the given region:

  1. 𝑓(𝑥)=2𝑥3𝑥22𝑥+1 for 𝑥

𝑓(𝑥)=6𝑥22𝑥2

𝑓(𝑥)=12𝑥2

  1. 𝑓(𝑥)={𝑥if𝑥<11if𝑥1for𝑥

  1. 𝑓(𝑥)=𝑥124𝑥1𝑥2+3𝑥22+3𝑥1+4𝑥2 for 𝑥2

  1. 𝑓(𝑥)=𝑖=1𝑛(𝑥𝑖𝑎)2 where 𝑎>0, 𝑥𝑛

  1. 𝑓(𝛼,𝛽)=𝑖=1𝑛(𝛼+𝛽𝑥𝑖𝑦𝑖)2, where 𝑥𝑖,𝑦𝑖,𝛼,𝛽

Question 3

For the NLP

min2𝑥3𝑥22𝑥+1𝑠.𝑡.𝑥1

which of the following statements is correct?

  1. This is a convex program.

  1. There are two local minimizers.

  1. The unique global minimizer is a boundary point.

  1. This program is unbounded.

  1. None of the above.

Question 4

For each of the following matrices, select all that are positive semi-definite:

𝐴=[1111]

𝐴=[123231312]

𝐴=[123031002]

𝐴=[123𝑛023𝑛003𝑛000𝑛]

𝐴=[001010100]

Question 5

For the following statements, select all that are incorrect:

  1. An optimal solution to a linear program must be a boundary point.

❌ not guaranteed if the objective is constant over the feasible region

  1. An optimal solution to a linear program must be an extreme point.

  1. An optimal solution to a nonlinear program can be an interior point.

  1. An optimal solution to a nonlinear program must be an interior point.

  1. A global optimal solution to a nonlinear program must be a local optimal solution.