leastsquare¶
-
astropy.modeling.statistic.leastsquare(measured_vals, updated_model, weights, x, y=None)[source] [edit on github]¶ Least square statistic with optional weights.
Parameters: measured_vals :
ndarrayMeasured data values.
updated_model :
ModelModel with parameters set by the current iteration of the optimizer.
weights :
ndarrayArray of weights to apply to each residual.
x :
ndarrayIndependent variable “x” to evaluate the model on.
y :
ndarray, optionalIndependent variable “y” to evaluate the model on, for 2D models.
Returns: res : float
The sum of least squares.