Académique Documents
Professionnel Documents
Culture Documents
Prerequisites:
Optimization – Part II
Optimization – Part I
Benoı̂t Chachuat <benoit@mcmaster.ca>
11111111111111111
00000000000000000
Benoı̂t Chachuat (McMaster University) NLP: Single-Variable, Unconstrained 4G03 1 / 18 Benoı̂t Chachuat (McMaster University) NLP: Single-Variable, Unconstrained 4G03 2 / 18
Benoı̂t Chachuat (McMaster University) NLP: Single-Variable, Unconstrained 4G03 3 / 18 Benoı̂t Chachuat (McMaster University) NLP: Single-Variable, Unconstrained 4G03 4 / 18
Region Elimination Methods (Minimize Case) Golden Section Search (Minimize Case)
Iteratively consider the function value at 4 carefully spaced points: How do we choose the intermediate points x 1 , x 2 ?
Assume a unimodal function
Golden section search proceeds by keeping both possible intervals
Leftmost x ℓ is always a lower bound on the optimal value x ∗ [x ℓ , x 2 ] or [x 1 , x u ] equal
Rightmost x u is always an upper bound on the optimal value x ∗
Golden Section Search f (x)
Points x 1 and x 2 fall in between
Case 1: f (x 1 ) < f (x 2 ) Case 2: f (x 1 ) > f (x 2 ) The points x 1 , x 2 are taken as:
f (x) f (x) h i
∆
x1 = xu − γ xu − xℓ
h i
∆
x2 = xℓ + γ xu − xℓ
x
√
∆ 1+ 5 xℓ x1 x2 xu
with γ = ≈ 0.618 a reduction γ
x x 2
fraction know as the golden ratio xℓ x1 x2 xu
xℓ x1 x2 xu xℓ x1 x2 xu
Golden Section Search Algorithm (Minimize Case) Pros and Cons of Golden Section Search
Step 0: Initialization Pros:
◮ Choose lower and upper bounds, x ℓ and x u , that bracket x ∗ , as well as
stopping tolerance ǫ > 0
Objective function can be nonsmooth or even discontinuous
◮ Set x 1 ← x u − γ x u − x ℓ and x 2 ← x ℓ + γ x u − x ℓ
Calculations are straightforward (only function evaluations)
1 1
0.8 0.8
p3 (x)
p2 (x)
0.6 0.6
0.4 0.4
x x
0.2 0.2
xℓ xm xq xu xℓ xm xq xu
0 0
xℓ xm xu eliminated xℓ x
m
xu -0.2
0 1 2 3 4 5 6
-0.2
0 1 2 3 4 5 6
x x
Benoı̂t Chachuat (McMaster University) NLP: Single-Variable, Unconstrained 4G03 9 / 18 Benoı̂t Chachuat (McMaster University) NLP: Single-Variable, Unconstrained 4G03 10 / 18
Quadratic Fit Search (Minimize Case) Quadratic Fit Search Algorithm (Minimize Case)
How do we fit the curve? Step 0: Initialization
◮ Choose starting 3-point pattern (x ℓ , x m , x u ), as well as stopping
Quadratic fit search proceeds by fitting a 2nd-order polynomial tolerance ǫ > 0
through (x ℓ , f (x ℓ )), (x m , f (x m )) (x u , f (x u )): Step 1: Stopping
◮ If x u − x ℓ < ǫ, stop — report x ∗ ← x m as an approximate solution
∆ (x − x m )(x − x u )
ℓ (x − x ℓ )(x − x u )
p2 (x) = f (x ) ℓ ℓ
+ f (x m ) m Step 2: Quadratic Fit
(x − x )(x − x )
m u (x − x ℓ )(x m − x u )
◮ Compute quadratic fit optimum x q as
(x − x ℓ )(x − x m ) h i h i
+ f (x u ) u ℓ ℓ2 ℓ2
m2 u2
m u2 u m2
1 f (x ) x − x + f (x ) x − x + f (x ) x − x
(x − x ℓ )(x u − x m ) xq ←
2 f (x ℓ ) [x m − x u ] + f (x m ) [x u − x ℓ ] + f (x u ) [x ℓ − x m ]
Quadratic Fit Search Step 3a: Case x q < x m Step 3b: Case x q > x m
The unique optimum of the fitted quadratic function occurs at: ◮ If f (x q ) > f (x m ), update ◮ If f (x q ) > f (x m ), update
h i h i xℓ ← xq xh ← xq
ℓ ) x m2 − x u2 + f (x m ) x u2 − x ℓ 2 + f (x u ) x ℓ 2 − x m2
∆ 1
f (x ◮ Otherwise, update ◮ Otherwise, update
xq =
2 f (x ℓ ) [x m − x u ] + f (x m ) [x u − x ℓ ] + f (x u ) [x ℓ − x m ] u
x ←x , m
x m
←x q
x ℓ ← x m, xm ← xq
◮ Return to step 1 ◮ Return to step 1
Benoı̂t Chachuat (McMaster University) NLP: Single-Variable, Unconstrained 4G03 11 / 18 Benoı̂t Chachuat (McMaster University) NLP: Single-Variable, Unconstrained 4G03 12 / 18
Pros and Cons of Quadratic Fit Search Derivative-Based Methods
Pros: Improve convergence speed by using first- and second-order
Calculations are also straightforward (only function evaluations) derivatives taking full advantage of a 3-point pattern:
Assume a smooth function f
Typically faster than Golden section search (but not so much...)
Consider the quadratic approximation of f passing through the
Cons: current iterate x k
Assumes a unimodal function and requires prior knowledge of an Optimize this approximation to determine the next iterate, x k+1
enclosure x ∗ ∈ [x ℓ , x u ]
f (x)
Objective function has to be smooth
∆ (x−20)4
Example: Consider the problem: min f (x) = 500 − 2x
it. xℓ xm xu f (x ℓ ) f (x m ) f (x u ) xu − xℓ xq f (x q )
0 0.00 32.00 40.00 320.00 -22.53 240.00 40.00 20.92 -41.84
1 0.00 20.92 32.00 320.00 -41.84 -22.53 32.00 25.00 -48.75
2 20.92 25.00 32.00 -41.84 -48.75 -22.53 11.80 30.00 -40.03
3 20.92 25.00 30.00 -41.84 -48.75 -40.03 9.08
4 x
x k+1 x k
Benoı̂t Chachuat (McMaster University) NLP: Single-Variable, Unconstrained 4G03 13 / 18 Benoı̂t Chachuat (McMaster University) NLP: Single-Variable, Unconstrained 4G03 14 / 18
Benoı̂t Chachuat (McMaster University) NLP: Single-Variable, Unconstrained 4G03 15 / 18 Benoı̂t Chachuat (McMaster University) NLP: Single-Variable, Unconstrained 4G03 16 / 18
Variant: Quasi-Newton Algorithm Pros and Cons of (Quasi-)Newton Search
Idea: Approximate second-order derivatives using finite differences,
Pros:
f ′ (x k ) − f ′ (x k−1 ) Very fast convergence close to the optimal solution (quadratic
f ′′ (x k ) ≈
x k − x k−1 convergence rate)
Step 0: Initialization No need to bound the optimum within a range
◮ Choose initial points x −1 and x 0 , as well as stopping tolerance ǫ > 0 Cons:
◮ Set k ← 0
Requires a “good” initial guess, otherwise typically diverges
Step 1: Derivatives No distinction between (local) minima and maxima!
◮ Compute first-order derivative f ′ (x k ) and approximate inverse of Objective function has to be smooth and first-order derivatives must
∆ x k −x k−1
second-order derivatives B(x k ) = f ′ (x k )−f ′ (x k−1 ) be available (possibly second-order derivatives too)
Step 2: Stopping ∆ (x−20)4
Example: Consider the problem: min f (x) = 500 − 2x
◮ If f ′ (x k ) < ǫ, stop — report x ∗ ← x k as an approximate solution
k xk f (x k ) f ′ (x k ) f ′′ (x k ) |f ′ (x k )| d k+1
Step 3: Newton Step 0 30.00 -40.00 6.000 2.40 6.000 -2.50
◮ Compute Newton step d k+1 ← −f ′ (x k )B k 1 27.50 -48.67 1.37 1.35 1.375 -1.02
2 26.48 -49.43 0.18 1.01 0.178
◮ Update iterate x k+1 ← x k + d k+1 3
◮ Increment k ← k + 1 and return to step 1
Benoı̂t Chachuat (McMaster University) NLP: Single-Variable, Unconstrained 4G03 17 / 18 Benoı̂t Chachuat (McMaster University) NLP: Single-Variable, Unconstrained 4G03 18 / 18