Usage: |
min = nmBFGS(func,x0{,fder,linmin,ftol,gtol,maxiter,nowarn}) or
min = nmBFGS(func,x0{,fder,opt})
|
Input: |
| func | string, name of the function to minimize.
The function should have just one
parameter x, which is either a n x 1 vector,
if fder is given (see below),
or a n x k matrix (for any k >= 1) containing
x = (x1,x2,...,xk), if the gradient
is to be computed automatically;
xi (n x 1 vector; i=1..k) represent points
at which the function should be evaluated.
As a result, the function should return
a scalar.
|
| x0 | n x 1 vector, the initial estimate of the minimum
|
| fder | (optional) derivatives of func; there are several possible
formats:
1. string, name of the function for computing the gradient
of func; its output is a n x 1 vector
2. empty string; in this case the gradient will be
computed automatically using the quantlet nmgraddiff
with a default step h
3. scalar h; the gradient will be computed
automatically using the quantlet nmgraddiff with
the given step h
|
| opt | (optional) list containing all or some of the following
items: linmin, ftol, maxiter and nowarn as described below
|
| linmin | (optional) string, name of the routine for 1D (line)
minimization; default is linmin = "nmlinminappr"
|
| ftol | (optional) scalar, reserved for future usage;
convergence tolerance of the function value,
default is ftol = 1e-7
|
| gtol | (optional) scalar, convergence tolerance of the value
of the function gradient;
default is gtol = 1e-9
|
| maxiter | (optional) scalar, maximal number of iterations;
default is maxiter = 250
|
| nowarn | (optional) scalar; by default, nowarn = 0.
If nowarn is set to a nonzero value, no warnings
will be shown and nowarn = 1 will be set to 1
for quantlets called by nmBFGS having this option
|
Output: |
| min.xmin | n x 1 vector, minimum of func (isolated to a fractional precision of tol) |
| min.fmin | scalar, minimal function value f(xmin) |
| min.iter | scalar, number of performed iterations |