fmin#
- swordfish.function.fmin()#
Use a Nelder-Mead simplex algorithm to find the minimum of function of one or more variables. This algorithm only uses function values, not derivatives or second derivatives.
- 参数:
func (Constant) -- The objective function to be minimized. The function must return a numeric scalar.
X0 (Constant) -- A numeric scalar or vector indicating the initial guess.
xtol (Constant, optional) -- A positive number specifying the absolute error in xopt between iterations that is acceptable for convergence.
ftol (Constant, optional) -- A positive number specifying the absolute error in func(xopt) between iterations that is acceptable for convergence. The default value is 0.0001.
maxIter (Constant, optional) -- A non-negative integer indicating the maximum number of iterations to perform.
maxFun (Constant, optional) -- A non-negative integer indicating the maximum number of function evaluations to make.
- 返回:
A dictionary with the following keys:
xopt: a vector of floating-point numbers, indicating parameter that minimizes function.
fopt: a floating-point number, indicating value of function at minimum: fopt = f(xopt).
iterations: an integer, indicating number of iterations performed.
fcalls: an integer, indicating number of function calls made.
warnFlag: an integer that takes the following values
0: Optimization algorithm completed.
1: Maximum number of function evaluations made.
2: Maximum number of iterations reached.
- 返回类型: