Class NelderMead
java.lang.Object
com.quantfinlib.optimization.NelderMead
Derivative-free minimisation by the Nelder-Mead simplex method with the
standard coefficients (reflection 1, expansion 2, contraction 1/2, shrink
1/2), following Lagarias, Reeds, Wright and Wright, "Convergence
properties of the Nelder-Mead simplex method in low dimensions", SIAM J.
Optim. 9 (1998) 112-147.
Nelder-Mead can stall on a non-stationary point, so minimize(ToDoubleFunction, double[], double, double, int)
restarts from the best vertex with a fresh simplex until a restart no
longer improves the objective by more than the tolerance. It is meant for
smooth problems in a handful of unconstrained variables (likelihoods after
a reparameterisation that maps the admissible region onto R^k). An
objective value of NaN or +Infinity is treated as "worse than any finite
value", which lets the objective reject inadmissible points.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classResult: argmin, minimum, objective evaluations used. -
Method Summary
Modifier and TypeMethodDescriptionstatic NelderMead.Resultminimize(ToDoubleFunction<double[]> f, double[] start, double step, double tol, int maxEvals) Minimisesffromstart.
-
Method Details
-
minimize
public static NelderMead.Result minimize(ToDoubleFunction<double[]> f, double[] start, double step, double tol, int maxEvals) Minimisesffromstart.- Parameters:
f- objective; NaN or +Infinity marks an inadmissible pointstart- starting point (length k ≥ 1), must give a finite valuestep- initial simplex edge in every coordinate, > 0tol- convergence tolerance on the spread of simplex values, relative to1 + |f|, and on the restart gainmaxEvals- evaluation budget- Throws:
IllegalArgumentException- iff(start)is not finiteIllegalStateException- if the budget runs out before convergence
-