Learn R Programming

pracma (version 1.4.5)

hooke-jeeves: Hooke-Jeeves Method

Description

An implementation of the Hooke-Jeeves algorithm for derivative-free optimization.

Usage

hooke_jeeves(x0, f, h = 1, scale = 1,
             info = FALSE, tol = .Machine$double.eps^(2/3), ...)

Arguments

x0
start value.
f
function to be minimized.
h
starting step size.
scale
scale factor, of -1 the maximum will be searched for.
info
logical, whether to print information during the main loop.
tol
relative tolerance, to be used as stopping rule.
...
additional arguments to be passed to the function.

Value

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

Details

This method computes a new point using the values of f at suitable points along the orthogonal coordinate directions around the last point.

References

Quarteroni, Sacco, and Saleri (2007), Numerical Mathematics, Springer.

See Also

nelder_mead

Examples

Run this code
##  Rosenbrock function
hooke_jeeves(c(0, 0), rosenbrock)
# $xmin
# [1] 1 1
# $fmin
# [1] 1.328283e-16
# $fcalls
# [1] 31934
# $niter
# [1] 4344

Run the code above in your browser using DataLab