This class defines a fit theory, which consists of:
The function must have the signature f(x, *params), where x is an array of values for the independent variable, and params are the parameters to be fitted.
The number of parameters must be the same as in parameters, or a multiple of this number if the function is defined as a sum of a variable number of base functions and if estimate is designed to be able to estimate the number of needed base functions.
List of parameters names.
This list can contain the minimum number of parameters, if the function takes a variable number of parameters, and if the estimation function is responsible for finding the number of required parameters
The estimation function should have the following signature:
f(x, y) -> (estimated_param, constraints)
Parameters:
- x is a sequence of values for the independent variable
- y is a sequence of the same length as x containing the data to be fitted
Return values:
- estimated_param is a sequence of estimated fit parameters to be used as initial values for an iterative fit.
- constraints is a sequence of shape (n, 3), where n is the number of estimated parameters, containing the constraints for each parameter to be fitted. See silx.math.fit.leastsq() for more explanations about constraints.
The optional configuration function must conform to the signature f(**kw) -> dict (i.e it must accept any named argument and return a dictionary). It can be used to modify configuration parameters to alter the behavior of the fit function and the estimation function.
The optional derivative function must conform to the signature model_deriv(xdata, parameters, index), where parameters is a sequence with the current values of the fitting parameters, index is the fitting parameter index for which the the derivative has to be provided in the supplied array of xdata points.
Optional configuration dialog widget that can allow users to modify the fit and estimation configuration.
This widget must store the modified configuration parameters in a dictionary attribute output.
The widget must define, or inherit from qt.QDialog, following methods which are executed in that order:
- show()
- exec_()
- result(): must return True if the new configuration in config_widget.output is to be accepted, False if it is to be rejected / ignored (e.g. if the user clicked a Cancel button)
Optional description string for this particular fit theory.
This attribute can be set to True to indicate that the theory is a PyMca legacy theory.
This tells silx.math.fit.fitmanager that the signature of the estimate function is:
f(x, y, bg, xscaling, yscaling) -> (estimated_param, constraints)