77model's parameters attribute. The idea is to make this extensible and allow
88users to easily add other fitters.
99
10- Linear fitting is done using Numpy's `~ numpy.linalg.lstsq` function.
11- There are currently two non-linear fitters which use `~ scipy.optimize.leastsq` and
12- `~ scipy.optimize.slsqp ` functions in scipy.optimize. \
10+ Linear fitting is done using the ` numpy.linalg.lstsq` function.
11+ There are currently two non-linear fitters which use `scipy.optimize.leastsq` and
12+ `scipy.optimize.fmin_slsqp ` functions from ` scipy.optimize`.
1313"""
1414
1515from __future__ import (absolute_import , unicode_literals , division ,
@@ -163,7 +163,8 @@ class LinearLSQFitter(Fitter):
163163
164164 Parameters
165165 ----------
166- model : an instance of `~astropy.modeling.core.ParametricModel`
166+ model : `~astropy.modeling.core.ParametricModel`
167+ The model.
167168
168169 Raises
169170 ------
@@ -349,16 +350,6 @@ class NonLinearLSQFitter(Fitter):
349350 """
350351 A class performing non-linear least squares fitting using the
351352 Levenberg-Marquardt algorithm implemented in `scipy.optimize.leastsq`.
352-
353- Parameters
354- ----------
355- model : a fittable `~astropy.modeling.core.ParametricModel`
356- model to fit to data
357-
358- Raises
359- ------
360- ModelLinearityError
361- A linear model is passed to a nonlinear fitter
362353 """
363354
364355 supported_constraints = ['fixed' , 'tied' , 'bounds' ]
@@ -377,6 +368,16 @@ def __init__(self):
377368 super (NonLinearLSQFitter , self ).__init__ ()
378369
379370 def errorfunc (self , fps , * args ):
371+ """
372+ Compute the sum of the squared residuals.
373+
374+ Parameters
375+ ----------
376+ fps : list
377+ parameters returned by the fitter
378+ args : list
379+ input coordinates
380+ """
380381 model = args [0 ]
381382 self ._fitter_to_model_params (model , fps )
382383 meas = args [- 1 ]
@@ -443,6 +444,11 @@ def __call__(self, model, x, y, z=None, weights=None,
443444 ------
444445 model_copy : `ParametricModel`
445446 a copy of the input model with parameters set by the fitter
447+
448+ Raises
449+ ------
450+ ModelLinearityError
451+ A linear model is passed to a nonlinear fitter
446452 """
447453 if isinstance (model , _CompositeModel ):
448454 raise NotImplementedError ("Fitting of composite models is not implemented in astropy v.0.3." )
@@ -529,11 +535,6 @@ class SLSQPFitter(Fitter):
529535 parameters, as well as bounded constraints. Uses
530536 `scipy.optimize.fmin_slsqp`.
531537
532- Raises
533- ------
534- ModelLinearityError
535- A linear model is passed to a nonlinear fitter
536-
537538 References
538539 ----------
539540 .. [1] http://www.netlib.org/toms/733
@@ -552,7 +553,7 @@ def __init__(self):
552553
553554 def errorfunc (self , fps , * args ):
554555 """
555- Compute the sum of the squared residuals
556+ Compute the sum of the squared residuals.
556557
557558 Parameters
558559 ----------
@@ -601,6 +602,11 @@ def __call__(self, model, x, y, z=None, weights=None, verblevel=0,
601602 ------
602603 model_copy : `ParametricModel`
603604 a copy of the input model with parameters set by the fitter
605+
606+ Raises
607+ ------
608+ ModelLinearityError
609+ A linear model is passed to a nonlinear fitter
604610 """
605611 if isinstance (model , _CompositeModel ):
606612 raise NotImplementedError ("Fitting of composite models is not implemented in astropy v.0.3." )
0 commit comments