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 meth argument is not recognized.

See also

get_method_name

Return the name of the current optimization method.

list_methods

List the supported optimization methods.

set_stat

Set the fit statistic.

Notes

The available methods include:

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

Examples

>>> set_method('neldermead')