nlm(f, p, hessian=FALSE, typsiz=rep(1, length(p)), fscale=1, print.level=0, ndigit=12, gradtl=1e-06, stepmx=max(1000 * sqrt(sum((p/typsiz)^2)), 1000), steptl=1e-06, iterlim=100)
f
| the function to be minimized. |
p
| starting parameter values for the minimization. |
hessian
|
if TRUE , the hessian of f
at the minimum is returned.
|
typsiz
| an estimate of the size of each parameter at the minimum. |
fscale
|
an estimate of the size of f at the minimum.
|
print.level
|
this argument determines the level of printing
which is done during the minimization process. The default
value of 0 means that no printing occurs, a value of 1
means that initial and final details are printed and a value
of 2 means that full tracing information is printed.
|
ndigit
|
the number of significant digits in the function f .
|
gradtl
|
a positive scalar giving the tolerance at which the
scaled gradient is considered close enough to zero to
terminate the algorithm. The scaled gradient is a
measure of the relative change in f in each direction
p[i] divided by the relative change in p[i] .
|
stepmx
|
a positive scalar which gives the maximum allowable
scaled step length. stepmx is used to prevent steps
which would cause the optimization function to
overflow, to prevent the algorithm from leaving the
area of interest in parameter space, or to detect
divergence in the algorithm. stepmx would be chosen
small enough to prevent the first two of these
occurrences, but should be larger than any anticipated
reasonable step.
|
steptl
| A positive scalar providing the minimum allowable relative step length. |
iterlim
| a positive integer specifying the maximum number of iterations to be performed before the program in terminated. |
f
using a Newton-type algorithm. See the references for details.
This is a preliminary version of this function and it will probably change.
minimum
f
.
estimate
f
is obtained.
gradient
f
.
hessian
f
(if requested).
code
estimate
. Either estimate
is an approximate local minimum of
the function or steptl
is too small.
4 = iteration limit exceeded.
5 = maximum step size stepmx
exceeded five consecutive
times. Either the function is unbounded below,
becomes asymptotic to a finite value from above in
some direction, of stepmx
is too small.
Schnabel, R. B., Koontz, J. E. and Weiss, B. E. (1985) A modular system of algorithms for unconstrained minimization, ACM Trans. Math. Software, 11, 419-440.