-
General method
prima(f, x0; kwds...)
which solves the problem with the most suitable Powell's algorithm (among COBYLA, LINCOA, BOBYQA, or NEWUOA) depending on the constraints imposed via the keywordskwds...
. -
Objective function and non-linear constraints for
cobyla
:- Non-linear equality constraints can be specified by keyword
nonlinear_eq
. - The objective function is called as
f(x)
like in other algorithms. - The functions implementing the non-linear constraints are passed by
keywords
nonlinear_eq
andnonlinear_ineq
.
- Non-linear equality constraints can be specified by keyword
-
Algorithms have a more similar interface:
- All algorithms have the same positional input, only the available keywords may change.
- All algorithms have the same convention for the objective function. Non-linear constraints, if any, are provided by other user-defined functions.
- All algorithms yield a 2-tuple
(x,info)
withx
an approximate solution (provided algorithm was successful) andinfo
a structured object collecting other outputs from the algorithm. The following properties are available for all algorithms:info.fx
is the objective function valuef(x)
,info.nf
is the number of evaluations of the objective function, andinfo.status
is the termination status of the algorithm. issuccess(info)
yields whether algorithm was successful.PRIMA.reason(info)
yields a textual description of the termination status of the algorithm.
-
Scaling of the variables: the variables
x ∈ ℝⁿ
may be scaled by the scaling factors provided by the caller via keywordsscale
to re-express the problem in the scaled variablesu ∈ ℝⁿ
such thatu[i] = x[i]/scale[i]
. Note that the objective function, the constraints (linear and non-linear), and the bounds remain specified in the variables. Scaling the variables is useful to improve the conditioning of the problem, to make the scaled variablesu
having approximately the same magnitude, and to adapt to heterogeneous variables or with different units.
-
Keywords for other constraints than bounds have been renamed as
nonlinear_ineq
for non-linear inequality constraints,linear_ineq
for linear inequality constraints, andlinear_eq
for linear equality constraints. -
In
cobyla
, if the caller is not interested in the values ofc(x)
expressing the non-linear inequality constraints, the number of such constraints may be provided instead of the array to storec(x)
.
First public version.