MaxLikelihoodFitter = class MaxLikelihoodFitter(IterativeFitter) |
|
MaxLikelihoodFitter(xdata, model, errdis=None, scale=None, power=2.0, **kwargs)
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. |
|
- Method resolution order:
- MaxLikelihoodFitter
- IterativeFitter
- BaseFitter
- builtins.object
Constructor:
- 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
Methods defined here:
- getLogLikelihood( autoscale=False, var=1.0)
- Return the log likelihood.
It is implementing eq 19/20 last parts (Kester 2002) term by term
Parameters
----------
autoscale : bool
whether the noise scale is optimized too
var : float
variance
- getScale()
- Return the stdev of the noise.
- makeFuncs( data, weights=None, index=None, ret=3)
- Make connection to the desired func, gradient and hessian.
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)
- normalize( normdfdp, normdata, weight=1.0)
- Not Implemented.
Raises
------
NotImplementedError.
the method is not implemented for MaxLikelihoodFitters
- testGradient( par, at, data, weights=None )
- returns true if the test fails.
Methods inherited from IterativeFitter:
- doPlot( param, force=False )
- fit( ydata, weights=None, keep=None, **kwargs )
- fitprolog( ydata, weights=None, accuracy=None, keep=None )
- report( verbose, param, chi, more=None, force=False )
- setParameters( params )
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 )
- getLogZ( limits=None, noiseLimits=None )
- 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 )
- plotResult( xdata=None, ydata=None, model=None, residuals=True, confidence=False, show=True )
- setMinimumScale( scale=0)
|
|