set_method¶
- sherpa.astro.ui.set_method(meth)¶
Set the optimization method.
The primary task of Sherpa is to fit a model M(p) to a set of observed data, where the vector p denotes the model parameters. An optimization method is one that is used to determine the vector of model parameter values, p0, for which the chosen fit statistic is minimized.
- Parameters
meth (str) – The name of the method (case is not important). The list_methods function returns the list of supported values.
- Raises
sherpa.utils.err.ArgumentErr – If the
methargument is not recognized.
See also
get_method_nameReturn the name of the current optimization method.
list_methodsList the supported optimization methods.
set_statSet the fit statistic.
Notes
The available methods include:
levmarThe Levenberg-Marquardt method is an interface to the MINPACK subroutine lmdif to find the local minimum of nonlinear least squares functions of several variables by a modification of the Levenberg-Marquardt algorithm 1.
moncarThe implementation of the moncar method is based on 2.
neldermeadThe implementation of the Nelder Mead Simplex direct search is based on 3.
simplexThis is another name for
neldermead.
References
- 1
J.J. More, “The Levenberg Marquardt algorithm: implementation and theory,” in Lecture Notes in Mathematics 630: Numerical Analysis, G.A. Watson (Ed.), Springer-Verlag: Berlin, 1978, pp.105-116.
- 2
Storn, R. and Price, K. “Differential Evolution: A Simple and Efficient Adaptive Scheme for Global Optimization over Continuous Spaces.” J. Global Optimization 11, 341-359, 1997.
- 3
Jeffrey C. Lagarias, James A. Reeds, Margaret H. Wright, Paul E. Wright “Convergence Properties of the Nelder-Mead Simplex Algorithm in Low Dimensions”, SIAM Journal on Optimization,Vol. 9, No. 1 (1998), pages 112-147.
Examples
>>> set_method('neldermead')