Package PyDSTool :: Module common :: Class fit_function
[hide private]
[frames] | no frames]

Class fit_function

source code

object --+
         |
        fit_function
Known Subclasses:

Abstract super-class for fitting explicit functions to 1D arrays of data
using least squares.

xs -- independent variable data
ys -- dependent variable data
pars_ic -- initial values defining the function

Optional algorithmic parameters to minpack.leastsq can be passed in the
algpars argument: e.g.,
ftol -- Relative error desired in the sum of squares (default 1e-6).
xtol -- Relative error desired in the approximate solution (default 1e-6).
gtol -- Orthogonality desired between the function vector
        and the columns of the Jacobian (default 1e-8).

Other parameters may be used for concrete sub-classes. Pass these as a dict
or args object in the opts argument.

Returns an args object with attributes:

ys_fit --   the fitted y values corresponding to the given x data,
pars_fit -- the function parameters at the fit
info --     diagnostic feedback from the leastsq algorithm
results --  dictionary of other function specific information (such as peak
             position)

Instance Methods [hide private]
 
__init__(self, pars_ic=None, algpars=None, opts=None, verbose=False)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
fn(self, x, *pars) source code
 
_do_fit(self, constraint, xs, ys, pars_ic) source code
 
fit(self, xs, ys, pars_ic=None, opts=None) source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, pars_ic=None, algpars=None, opts=None, verbose=False)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)