GaussErrorDistribution

 
GaussErrorDistribution = class GaussErrorDistribution(ScaledErrorDistribution)
    GaussErrorDistribution(scale=1.0, limits=None, copy=None)
 
To calculate a Gauss likelihood.
 
For one residual, x, it holds
 
    L( x ) = 1 / &sqrt;( 2 π s^2 ) exp( - 0.5 ( x / s )^2 )
 
where s is the scale.
s is a hyperparameter, which might be estimated from the data.
 
The scale s is also the square root of the variance of this error distribution.
 
The function is mostly used to calculate the likelihood L over N residuals,
or easier to use log likelihood, logL.
 
    logL = log( N / ( sqrt( 2 π ) s )  ) - 0.5 ∑( x / s ) ^ 2
 
Using weights this becomes:
 
    logL = log( ∑( w ) / ( sqrt( 2 π ) s )  ) - 0.5 ∑( w ( x / s ) ^ 2 )
 
 
Author       Do Kester.
 
 
Method resolution order:
GaussErrorDistribution
ScaledErrorDistribution
ErrorDistribution
builtins.object

Constructor:
GaussErrorDistribution( scale=1.0, limits=None, copy=None )
Default 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 : GaussErrorDistribution
    distribution to be copied.
Methods defined here:
acceptWeight()
True if the distribution accepts weights.
Always true for this distribution.
copy()
Return copy of this.
getScale( problem, allpars=None )
Return the noise scale.
 
Parameters
----------
problem : Problem
    to be solved
allpars : array_like
    None take parameters from problem.model
    list of all parameters in the problem
hessianLogL( problem, allpars, fitIndex )
Return the hessian of log( likelihood ) to the parameters in fitIndex.
 
The hessian is a matrix containing the second derivatives to each
of the parameters.
 
     hessian = d^2 logL / dp_i dp_k
 
Parameters
----------
problem : Problem
    to be solved
allpars : array_like
    (hyper)parameters of the problem
fitIndex : array_like of int
    indices of allpars to fit
logLdata( problem, allpars, mockdata=None )
Return the log( likelihood ) for each residual
 
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
logLikelihood_alt( problem, allpars )
Return the log( likelihood ) for a Gaussian distribution.
 
Alternate calculation
 
Parameters
----------
problem : Problem
    to be solved
allpars : array_like
    list of all parameters in the problem
nextPartialData( problem, allpars, fitIndex, mockdata=None )
Return the partial derivative all elements of the log( likelihood )
to the parameters in fitIndex.
 
Parameters
----------
problem : Problem
    to be solved
allpars : array_like
    (hyper)parameters of the problem
fitIndex : array_like of int
    indices of allpars to fit
mockdata : array_like
    as calculated for the problem
partialLogL_alt( problem, allpars, fitIndex )
Return the partial derivative of log( likelihood ) to the parameters in fitIndex.
 
Alternate calculation
 
Parameters
----------
problem : Problem
    to be solved.
allpars : array_like
    (hyper)parameters of the problem
fitIndex : array_like
    indices of parameters to be fitted

Methods inherited from ScaledErrorDistribution:
Methods inherited from ErrorDistribution: