bfgsmin is called as
The first argument
is a string variable that holds the name
of the function to be minimized. The second argument,
, is
a cell array that hold the arguments of
. The third argument
is an optional cell array of
elements. The elements of
are described in Table 1.
Table 1:
Controls for bfgsmin
|
|
|
|
The outputs of bfgsmin are obvious, except the code values
that
can take on. These are -1 for no convergence,
maxiters exceeded; 1: convergence according to the specified strong
or weak criterion; 2: no convergence due to failure of the algorithm
(e.g., the gradient calculation fails, or a stepsize cannot
be found).
Consider a simple example - minimizing a quadratic function. The program
bfgsmin-example.m
follows:
/home/sh/Dokumenter/octave/octave-forge/main/optim/doc/bfgsmin-example.m
- The first example uses numeric derivatives, and minimizes with respect
to
the first argument of the objective function. The second
argument,
is treated as fixed.
- The second example uses analytic derivatives, since it calls objective2,
and minimizes with respect to
the first argument of the objective
function. The second argument,
is treated as fixed.
- The third example uses numeric derivatives, and minimizes with respect
to
the second argument of the objective function, since the
4th element of control, minarg, is 2 . The first
argument,
is treated as fixed.
The output of running this example is
/home/sh/Dokumenter/octave/octave-forge/main/optim/doc/bfsg-example.out
Notice that analytic gradients lead
to faster convergence that do numeric gradients. Also note in the
third example, where minarg=2, that minimization can be with
respect to any of the arguments of the objective function.
Søren Hauberg
2008-04-29