Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Zden ek Hur ak
Department of Control Engineering Faculty of Electrical Engineering Czech Technical University in Prague
1 / 38
2 / 38
fminsearch() in Matlab
3 / 38
4 / 38
Derivative-based methods
1. descent direction search . . . dk Line search methods Trust region methods xk +1 = xk + k pk 2. line search (step length determination) . . . k
5 / 38
6 / 38
Fibonacci search
Fibonacci sequence = 1, 1, 2, 3, 5, 8, 13, . . . Fix the number of intervals at the beginning. Say, 13:
f(x)
Start by evaluating f (x ) at x = 5 and x = 8. Need 4 evaluations (13 is the n = 4th Fib. number). In general n 2 steps and the uncertainty (b a)/Fn Improvement in the uncertainty Fn1 /Fn .
n
7 / 38
(1 +
5)/2
0.618
8 / 38
dk +1 /dk 0.618
f(x)
rk +1 r < (rk r )p
Examples: rk = ak ,
x a x2 x1 b
0<a<1 0<a<1
rk = a(2 ) ,
9 / 38
10 / 38
Linear convergence
Bisection method
rk +1 r =<1 k rk r lim Geometric series rk = c k Comparisons of two linearly converging algorithms based on their convergence ratios .
f(x)
x a x1 b
11 / 38
12 / 38
xk +1
0.35 0.3 0
0.1
0.2
0.3
0.4
0.5 x
0.6
0.7
0.8
0.9
13 / 38
14 / 38
g ( x)
xk +1 x = xk x
g ( xk ) g ( xk )
x 0 xk+1 xk x
g (xk ) g (x ) g (xk ) g (xk ) g (x ) + g (xk )(x xk ) = g (xk ) 1 g ( ) = (xk x )2 2 g (xk ) k1 |xk x |2 2k2
16 / 38
Steepest descent
Condition for descending direction dT k f (xk ) < 0 Recall the geometric interpettation of an inner product |dT k f (xk )| = |dk ||f (xk )| cos The steepest descent xk +1 = xk k f (xk )
1. steepest descent 2. Newton 3. Quasi-Newton 4. Conjugate direction /conjugage gradient method (CG)
17 / 38
18 / 38
750
5000
12
50
10
500 0
00
2500
22 5 20 00 0 17 00 50 15 0 00 0
75
25
40 20
00
12 50 0
00
10
50 00
0 00
500 0
25
x2
0
10 00 0
00
0
750
20 40 60 80
75
15 00 17 0 50 20 0 00 22 0 50 0
50
10
12
50
100 100
80
60
40
20
0 x
20
40
60
80
75
75
00
5000
00
00 0
500
00
250
250
12 50 0
00
100
Idea: The function to be minimized is approximated locally by a quadratic function and this approximating function is minimized exactly. xk +1 = xk [2 f (xk )]1 f (xk )
Hessian gradient
21 / 38
22 / 38
Another approach Bk = 2 f (xk ) + Ek where Ek = 0 if f (xk ) is suciently positive denite, otherwise it is chosen so that Bk > 0.
23 / 38 24 / 38
Quasi-Newton
From the denition of Hessian 2 fk (xk +1 xk ) fk +1 fk
sk yk
T yk yk Ts yk k
Find a matrix Bk +1 that mimics the Hessian behaviour above. Bk +1 sk = yk Typically two requirements symmetry (as Hessian) low-rank approximation between the steps
As inversion of Bk is needed, the update can be applied to its inverse directly: DFP (Davidon, Fletcher and Powell) Other updates keep the Hessian in factored formulation H = RRT Matlab chol() function ... Cholesky factorization
25 / 38
26 / 38
27 / 38
28 / 38
However, convergence to minimum not guaranteed: s (1x )2 4 2(1 x ) if x > 1 x )2 f (x ) = s (1+ 2(1 + x ) if x < 1 4 2 x 1 if 1 x 1.
Start with an initial step size s and if the corresponding vector xk + s d does not yield an improved (smaller) value of f (), that is, if f (xk + s d) f (xk ), reduce the step size, possibly by a xed factor. Repeat.
2 1
0.5 1.0
xk +1 = xk 1f (xk ).
29 / 38 30 / 38
Armijos condition
Goldsteins condition
31 / 38
32 / 38
Wolfes condition
Terminal conditions
33 / 38
34 / 38
Contours of mk (x)
35 / 38
36 / 38
Software
Summary
1. Optimization toolbox for Matlab: fminunc() (trust-region Newton), fminsearch() (Nelder-Mead simplex) 2. UnconstrainedProblems package for Mathematica: FindMinimumPlot, FindMinimum
line search methods: direction search, step lentgth determination, Newton methods, quasi-Newton. trust region methods.
37 / 38
38 / 38