
to force the Hessian matrix to remain positive definite so that the search direction
will lead to improvement (reduction) in the function value at each step.
The advantages and drawbacks of the method of steepest descent and Newton’s
method are complementary. An efficient and popular minimization algorithm is the
Levenberg–Marquart method, which combines the two techniques in such a way
that minimization begins with steepest descent. When the minimum point is near
(e.g. Hessian is positive definite), convergence slow s down , and the iterative routi ne
switches to Newton’s method, producing a more rapid convergence.
Using MATLAB
Optimization Toolbox contains the built-in function fminunc that searches for the
local minimum of a multivariable objective function. This function operates on two
scales. It has a large-scale algorithm that is suited for an unconstrained optimization
problem consisting of many variables. The medium-scale algorithm should be chosen
when optimizing a few variables. The latter algorithm is a line search method that
calculates the gradient to provide a search direction. It uses the quasi-Newton method
to approximate and update the Hessian matrix, whose inverse is used along with the
gradient to obtain the search direction. In the quasi-Newton method, the behavior of
the function fðxÞand its gradient rfðxÞ is used to determine the form of the Hessian at
x. Newton’s method, on the other hand, calculates H directly from the second partial
derivatives. Gradient methods, and therefore the fminunc function, should be used
when the function derivative is continuous, since they are more efficient.
The default algorithm is large-scale. The large-scale algorithm approximates the
objective function with a simpler function and then establishes a trust region within
which the function minimum is sought. The second partial derivatives of the objec-
tive function can be made available to fminunc by calculating them along with the
objective function in the user-defined functi on file. If the options structure
instructs fminunc to use the user-supplied Hessian matrix, these are used in place
of the numerical approximations generated by the algorithm to approximate the
Hessian. Only the large-scale algorithm can use the user-supplied Hessian matrix
calculations, if provided. Note that calculating the gradient rfðxÞ along with the
function fðxÞ is optional when using the medium-scale algorithm but is required
when using the large-scale algorithm.
One form of the syntax is
x = fminunc(func, x0, options)
x
0
is the initial guess value and can be a scalar, vector, or matrix. Use of optimset
to construct an options structure was illustrated in Section 8.2.3. Options can be
used to set the tolerance of x, to set the tolerance of the function value, to specify use
of user-supplied gradient calculations, to specify use of user-supplied Hessian cal-
culations, whether to proceed with the large-scale or medium-scale algorithm by
turning “LargeScale” on or off, and various other specifics of the algorithm. To
tell the function fminunc that func also returns the gradient and the Hessian
matrix along with the scalar function value, create the following structure:
options = optimset(‘GradObj’, ‘ on’, ‘Hessian’, ‘on’)
to be passed to fminunc.Whenfunc supplies the first partial derivatives and the
second partial derivatives at x along with the function value, it should have three
511
8.3 Unconstrained multivariable optimization