SLSQPLSQFitter#
- class astropy.modeling.fitting.SLSQPLSQFitter[source]#
Bases:
FitterSequential Least Squares Programming (SLSQP) optimization algorithm and least squares statistic.
- Raises:
ModelLinearityErrorA linear model is passed to a nonlinear fitter
Notes
See also the
SLSQPoptimizer.Attributes Summary
Methods Summary
__call__(model, x, y[, z, weights, inplace])Fit data to this model.
objective_function(fps, *args)Function to minimize.
Attributes Documentation
- supported_constraints = ['bounds', 'eqcons', 'ineqcons', 'fixed', 'tied']#
Methods Documentation
- __call__(model, x, y, z=None, weights=None, *, inplace=False, **kwargs)[source]#
Fit data to this model.
- Parameters:
- model
FittableModel model to fit to x, y, z
- x
array input coordinates
- y
array input coordinates
- z
array, optional input coordinates
- weights
array, optional Weights for fitting. For data with Gaussian uncertainties, the weights should be 1/sigma.
- inplacebool, optional
If
False(the default), a copy of the model with the fitted parameters set will be returned. IfTrue, the returned model will be the same instance as the model passed in, and the parameter values will be changed inplace.- kwargs
dict optional keyword arguments to be passed to the optimizer or the statistic
- verblevel
int 0-silent 1-print summary upon completion, 2-print summary after each iteration
- maxiter
int maximum number of iterations
- epsilon
float the step size for finite-difference derivative estimates
- acc
float Requested accuracy
- equivalencies
listorNone, optional, keyword-only List of additional equivalencies that are should be applied in case x, y and/or z have units. Default is None.
- model
- Returns:
- fitted_model
FittableModel If
inplaceisFalse(the default), this is a copy of the input model with parameters set by the fitter. IfinplaceisTrue, this is the same model as the input model, with parameters updated to be those set by the fitter.
- fitted_model