home *** CD-ROM | disk | FTP | other *** search
-
- _n_o_n-_l_i_n_e_a_r _m_i_n_i_m_i_z_a_t_i_o_n
-
- 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)
-
- _A_r_g_u_m_e_n_t_s:
-
- f : the function to be minimized.
-
- p : starting parameter values for the minimiza-
- tion.
-
- 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 print-
- ing 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 informa-
- tion is printed.
-
- ndigit : the number of significant digits in the func-
- tion 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 rela-
- tive 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 optim-
- ization 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.
-
- _D_e_s_c_r_i_p_t_i_o_n:
-
- This function carries out a minimization of the func-
- tion f using a Newton-type algorithm. See the refer-
- ences for details.
-
- This is a preliminary version of this function and it
- will probably change.
-
- _V_a_l_u_e_s:
-
- A list containing the following components:
-
- minimum : the value of the estimated minimum of f.
-
- estimate : the point at which the mininum value of f is
- obtained.
-
- gradient : the gradient at the estimated minimum of f.
-
- hessian : the hessian at the estimated minimum of f (if
- requested).
-
- code : an integer indicating why the optimization process
- terminated. 1 = relative gradient is close to
- zero, current iterate is probably solution. 2 =
- successive iterates within tolerance, current
- iterate is probably solution. 3 = last global
- step failed to locate a point lower than estimate.
- Either estimate is an approximate local minimum of
- the function or steptl is too small. 4 = itera-
- tion limit exceeded. 5 = maximum step size stepmx
- exceeded five consecutive times. Either the func-
- tion is unbounded below, becomes asymptotic to a
- finite value from above in some direction, of
- stepmx is too small.
-
- _R_e_f_e_r_e_n_c_e_s:
-
- Dennis, J. E. and Schnabel, R. B. (1983) Numerical
- Methods for Unconstrained Optimization and Nonlinear
- Equations, Prentice-Hall, Englewood Cliffs, NJ.
-
- Schnabel, R. B., Koontz, J. E. and Weiss, B. E. (1985)
- A modular system of algorithms for unconstrained minim-
- ization, .CM Trans. Math. Software, 11, 419-440.
-
- _E_x_a_m_p_l_e_s:
-
- f <- function(x) sum((x-1:length(x))^2)
- nlm(f, c(10,10))
-
-