class GaussPrior( Prior ) | Source |
---|
Gauss prior distribution. Use normalized version
Pr( x ) = 1 / √( 2 π s2 ) exp( - 0.5 * ( ( x - c ) / s )2 )
By default:
c = center = 0
s = scale = 1.
By default the domain is [-Inf,+Inf]. In computational practice the domain is limited to about [-8.5, 8.5] scale units. Outside that range the Gaussian is indistinguishable from 0, computationally.
It can also have a limited domain.
According to integral-calculator.com we have
domain2unit:
u = 0.5 * ( erf( ( d - c ) / ( s * √2 ) ) + 1 )
unit2domain:
d = erfinv( 2 * u - 1 ) * s * √2 + c
Examples
pr = GaussPrior() # center=0, scale=1
pr = GaussPrior( center=1.0, scale=0.5 )
pr = GaussPrior( limits=[0,None] ) # limited to values >= 0
pr = GaussPrior( center=1, circular=3 ) # circular between 0.5 and 2.5
Attributes
- center : float
center of the Gaussian prior - scale : float
scale of the Gaussian prior
Attributes from Prior
lowLimit, highLimit, circular, deltaP, _lowDomain, _highDomain
GaussPrior( center=0.0, scale=1.0, limits=None, circular=False, prior=None ) |
---|
Constructor.
Parameters
- center : float
of the location of the prior - scale : float
of the exponential - limits : None or [float,float]
None no limits are set
2 floats lowlimit and highlimit - circular : bool or float
bool : y|n circular with period from limits[0] to limits[1]
float : period of circularity - prior : GaussPrior
prior to copy (with new scale if applicable)
copy( ) |
---|
domain2Unit( dval ) |
---|
u = 0.5 * ( erf( ( d - center ) / ( √2 * scale ( ) + 1 )
Parameters
- dval : float or array_like
value(s) within the domain of a parameter
unit2Domain( uval ) |
---|
d = erfinv( 2 * u - 1 ) * scale * √2 + center
Parameters
- uval : float or array_like
value(s) within [0,1]
result( x ) |
---|
Parameters
- x : float or array_like
value within the domain of a parameter
logResult( x ) |
---|
Parameters
- x : float
value within the domain of a parameter
partialLog( x ) |
---|
Parameters
- x : float
the value
isBound( ) |
---|
Return true if the integral over the prior is bound.
shortName( ) |
---|
Return a string representation of the prior.
Methods inherited from Prior |
---|
- limitedIntegral( center=0, circular=False, limits=None )
- setLimits( limits=None )
- setPriorAttributes( limits, circular )
- isCircular( )
- limitedDomain2Unit( dval )
- limitedUnit2Domain( uval )
- circularDomain2Unit( dval )
- circularUnit2Domain( uval )
- unsetLimits( )
- setAttributes( limits=None, scale=None )
- isOutOfLimits( par )
- checkLimit( par )
- stayInLimits( par )
- hasLowLimit( )
- hasHighLimit( )
- hasLimits( )
- getLimits( )
- getIntegral( )
- getRange( )
- partialDomain2Unit( p )
- numPartialDomain2Unit( dval )
- numPartialLog( p )