nelder_mead, a MATLAB code which seeks the minimizer of a scalar function of several variables, by Jeff Borggaard.
The algorithm is easy to visualize. The user supplies an initial set of points that represent solution estimates. The number of points supplied is one greater than the spatial dimension, so they form a "simplex" - in 2D, this is simply a triangle. The algorithm then evaluates the function at each point on the simplex, and then considers various ways of seeking a better estimate, including replacing one vertex of the simplex by its reflected image, or by shrinking or expanding the simplex. An animation of the procedure looks almost like a little triangular creature trying to blindly feel its way downhill.
Although the user specifies an initial simplex of starting values, the algorithm is not constrained to search only within that simplex. This means that the user cannot force the algorithm to search only within a restricted region.
x_opt = nelder_mead ( simplex, f, flag )where
Very simple functions can be input as a quoted string. Thus, one could specify the f argument as '(x(1)-2*x(2)+7)^2'; However, for more complicated functions it makes sense to prepare an M-file that defines the function. For this same example, a suitable M-file would be:
function f = example ( x )
f = ( x(1) - 2 * x(2) + 7 )^2;
If this information was stored in an M-file called example.m, then one might invoke the optimization program with a command like
x_opt = nelder_mead ( x_init, @example, 0 )
MATLAB's built in command fminsearch minimizes a scalar function of several variables using the Nelder-Mead algorithm.
The computer code and data files described and made available on this web page are distributed under the MIT license
nelder_mead is available in a MATLAB version.
asa047, a MATLAB code which minimizes a scalar function of several variables using the Nelder-Mead algorithm.
compass_search, a MATLAB code which seeks the minimizer of a scalar function of several variables using compass search, a direct search algorithm that does not use derivatives.
nelder_mead, a MATLAB code which minimizes a scalar function of several variables using the Nelder-Mead algorithm, by Jeff Borggaard.
polynomials, a MATLAB code which defines multivariate polynomials over rectangular domains, for which certain information is to be determined, such as the maximum and minimum values.
praxis, a MATLAB code which implements the principal axis method for minimization of a function without the use of derivatives, by Richard Brent.
test_opt, a MATLAB code which defines test problems requiring the minimization of a scalar function of several variables.
toms178, a MATLAB code which optimizes a scalar functional of multiple variables using the Hooke-Jeeves method.
Jeff Borggaard, Mathematics Department, Virginia Tech.