Navigation
| class CauchyErrorDistribution( ScaledErrorDistribution ) | Source |
|---|
To calculate a Cauchy or Lorentz likelihood.
f( x ) = s / ( π * ( s2 + x2 ) )
where x = residual and s = scale
The function is mostly used to calculate the likelihood L, or easier to use log likelihood, logL.
logL = N ( log( s ) - log( π ) ) - ∑( log( x2 + s2 ) )
Weights are not possible in this error distribution. They are silently ignored.
s is a hyperparameter, which might be estimated from the data.
Author Do Kester.
| CauchyErrorDistribution( scale=1.0, limits=None, copy=None ) |
|---|
Constructor.
Parameters
- scale : float
noise scale - limits : None or list of 2 floats [low,high]
None : no limits implying fixed scale
low low limit on scale (needs to be >0)
high high limit on scale
when limits are set, the scale is not fixed. - copy : CauchyErrorDistribution
distribution to be copied.
| copy( ) |
|---|
| acceptWeight( ) |
|---|
| getScale( problem, allpars=None ) |
|---|
Parameters
- problem : Problem
to be solved - allpars : array_like
None take parameters from problem.model
list of all parameters in the problem
| funct( scale ) |
|---|
| logLikelihood_alt( problem, allpars ) |
|---|
Cauchy distr : f( x ) = s / ( π * ( s2 + x2 ) )
where x = residual and s = scale
Alternate calculation
Parameters
- problem : Problem
to be solved - allpars : array_like
list of all parameters in the problem
| logLdata( problem, allpars, mockdata=None ) |
|---|
logL = sum( logLdata )
Parameters
- problem : Problem
to be solved - allpars : array_like
list of all parameters in the problem - mockdata : array_like
as calculated by the model
| partialLogL_alt( problem, allpars, fitIndex ) |
|---|
Alternate calculation
dL/ds is not implemented for problems with accuracy
Parameters
- problem : Problem
to be solved - allpars : array_like
parameters of the problem - fitIndex : array_like
indices of parameters to be fitted
| nextPartialData( problem, allpars, fitIndex, mockdata=None ) |
|---|
dL/ds is not implemented for problems with accuracy
Parameters
- problem : Problem
to be solved - allpars : array_like
parameters of the problem - fitIndex : array_like
indices of parameters to be fitted - mockdata : array_like
as calculated by the model
| Methods inherited from ScaledErrorDistribution |
|---|
| Methods inherited from ErrorDistribution |
|---|
- getGaussianScale( problem, allpars=None )
- getResiduals( problem, allpars=None )
- getChisq( problem, allpars=None )
- toSigma( scale )
- isBound( )
- keepFixed( fixed=None )
- setPriors( priors )
- domain2Unit( dval, ks )
- unit2Domain( uval, ks )
- logCLhood( problem, allpars )
- logLhood( problem, allpars )
- partialLogL( problem, allpars, fitIndex )
- numPartialLogL( problem, allpars, fitIndex )
- updateLogL( problem, allpars, parval=None )
- setResult( )
- hyparname( k )