SimplexLSQFitter

class astropy.modeling.fitting.SimplexLSQFitter[source]

Bases: astropy.modeling.fitting.Fitter

Simplex algorithm and least squares statistic.

Raises
ModelLinearityError

A linear model is passed to a nonlinear fitter

Attributes Summary

supported_constraints

Methods Summary

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

Fit data to this model.

objective_function(fps, *args)

Function to minimize.

Attributes Documentation

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

Methods Documentation

__call__(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

maxiterint

maximum number of iterations

accfloat

Relative error in approximate solution

equivalencieslist or None, optional, keyword-only

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

objective_function(fps, *args)

Function to minimize.

Parameters
fpslist

parameters returned by the fitter

argslist

[model, [other_args], [input coordinates]] other_args may include weights or any other quantities specific for a statistic

Notes

The list of arguments (args) is set in the __call__ method. Fitters may overwrite this method, e.g. when statistic functions require other arguments.