Rtnmin function

Truncated Newton function minimization

Truncated Newton function minimization

An R implementation of the truncated Newton method for minimization of nonlinear functions optionally subject to bounds (box) constraints. The algorithm is based on Nash (1979) UTF-8

tn(x, fgfun, trace=0, control=list(), ...) tnbc(x, fgfun, lower, upper, trace=0, control=list(), ...)

Arguments

  • x: A numeric vector of starting estimates.

  • fgfun: A function that returns the value of the objective at the supplied set of parameters par using auxiliary data in .... The gradient is returned as attribute "gradient". The first argument of fgfun must be par.

  • lower: A vector of lower bounds on the parameters.

  • upper: A vector of upper bounds on the parameters.

  • trace: Set > 0 to cause intermediate output to allow progress to be followed.

  • control: A list of control parameters. See the R code for tn()

    and tnbc() for details. Most users can omit this.

  • ...: Further arguments to be passed to fn.

Details

Function fgfun must return a numeric value in list item f

and a numeric vector in list item g.

These routines can be most easily called using the optimr

function with method "Rtnmin".

Note that as at 2024-10-23, the evaluation limits maxit and maxfun which appear in the code do NOT appear to be active.

Returns

A list with components: - xstar: The best set of parameters found.

  • f: The value of the objective at the best set of parameters found.

  • g: The gradient of the objective at the best set of parameters found.

  • ierror: An integer indicating the situation on termination. 0

    indicates that the method believes it has succeeded; 2 that more than maxfun (default 150*n, where there are n parameters); 3 if the line search appears to have failed (which may not be serious); and -1 if there appears to be an error in the input parameters.

  • nfngr: A number giving a measure of how many conjugate gradient solutions were used during the minimization process.

References

Stephen G. Nash (1984) "Newton-type minimization via the Lanczos method", SIAM J Numerical Analysis, vol. 21, no. 4, pages 770-788.

For Matlab code, see http://www.netlib.org/opt/tn

See Also

optimr

Examples

## See tn.Rd
  • Maintainer: John C Nash
  • License: GPL-2
  • Last published: 2024-12-10