SLSQPLSQFitter

class astropy.modeling.fitting.SLSQPLSQFitter[source]

Bases: astropy.modeling.fitting.Fitter

SLSQP optimization algorithm and least squares statistic.

Raises
ModelLinearityError

A linear model is passed to a nonlinear fitter

Attributes Summary

supported_constraints

Methods Summary

__call__(self, model, x, y[, z, weights])

Fit data to this model.

Attributes Documentation

supported_constraints = ['bounds', 'eqcons', 'ineqcons', 'fixed', 'tied']

Methods Documentation

__call__(self, model, x, y, z=None, weights=None, **kwargs)[source]

Fit data to this model.

Parameters
modelFittableModel

model to fit to x, y, z

xarray

input coordinates

yarray

input coordinates

zarray (optional)

input coordinates

weightsarray (optional)

Weights for fitting. For data with Gaussian uncertainties, the weights should be 1/sigma.

kwargsdict

optional keyword arguments to be passed to the optimizer or the statistic

verblevelint

0-silent 1-print summary upon completion, 2-print summary after each iteration

maxiterint

maximum number of iterations

epsilonfloat

the step size for finite-difference derivative estimates

accfloat

Requested accuracy

equivalencieslist or None, optional and keyword-only argument

List of additional equivalencies that are should be applied in case x, y and/or z have units. Default is None.

Returns
model_copyFittableModel

a copy of the input model with parameters set by the fitter