# FittingWithOutlierRemoval¶

class astropy.modeling.fitting.FittingWithOutlierRemoval(fitter, outlier_func, niter=3, **outlier_kwargs)[source] [edit on github]

Bases: object

This class combines an outlier removal technique with a fitting procedure. Basically, given a number of iterations niter, outliers are removed and fitting is performed for each iteration.

Parameters: fitter : An Astropy fitter An instance of any Astropy fitter, i.e., LinearLSQFitter, LevMarLSQFitter, SLSQPLSQFitter, SimplexLSQFitter, JointFitter. outlier_func : function A function for outlier removal. niter : int (optional) Number of iterations. outlier_kwargs : dict (optional) Keyword arguments for outlier_func.

Methods Summary

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

Methods Documentation

__call__(model, x, y, z=None, weights=None, **kwargs)[source] [edit on github]
Parameters: model : FittableModel An analytic model which will be fit to the provided data. This also contains the initial guess for an optimization algorithm. x : array-like Input coordinates. y : array-like Data measurements (1D case) or input coordinates (2D case). z : array-like (optional) Data measurements (2D case). weights : array-like (optional) Weights to be passed to the fitter. kwargs : dict (optional) Keyword arguments to be passed to the fitter. filtered_data : numpy.ma.core.MaskedArray Data used to perform the fitting after outlier removal. fitted_model : FittableModel Fitted model after outlier removal.