COMPASS_SEARCH is a MATLAB library which seeks the minimizer of a scalar function of several variables using compass search, a direct search algorithm that does not use derivatives.
The algorithm, which goes back to Fermi and Metropolis, is easy to describe. The algorithm begins with a starting point X, and a step size DELTA.
For each dimension I, the algorithm considers perturbing X(I) by adding or subtracting DELTA.
If a perturbation is found which decreases the function, this becomes the new X. Otherwise DELTA is halved.
The iteration halts when DELTA reaches a minimal value.
The algorithm is not guaranteed to find a global minimum. It can, for instance, easily be attracted to a local minimum. Moreover, the algorithm can diverge if, for instance, the function decreases as the argument goes to infinity.
[ x, fx, k ] = compass_search ( @f, m, x, delta_tol, delta, k_max )where
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
COMPASS_SEARCH is available in a C version and a C++ version and a FORTRAN77 version and a FORTRAN90 version and a MATLAB version and a Python version.
ASA047, a MATLAB library which minimizes a scalar function of several variables using the Nelder-Mead algorithm.
ENTRUST, a MATLAB program which minimizes a scalar function of several variables using trust-region methods.
NELDER_MEAD, a MATLAB program which minimizes a scalar function of several variables using the Nelder-Mead algorithm.
PRAXIS, a MATLAB library which minimizes a scalar function of several variables, without requiring derivative information, by Richard Brent.
TEST_OPT, a MATLAB library which defines test problems requiring the minimization of a scalar function of several variables.
TOMS178, a MATLAB library which optimizes a scalar functional of multiple variables using the Hooke-Jeeves method.
COMPASS_SEARCH_TEST calls all the tests.
BEALE is the Beale function, for which M=2.
BOHACH1 is the Bohachevsky function #1, for which M=2.
BOHACH2 is the Bohachevsky function #2, for which M=2.
BROYDEN is the two dimensional modified Broyden function, for which M=2.
EXTENDED_ROSENBROCK is the "extended" Rosenbrock function. This version of the Rosenbrock function allows the spatial dimension M to be arbitrary, except that it must be even.
GOLDSTEIN_PRICE is the Goldstein-Price polynomial, for which M=2.
HIMMELBLAU is the Himmelblau function, for which M = 2, and which has four global minima.
LOCAL is a badly scaled function with a local minimum, for which M=2.
MCKINNON is the McKinnon function, for which M=2. This function can cause problems for the Nelder-Mead optimization algorithm.
POWELL is the Powell singular quartic function, for which M = 4.
ROSENBROCK is the Rosenbrock "banana" function, for which M = 2.
You can go up one level to the MATLAB source codes.