Group: | Optimizer |
See also: | nelmin |
Function: | bfgs | |
Description: | Searches the global minimum of a function. |
Usage: | x = bfgs (x0, f, df, maxiter {,eps, gamma}) | |
Input: | ||
x0 | n x 1 vector of starting value | |
f | text, name of the procedure where the function is defined | |
df | text, name of the procedure where the derivative of the function is defined | |
maxiter | integer, maximal number of iterations | |
eps | scalar, bfgs stops, if df(x_i) < eps (i=1...n) (default = 1.0e-03) | |
gamma | scalar, starting value for linesearch (default = 1.0) | |
Output: | ||
x.minimum | n x 1 vector, coordinates of the minimum found | |
x.iter | integer, number of iterations needed | |
x.converged | 1 if the algorithm has converged and 0 if it has not |
proc (y) = f(x) y = sum((x-2)^2) endp proc (y) = df (x) y = 2*(x-2) endp x0=#(1,1,1) bfgs(x0,"f","df",50) //alternative bfgs may be called with text variables f1="f" ; define f as text variable containing string "f1" bfgs(x0, f1, "df", 50)
Contents of bfgs.minimum [1,] 2 [2,] 2 [3,] 2 Contents of bfgs.iter [1,] 1 Contents of bfgs.converged [1,] 1 Contents of bfgs.minimum [1,] 2 [2,] 2 [3,] 2 Contents of bfgs.iter [1,] 1 Contents of bfgs.converged [1,] 1
Group: | Optimizer |
See also: | nelmin |