Nelder-Mead is a derivative-free simplex method.
bool nm(arma::vec& init_out_vals, std::function<double (const arma::vec& vals_inp, arma::vec* grad_out, void* opt_data)> opt_objfn, void* opt_data); bool nm(arma::vec& init_out_vals, std::function<double (const arma::vec& vals_inp, arma::vec* grad_out, void* opt_data)> opt_objfn, void* opt_data, algo_settings_t& settings);
Function arguments:
init_out_vals
a column vector of initial values; will be replaced by the solution values.opt_objfn
the function to be minimized, taking three arguments:
vals_inp
a vector of inputs;grad_out
an empty vector, as Nelder-Mead does not require the gradient to be known/exist; andopt_data
additional parameters passed to the function.opt_data
additional parameters passed to the function.settings
parameters controlling the optimization routine; see below.Optimization control parameters:
double err_tol
the value controlling how small $\| \nabla f \|$ should be before 'convergence' is declared.int iter_max
the maximum number of iterations/updates before the algorithm exits.bool vals_bound
whether the search space is bounded. If true, thenarma::vec lower_bounds
this defines the lower bounds.arma::vec upper_bounds
this defines the upper bounds.double nm_par_alpha
reflection parameter.double nm_par_gamma
expansion parameter.double nm_par_beta
contraction parameter.double nm_par_delta
shrikage parameter.Let $x^{(i)}$ denote the simplex values at stage $i$ of the algorithm. The Nelder-Mead updating rule is as follows.
nm_par_alpha
.
nm_par_gamma
.
nm_par_beta
.
nm_par_delta
. Go to Step 1.