Last modified: December 2025

URL: https://cxc.cfa.harvard.edu/sherpa/ahelp/set_method.html
AHELP for CIAO 4.18 Sherpa

set_method

Context: methods

Synopsis

Set the optimization method.

Syntax

set_method(meth: OptMethod | str)

No return value.

Description

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.


Example

>>> set_method('neldermead')

PARAMETERS

The parameter for this function is:

Parameter Type information Definition
meth str The name of the method (case is not important). The `list_methods` function returns the list of supported values.

Notes

The available methods include:

Item Definition
levmar The 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].
moncar The implementation of the moncar method is based on [2].
neldermead The implementation of the Nelder Mead Simplex direct search is based on [3].
simplex This is another name for neldermead .

References

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.

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.

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.


Bugs

See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

See Also

confidence
set_conf_opt, set_covar_opt, set_proj_opt
data
set_areascal, set_arf, set_backscal, set_bkg, set_coord, set_counts, set_data, set_dep, set_exposure, set_grouping, set_quality, set_rmf, set_staterror, set_syserror
filtering
set_filter
methods
gridsearch, levmar, list_iter_methods, list_methods, moncar, neldermead, set_iter_method, set_iter_method_opt, set_method_opt
modeling
get_par, set_bkg_model, set_bkg_source, set_full_model, set_model, set_par, set_pileup_model, set_source
statistics
set_prior, set_sampler, set_sampler_opt, set_stat
utilities
set_analysis, set_default_id
visualization
image_setregion