IterativeFitter = class IterativeFitter(BaseFitter) |
|
IterativeFitter(xdata, model, maxIter=None, tolerance=0.0001, verbose=1, **kwargs)
Base class with methods common to all iterative fitters.
Author: Do Kester.
Attributes
----------
tolerance : float
When absolute and relative steps in subsequent chisq steps are less than
tolerance, the fitter stops. Default = 0.0001
maxIter : int
When the number of iterations gets larger than maxiter the fitter
stops with a ConvergenceError Default = 1000 * nparams
iter : int (read only)
iteration counter
ntrans : int (read only)
number of transforms
verbose : int
information per iteration.
0 : silent
1 : base information (default)
2 : report about every 100th iteration
3 : report about every ietration
tooLarge : int
When the length parameter array is too large to make a Hessian.
To avert OutOfMemory. Default = 100
plotter : Plotter
Iteration plotter class. Default = IterationPlotter
plotIter : int
Produce a plot for every plotIter-th iteration.
Default = 0 (no plotting)
Raises
------
ConvergenceError Something went wrong during the convergence if the fit. |
|
- Method resolution order:
- IterativeFitter
- BaseFitter
- builtins.object
Constructor:
- IterativeFitter( xdata, model, maxIter=None, tolerance=0.0001, verbose=1, **kwargs )
- Create a new iterative fitter, providing xdatas and model.
This is a base class. It collects stuff common to all iterative fitters.
It does not work by itself.
Parameters
----------
xdata : array_like
array of independent input values
model : Model
the model function to be fitted
tolerance : float
When absolute and relative steps in subsequent chisq steps are less than
tolerance, the fitter stops. Default = 0.01
maxIter : None or int
When the number of iterations gets larger than maxiter the fitter
stops with a ConvergenceError Default = 1000 * nparams
verbose : int
0 : silent
1 : report result
2 : report every 100th iteration
3 : report every iteration
kwargs for BaseFitter
map, keep, fixedScale
Methods defined here:
- doPlot( param, force=False )
- Plot intermediate result.
Parameters
----------
param : array_like
of the model
force : bool
do the plot
- fit( ydata, weights=None, keep=None, **kwargs )
- Return model parameters fitted to the data.
It will calculate the hessian matrix and chisq.
Parameters
----------
ydata : array_like
the data vector to be fitted
weights : array_like
weights pertaining to the data
keep : dict of {int:float}
dictionary of indices (int) to be kept at a fixed value (float)
kwargs :
passed to the fitter
Raises
------
ConvergenceError if it stops when the tolerance has not yet been reached.
- fitprolog( ydata, weights=None, accuracy=None, keep=None )
- Prolog for all iterative Fitters.
1. Sets up plotting (if requested)
2. Sets self.iter and self.ntrans to 0
3. Checks data/weighs for Nans
4. Makes fitIndex.
Parameters
----------
ydata : array_like
the data vector to be fitted
weights : array_like
weights pertaining to the data
accuracy : float or array_like
accuracy of (individual) data
keep : dict of {int:float}
dictionary of indices (int) to be kept at a fixed value (float)
Returns
-------
fitIndex : ndarray of int
Indices of the parameters that need fitting
- report( verbose, param, chi, more=None, force=False )
- Report on intermediate results.
- setParameters( params )
- Initialize the parameters of the model
A little superfluous: see {link Model#setParameters}
Parameters
----------
params : array_like
initial parameters
Methods inherited from BaseFitter:
- checkNan( ydata, weights=None, accuracy=None )
- chiSquared( ydata, params=None, weights=None )
- fitpostscript( ydata, plot=False )
- getCovarianceMatrix()
- getDesign( params=None, xdata=None, index=None )
- getEvidence( limits=None, noiseLimits=None )
- getHessian( params=None, weights=None, index=None )
- getInverseHessian( params=None, weights=None, index=None )
- getLogLikelihood( autoscale=False, var=1.0)
- getLogZ( limits=None, noiseLimits=None )
- getScale()
- getStandardDeviations()
- getVector( ydata, index=None )
- insertParameters( fitpar, index=None, into=None )
- keepFixed( keep=None )
- limitsFit( fitmethod, ydata, weights=None, keep=None )
- makeVariance( scale=None )
- modelFit( ydata, weights=None, keep=None )
- monteCarloError( xdata=None, monteCarlo=None )
- normalize( normdfdp, normdata, weight=1.0)
- plotResult( xdata=None, ydata=None, model=None, residuals=True, confidence=False, show=True )
- setMinimumScale( scale=0)
|
|