home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / base / nlm < prev    next >
Encoding:
Text File  |  1997-04-23  |  4.2 KB  |  112 lines

  1.     
  2.     _n_o_n-_l_i_n_e_a_r _m_i_n_i_m_i_z_a_t_i_o_n
  3.     
  4.          nlm(f, p, hessian=FALSE, typsiz=rep(1, length(p)), fscale=1,
  5.                  print.level=0, ndigit=12, gradtl=1e-06,
  6.                  stepmx=max(1000 * sqrt(sum((p/typsiz)^2)), 1000),
  7.                  steptl=1e-06, iterlim=100)
  8.     
  9.     _A_r_g_u_m_e_n_t_s:
  10.     
  11.                f : the function to be minimized.
  12.     
  13.                p : starting parameter values for the minimiza-
  14.                    tion.
  15.     
  16.          hessian : if TRUE, the hessian of f at the minimum is
  17.                    returned.
  18.     
  19.           typsiz : an estimate of the size of each parameter at
  20.                    the minimum.
  21.     
  22.           fscale : an estimate of the size of f at the minimum.
  23.     
  24.      print.level : this argument determines the level of print-
  25.                    ing which is done during the minimization
  26.                    process.  The default value of 0 means that
  27.                    no printing occurs, a value of 1 means that
  28.                    initial and final details are printed and a
  29.                    value of 2 means that full tracing informa-
  30.                    tion is printed.
  31.     
  32.           ndigit : the number of significant digits in the func-
  33.                    tion f.
  34.     
  35.           gradtl : a positive scalar giving the tolerance at
  36.                    which the scaled gradient is considered close
  37.                    enough to zero to terminate the algorithm.
  38.                    The scaled gradient is a measure of the rela-
  39.                    tive change in f in each direction p[i]
  40.                    divided by the relative change in p[i].
  41.     
  42.           stepmx : a positive scalar which gives the maximum
  43.                    allowable scaled step length.  stepmx is used
  44.                    to prevent steps which would cause the optim-
  45.                    ization function to overflow, to prevent the
  46.                    algorithm from leaving the area of interest
  47.                    in parameter space, or to detect divergence
  48.                    in the algorithm. stepmx would be chosen
  49.                    small enough to prevent the first two of
  50.                    these occurrences, but should be larger than
  51.                    any anticipated reasonable step.
  52.     
  53.           steptl : A positive scalar providing the minimum
  54.                    allowable relative step length.
  55.     
  56.          iterlim : a positive integer specifying the maximum
  57.                    number of iterations to be performed before
  58.                    the program in terminated.
  59.     
  60.     _D_e_s_c_r_i_p_t_i_o_n:
  61.     
  62.          This function carries out a minimization of the func-
  63.          tion f using a Newton-type algorithm.  See the refer-
  64.          ences for details.
  65.     
  66.          This is a preliminary version of this function and it
  67.          will probably change.
  68.     
  69.     _V_a_l_u_e_s:
  70.     
  71.          A list containing the following components:
  72.     
  73.     minimum : the value of the estimated minimum of f.
  74.     
  75.     estimate : the point at which the mininum value of f is
  76.               obtained.
  77.     
  78.     gradient : the gradient at the estimated minimum of f.
  79.     
  80.     hessian : the hessian at the estimated minimum of f (if
  81.               requested).
  82.     
  83.        code : an integer indicating why the optimization process
  84.               terminated.  1 = relative gradient is close to
  85.               zero, current iterate is probably solution.  2 =
  86.               successive iterates within tolerance, current
  87.               iterate is probably solution.  3 = last global
  88.               step failed to locate a point lower than estimate.
  89.               Either estimate is an approximate local minimum of
  90.               the function or steptl is too small.  4 = itera-
  91.               tion limit exceeded.  5 = maximum step size stepmx
  92.               exceeded five consecutive times.  Either the func-
  93.               tion is unbounded below, becomes asymptotic to a
  94.               finite value from above in some direction, of
  95.               stepmx is too small.
  96.     
  97.     _R_e_f_e_r_e_n_c_e_s:
  98.     
  99.          Dennis, J. E. and Schnabel, R. B. (1983) Numerical
  100.          Methods for Unconstrained Optimization and Nonlinear
  101.          Equations, Prentice-Hall, Englewood Cliffs, NJ.
  102.     
  103.          Schnabel, R. B., Koontz, J. E. and Weiss, B. E. (1985)
  104.          A modular system of algorithms for unconstrained minim-
  105.          ization, .CM Trans. Math. Software, 11, 419-440.
  106.     
  107.     _E_x_a_m_p_l_e_s:
  108.     
  109.          f <- function(x) sum((x-1:length(x))^2)
  110.          nlm(f, c(10,10))
  111.     
  112.