Class 20220823

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 35

Applied Linear Algebra and Optimization

Unconstrained Optimization

Shirish Shevade

Shirish Shevade (IISc) Unconstrained Optimization 1 / 148


Global Minimum

Let X ⊆ Rn and f : X → R
Consider the problem,
Constrained optimization problem

min f (x)
x
s.t. x ∈ X

Definition
x ∗ ∈ X is is said to be a global minimum of f over X if
f (x ∗ ) ≤ f (x) ∀ x ∈ X .

Question: Under what conditions on f and X does the function f attain


its maximum and/or minimum in the set X ?

Shirish Shevade (IISc) Unconstrained Optimization 2 / 148


20

16

12
f(x)

0
−2 −1 0 1 2 3 4 5 6

Shirish Shevade (IISc) Unconstrained Optimization 3 / 148


Global Minimum

X = R, f : X → R defined as f (x) = x 3 .

8000

6000

4000

2000
f(x)
0

−2000

−4000

−6000

−8000
−20 −15 −10 −5 0 5 10 15 20

f attains neither a minimum nor a maximum on X

Note: X is closed, but not bounded; that is, X is not a compact set

Shirish Shevade (IISc) Unconstrained Optimization 4 / 148


Constrained Optimization

X = (a, b), f : X → R defined as f (x) = x.

f attains neither a minimum nor a maximum on X

Note:
X is bounded, but not closed; that is, X is not a compact set
f does attain infimum at a and supremum at b

Shirish Shevade (IISc) Unconstrained Optimization 5 / 148


Constrained Optimization

X = [−1, 1], f : X → R defined as f (x) = x if −1 < x < 1 and 0


otherwise.

f attains neither a minimum nor a maximum on X

Note:
X is closed and bounded; X is compact
f is not continuous on X
Shirish Shevade (IISc) Unconstrained Optimization 6 / 148
Weierstrass’ Theorem

Theorem
Let X ⊂ Rn be a nonempty compact set and f : X → R be a
continuous function on X . Then, f attains a maximum and a minimum
on X ; that is, there exist x 1 and x 2 in X such that

f (x 1 ) ≥ f (x) ≥ f (x 2 ) ∀x ∈ X .

Note: Weierstrass’ Theorem provides only sufficient conditions for the


existence of optima.

Shirish Shevade (IISc) Unconstrained Optimization 7 / 148


Constrained Optimization

X = [a, b], f : X → R

f (x) not continuous; but f attains a minimum

Shirish Shevade (IISc) Unconstrained Optimization 8 / 148


Constrained Optimization

X = R, f : X → R defined as f (x) = (x − 2)2 .

20

16

12
f(x)

0
−2 −1 0 1 2 3 4 5 6

f (x) continuous, X not compact; but f attains a minimum

Shirish Shevade (IISc) Unconstrained Optimization 9 / 148


Unconstrained Optimization

20

16

12
f(x)

0
−2 −1 0 1 2 3 4 5 6

Shirish Shevade (IISc) Unconstrained Optimization 10 / 148


Global Minimum

Let X ⊆ Rn and f : X → R
Consider the problem,
Constrained optimization problem

min f (x)
x
s.t. x ∈ X

Definition
x ∗ ∈ X is is said to be a global minimum of f over X if
f (x ∗ ) ≤ f (x) ∀ x ∈ X .

Global minimum is difficult to find or characterize for a general


nonlinear function

Shirish Shevade (IISc) Unconstrained Optimization 11 / 148


Local Minimum

Let X ⊆ Rn and f : X → R
Consider the problem,
Constrained optimization problem

min f (x)
x
s.t. x ∈ X

Definition
x ∗ ∈ X is is said to be a local minimum of f if there is a δ > 0 such that
f (x ∗ ) ≤ f (x) ∀ x ∈ X ∩ B(x ∗ , δ).

Shirish Shevade (IISc) Unconstrained Optimization 12 / 148


Strict Local Minimum

Definition
x ∗ ∈ X is is said to be a strict local minimum of f if
f (x ∗ ) < f (x) ∀ x ∈ X ∩ B(x ∗ , δ), x 6= x ∗ .

Shirish Shevade (IISc) Unconstrained Optimization 13 / 148


Different Types of Minima

Shirish Shevade (IISc) Unconstrained Optimization 14 / 148


Global Minimum and Local Minimum

Every global minimum is also a local minimum.


It may not be possible to identify a global min by finding all local
minima

f does not have a global minimum

Shirish Shevade (IISc) Unconstrained Optimization 15 / 148


Optimization Problems
Let X ⊆ Rn and f : X → R
Constrained optimization problem:

min f (x)
x
s.t. x ∈ X

Unconstrained optimization problem:

min f (x)
x∈Rn

Now, consider f : R → R
Unconstrained one-dimensional optimization problem:

min f (x)
x∈R

Shirish Shevade (IISc) Unconstrained Optimization 16 / 148


Unconstrained Optimization

Let f : R → R
Unconstrained problem

min f (x)
x∈R

What are necessary and sufficient conditions for a local minimum?


I Necessary conditions: Conditions satisfied by every local minimum
I Sufficient conditions: Conditions which guarantee a local minimum
Easy to characterize a local minimum if f is sufficiently smooth

Shirish Shevade (IISc) Unconstrained Optimization 17 / 148


First Order Necessary Condition
Let f : R → R, f ∈ C 1 .
Consider the problem, minx∈R f (x)
Result (First Order Necessary Condition)
If x ∗ is a local minimum of f , then f 0 (x ∗ ) = 0.
Proof.
Suppose f 0 (x ∗ ) > 0. f ∈ C 1 ⇒ f 0 ∈ C 0 .
Let D = (x ∗ − δ, x ∗ + δ) be chosen such that f 0 (x) > 0 ∀ x ∈ D.
Therefore, for any x ∈ D, using first order truncated Taylor series,

f (x) = f (x ∗ ) + f 0 (x̄)(x − x ∗ ) where x̄ ∈ (x ∗ , x).

Choosing x ∈ (x ∗ − δ, x ∗ ) we get,

f (x) < f (x ∗ ), a contradiction.

Similarly, one can show, f (x) < f (x ∗ ) if f 0 (x ∗ ) < 0.


Shirish Shevade (IISc) Unconstrained Optimization 18 / 148
First Order Necessary Condition
20 2

16
−2

−4

12
−6
f(x)

f(x)
−8
8

−10

−12
4

−14

0 −16
−2 −1 0 1 2 3 4 5 6 −4 −3 −2 −1 0 1 2 3 4

x x

f (x) = (x − 2)2 f (x) = −x 2


f 0 (2) = 0 f 0 (0) = 0

Slope of the function is zero at local minimum and also at local


maximum

Shirish Shevade (IISc) Unconstrained Optimization 19 / 148


First Order Necessary Condition
20 8000

6000

16
4000

2000
12
f(x)

f(x)
0

8
−2000

−4000
4

−6000

0 −8000
−2 −1 0 1 2 3 4 5 6 −20 −15 −10 −5 0 5 10 15 20

x x

f (x) = (x − 2)2 f (x) = x 3


f 0 (2) = 0 f 0 (0) = 0

Slope of the function is zero at a saddle point

Shirish Shevade (IISc) Unconstrained Optimization 20 / 148


Stationary Points

Let f : R → R, f ∈ C 1 .
Consider the problem, minx∈R f (x).
Definition
x ∗ is called a stationary point if f 0 (x ∗ ) = 0.

f 0 (x ∗ ) = 0 is a necessary but not sufficient condition for a local


minimum.

Question: How do we ensure that a stationary point is a local


minimum?

Shirish Shevade (IISc) Unconstrained Optimization 21 / 148


Second Order Necessary Conditions

20 2

16
−2

−4

12
−6
f(x)

f(x)
−8
8

−10

−12
4

−14

0 −16
−2 −1 0 1 2 3 4 5 6 −4 −3 −2 −1 0 1 2 3 4

x x

f (x) = (x − 2)2 , f 0 (2) = 0 f (x) = −x 2 , f 0 (0) = 0


f 00 (2) = 4 f 00 (0) = −2

Shirish Shevade (IISc) Unconstrained Optimization 22 / 148


Second Order Necessary Conditions
Let f : R → R, f ∈ C 2 .
Consider the problem, minx∈R f (x)
Result (Second Order Necessary Conditions)
If x ∗ is a local minimum of f , then f 0 (x ∗ ) = 0 and f 00 (x ∗ ) ≥ 0.
Proof.
By the first order necessary conditions, f 0 (x ∗ ) = 0.
Suppose f 00 (x ∗ ) < 0. Now, f ∈ C 2 ⇒ f 00 ∈ C 0 .
Let D = (x ∗ − δ, x ∗ + δ) be chosen such that f 00 (x) < 0 ∀ x ∈ D.
Therefore, for any x ∈ D, using second order truncated Taylor series,

1
f (x) = f (x ∗ ) + f 0 (x ∗ )(x − x ∗ ) + f 00 (x̄)(x − x ∗ )2 where x̄ ∈ (x ∗ , x).
2
Using f 0 (x ∗ ) = 0 and f 00 (x̄) < 0 ∀ x ∈ D, we get,

f (x) < f (x ∗ ), a contradiction.


Shirish Shevade (IISc) Unconstrained Optimization 23 / 148
Second Order Sufficient Conditions
Are the second order necessary conditions also sufficient?
I No
I Example: min x 3 subject to x ∈ R
I At x ∗ = 0, f 0 (x ∗ ) = f 00 (x ∗ ) = 0; but x ∗ is a saddle point!

8000

6000

4000

2000
f(x)

−2000

−4000

−6000

−8000
−20 −15 −10 −5 0 5 10 15 20

f (x) = x 3
f 0 (0) = f 00 (0) = 0

Shirish Shevade (IISc) Unconstrained Optimization 24 / 148


Second Order Sufficient Conditions
Let f : R → R, f ∈ C 2 .
Consider the problem, minx∈R f (x)
Result (Second Order Sufficient Conditions)
If x ∗ ∈ R such that f 0 (x ∗ ) = 0 and f 00 (x ∗ ) > 0, then x ∗ is a strict local
minimum of f over R.
Proof.
f ∈ C 2 ⇒ f 00 ∈ C 0 .
Let D = (x ∗ − δ, x ∗ + δ) be chosen such that f 00 (x) > 0 ∀ x ∈ D.
Therefore, for any x ∈ D, using second order truncated Taylor series,

1
f (x) = f (x ∗ ) + f 0 (x ∗ )(x − x ∗ ) + f 00 (x̄)(x − x ∗ )2 where x̄ ∈ (x ∗ , x).
2

Therefore, f 0 (x ∗ ) = 0 ⇒ f (x) − f (x ∗ ) = 21 f 00 (x̄)(x − x ∗ )2 > 0.


That is, f (x) > f (x ∗ ) ∀ x ∈ D ⇒ x ∗ is a strict local minimum.

Shirish Shevade (IISc) Unconstrained Optimization 25 / 148


Second Order Sufficient Conditions

Note: Second order sufficient conditions


guarantee that the local minimum is strict, and
are not necessary. (For f (x) = x 4 , x ∗ = 0 is a strict local
minimum; but f 0 (x ∗ ) = f 00 (x ∗ ) = 0.)

Shirish Shevade (IISc) Unconstrained Optimization 26 / 148


Sufficient Optimality Conditions

Let f : R → R, f ∈ C ∞ .
Let us assume that f is not a constant function.
Let the k -th derivative of f at x be denoted by f (k ) (x).
Consider the problem, minx∈R f (x).

Result
x ∗ is a local minimum if and only if the first non-zero element of the
sequence {f (k ) (x ∗ )} is positive and occurs at even positive k .

Result
Consider the problem, maxx∈R f (x). x ∗ is a local maximum if and only
if the first non-zero element of the sequence {f (k ) (x ∗ )} is negative and
occurs at even positive k .

Shirish Shevade (IISc) Unconstrained Optimization 27 / 148

You might also like