Learn R Programming

pracma (version 1.4.5)

nelder_mead: Nelder-Mead Minimization Method

Description

An implementation of the Nelder-Mead algorithm for derivative-free optimization.

Usage

nelder_mead(x0, f, maxiter = 1000, scale = 1,
            tol = .Machine$double.eps^(2/3), show = FALSE, ...)

Arguments

x0
starting vector.
f
nonlinear function to be minimized.
maxiter
max. number of iterations.
scale
scale factor, of -1 the maximum will be searched for.
tol
relative tolerance, to be used as stopping rule.
show
logical, whether to store intermediate information.
...
additional arguments to be passed to the function.

Value

  • List with following components:
  • xminminimum solution found.
  • fminvalue of f at minimum.
  • niternumber of iterations performed.

Details

Also called a `simplex' method for finding the local minimum of a function of several variables. The method is a pattern search that compares function values at the vertices of the simplex. The process generates a sequence of simplices with ever reducing sizes.

References

J. H. Mathews and K. D. Fink (2006). Numerical Methods Using Matlab. Fourth Edition, Pearson Education.

See Also

hooke_jeeves

Examples

Run this code
##  Rosenbrock function
nelder_mead(c(0, 0), rosenbrock)
# $xmin
# [1] 0.9999969 0.9999936
# $fmin
# [1] 1.131857e-11
# $niter
# [1] 49

Run the code above in your browser using DataLab