LinearLSQFitter

class astropy.modeling.fitting.LinearLSQFitter[source] [edit on github]

Bases: object

A class performing a linear least square fitting.

Uses numpy.linalg.lstsq to do the fitting. Given a model and data, fits the model to the data and changes the model’s parameters. Keeps a dictionary of auxiliary fitting information.

Attributes Summary

supported_constraints

Methods Summary

__call__(model, x, y[, z]) Fit data to this model.

Attributes Documentation

supported_constraints = [u'fixed']

Methods Documentation

__call__(model, x, y, z=None, **kwargs)[source] [edit on github]

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.

rcond : float, optional

Cut-off ratio for small singular values of a. Singular values are set to zero if they are smaller than rcond times the largest singular value of a.

equivalencies : list 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_copy : FittableModel

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