FE501 – 1214 Nonlinearp Programming Week 3

Calculation of the Hessian Matrix

 

Calculating PMi to show the type of the Hessian Matrix, which is needed to find whether the function f(x1,x2,..xn) is a convex, concave or neither.

 

Expl. f(x,y)=x2y2

image-20221221100401033

CleanShot 2022-12-21 at 10.22.41

Note: First order PMs are on the diagnoze. Second is the determinate of the matrix.

The function is Neither Convex Nor Concave (NCNC)

 

Expl. f(x,y)=x2+y2

image-20221221100613924

CleanShot 2022-12-21 at 10.22.21

Actually we do not need to calculate this, because:

  1. Sum of CVX is CVX.
  2. Sum of CCV is CCV
  3. if f(x) is CVX, then f(x) is CCV

 

Expl. f(x,y)=x2y2

This is CCV (concave) cause sum of CCV is CCV.

CleanShot 2022-12-21 at 10.22.59

 

Expl. f(x,y)=x2+y2+xy

image-20221221101632182

CleanShot 2022-12-21 at 10.21.42

Expl. f(x,y)=x2y2xy

image-20221221101851938

NOTICE: Wrong result is addressed on this problem during the class!

CleanShot 2022-12-21 at 10.23.16

Unconstrained Nonlinear Optimization Problems

B.N.11.6-655

We now discuss how to find an optimal solution (if it exists) or a local extremum (local optimum point) for the following unconstrained NLP:

(1)max(ormin)f(x1,x2,..xn)s.t.(x1,x2,...,xn)Rn

We assume that for the given function the first and second partial derivatives are all exists.

Gradient and Stationary Point

Let f(x)xi =

(2)f(x)=[fx1fx2fx3fxn]

in formula (2) is called the gradient of the function.

Necessary condition for x=(x1,x2,..xn) to be a local extremum for NLP is:

(3)if such point is extremum point(max or min) for function, then:f(x)=0(for given point)

That means, for one dimensional function (single variable function), we just have to check the f(x) either being zero or not at the point.

 

Expl. f(x)=x2

image-20221221105229130

CleanShot 2022-12-21 at 10.54.07

We have learned how to determind the domain being either convex or not, and we also have learned determining the objective function being either convex or not, and now we will start learning about the local maximum or local minimum points and their properties.

Stationary points where gradient of f(x)=0 are candidate points for being local optimum solution.

or in other way:

A point x having f(x)=0 is called a stationary point of f.

 

More about stationary point (Optional Information1)

NOTE: you can skip this.

A stationary point, or critical point, is a point at which the curve's gradient equals to zero. Consequently if a curve has equation y=f(x) then at a stationary point we'll always have:

(4)f(x)=0

which can also be written:

(5)dydx=0

In other words the derivative function equals to zero at a stationary point*.

Different types of stationary points

There are three types of stationary points:

It is worth pointing out that maximum and minimum points are often called turning points.

Turning points

A turning point is a stationary point, which is can be:

each of which are illustared in the graphs shown here, where the horizontal tangent is shown in orange:

stationary-points-different-types-of-turning-points-illustration

How to find Stationary point ?

Given a function f(x) and its curve y=f(x), to find any stationary point(s) we follow three steps:

Stationary point and Local Minimum or Local Maximum (1)

(Choose either (1) or (2) methods, both has the same meaning but slightly different approach for finding the local minimum or maximum)

 

As we know that:

A point x having f(x)=0 is called a stationary point of f.

Let’s say for a given function f(x) we found the graph like this:

CleanShot 2022-12-21 at 11.12.54

(Apparently this is a CCV function).

As we can see, or let’s say we have calculated the of the function and found a point x (red point in the graph) which holds f(x)xi=0,i=1,2,...n ,

Let’s say when we increase the value of x slightly, without changing the values of y or z on the graph, we got the blue point. the function value for blue point holds:

(6)f(blue)f(red)

which also indicates that in it’s neibourhood of point(red), it is a local maximum point by definition.

To observe this more formally, we use Hessian matrix.

 

For a given stationary point xs,

If Hk(xs)>0,k=1,2,...n, then a stationary point xs is a local minimum point for NLP.

If, for k=1,2,...n,Hk(xs) is nonzero, and has the same sign as (1)k, then a stationary point x is a local maximum for NLP.

If Hn(xs)0 and the conditions above do not hold, then a stationary point xs is not a local extremum (not a local max or min), if a stationary point xs is not a local extremum, then it is called a saddle point.

If Hn(xs)=0 for a stationary point, then the stationary point may be a local maximum, a local minimum or a saddle point, and the preceding tests are inconclusive.

 

Stationary point and Local Minimum or Local Maximum (2)

This definition and process is given by Hocam and you might find this more useful.

For an unconstrined NLP, stationary points where the gradient f(x)=0 are the candidate points for being a local optimum solution.

 

Expl. f(x)=x2

 

CleanShot 2022-12-21 at 11.43.21

(7)f(x)=2xlet2x=0x=0

so x=0 is a local optimum point (for this problem it is min).

There are three posibilities:

  1. local minimum
  2. local maximum
  3. inflection point

 

Expl. f(x)=x2

(8)f(x)=2xlet2x=0x=0(stationary point)f(x)=2f(x=0)=2

So for this particular problem, x=0 is a local maximum point.

 

Expl. f(x)=x3

image-20221221114827057

(9)f(x)=3x2let3x2=0x=0

But x=0 is not a local maximum nor a local minimum point, it is a inflaction point.

So someother steps are needed in order to determine the type of the point.

 

Expl. f(x)=2x2

(10)1. find the stationary point: f(x)=2xlet2x=0x=0check the second order derivative at the stationary point: f(x)=2<0(second order derivative at given stationary point is negative)local maximum

Expl. f(x)=x3

(11)f(x)=3x2let3x2=0x=0f(x)=6xf(x=0)=0non conclusive

Actually, it is a inflaction point.

 

Expl. f(x)=x4

Obviously, x=0 is local minimum.

Unconstrained Theorems Theorems

 

If first non-zero derivative occurs at an odd ordered derivative, then x is an inflaction point.

 

If first non-zero derivative occurs at an even ordered derivative, and:

For a convex function, the local minimum is a gloabl minimum.

For a concave function, the local maximum is a global maximum.

In a case that we can not determine the function being convex or concave, then we need to:

  • check all the local minimum points and local maximum points
  • chec the boundary points of the function domains on the feasible region.

 

CleanShot 2022-12-21 at 12.16.45

For single variable function (single dimension)

Exercise f(x)=x32x+3

image-20221221122449901

image-20221221122256287

Check the function convexity :

(12)f(x)=6xxS,f(x)>0 ?NOnot CVXxS,f(x)<0 ?NOnot CCV

So this function is not convex nor concave.

 

Now we will test boundaries of the function:

limxf(x)

limxf(x)

 

image-20221221123516214

For multi-dimensional function (multivariable function)

Exercise f(x,y)=x2y+xy3xy

image-20221221123953772

image-20221221125320175

image-20221221125422942

image-20221221125450292

image-20221221125937417

Now we need to put each stationary point into the H(x,y) and check the Hessian Matrix Value.

CleanShot 2022-12-21 at 12.41.05

CleanShot 2022-12-21 at 13.01.42

Then we need to check the kthe Leading principle minor to check the point is a local minimum or local maximum or not either of them.

Theorem:

If LPMk > 0, then the H is positive definite, st.pt is local min.

If (1)kLPMk > 0, then the H is negative definite, st.pt is local max.

 

image-20221221131251458

image-20221221131340721

image-20221221131456480

image-20221221131538661

CleanShot 2022-12-21 at 13.16.14

CleanShot 2022-12-21 at 13.16.33

CleanShot 2022-12-21 at 13.16.59

Unconstrained Optimization Done.

 

Extra

Quadratic Problems

QP is NLP where the largest power is Square (^2).

 

[End of 1214]

 

References