class MaxLikelihoodFitter( IterativeFitter ) | Source |
---|
Base class with methods common to fitters handling ErrorDistributions.
Author: Do Kester.
Attributes
- errdis : None | "gauss" | "laplace" | "cauchy" | "poisson" |
"uniform" | "exponential"
None : Use _ChiSq as function to be minimized
name : use -logLikelihood as function to be minimized from the named
errordistribution. - scale : float
the (fixed) noise scale - power : float
power of errdis (if applicable)
Raises
ConvergenceError Something went wrong during the convergence if the fit.
MaxLikelihoodFitter( xdata, model, errdis=None, scale=None, power=2.0, **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 -
errdis : None | "gauss" | "laplace" | "cauchy" | "poisson" |
"uniform" | "exponential"
None : Use _ChiSq as function to be minimized
name : use -logLikelihood as function to be minimized from the named
errordistribution. -
scale : float
the (fixed) noise scale of errdis (if applicable) -
power : float (2.0)
the power of errdis ( if applicable) -
kwargs : dict
Possibly includes keywords from
IterativeFitter : maxIter, tolerance, verbose
BaseFitter : map, keep, fixedScale
makeFuncs( data, weights=None, index=None, ret=3 ) |
---|
Parameters
- data : array_like
the data to be fitted - weights : array_like or None
weights on the data - index : array_like
indices of the parameters to be fitted. - ret : 1 or 2 or 3
return (func), (func,dfunc) or (func,dfunc,hess)
getScale( ) |
---|
getLogLikelihood( autoscale=False, var=1.0 ) |
---|
normalize( normdfdp, normdata, weight=1.0 ) |
---|
Raises
NotImplementedError. the method is not implemented for MaxLikelihoodFitters
testGradient( par, at, data, weights=None ) |
---|
Methods inherited from IterativeFitter |
---|
- setParameters( params )
- doPlot( param, force=False )
- fitprolog( ydata, weights=None, accuracy=None, keep=None )
- fit( ydata, weights=None, keep=None, **kwargs )
- report( verbose, param, chi, more=None, force=False )
Methods inherited from BaseFitter |
---|
- setMinimumScale( scale=0 )
- fitpostscript( ydata, plot=False )
- keepFixed( keep=None )
- insertParameters( fitpar, index=None, into=None )
- modelFit( ydata, weights=None, keep=None )
- limitsFit( ydata, weights=None, keep=None )
- checkNan( ydata, weights=None, accuracy=None )
- getVector( ydata, index=None )
- getHessian( params=None, weights=None, index=None )
- getInverseHessian( params=None, weights=None, index=None )
- getCovarianceMatrix( )
- makeVariance( scale=None )
- getDesign( params=None, xdata=None, index=None )
- chiSquared( ydata, params=None, weights=None )
- getStandardDeviations( )
- monteCarloError( xdata=None, monteCarlo=None)
- getEvidence( limits=None, noiseLimits=None )
- getLogZ( limits=None, noiseLimits=None )
- plotResult( xdata=None, ydata=None, model=None, residuals=True,