Navigation
class CauchyPrior( Prior ) | Source |
---|
Cauchy prior distribution.
Pr( x ) = s / ( π * ( s2 + ( x - c )2 )
By default: c = center = 0 and s = scale = 1.
It can also have a limited domain. By default the domain is [-Inf,+Inf]. In computational practice it is limited to [-1e16, 1e16]
domain2unit:
u = arctan( ( d - c ) / s ) / π + 0.5
unit2domain:
d = tan( ( u - 0.5 ) * π ) * s + c
Examples
pr = CauchyPrior() # center=0, scale=1
pr = CauchyPrior( center=1.0, scale=0.5 )
pr = CauchyPrior( limits=[0,None] ) # lowlimit=0, highlimit=inf
pr = CauchyPrior( center=1, circular=3 ) # circular between 0.5 and 2.5
Attributes
- center : float
center of the Cauchy prior - scale : float
scale of the Cauchy prior
Attributes from Prior
lowLimit, highLimit, deltaP, _lowDomain, _highDomain
CauchyPrior( center=0.0, scale=1, limits=None, circular=False, prior=None ) |
---|
Constructor.
Parameters
- center : float
of the prior - scale : float
of the prior - 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 : CauchyPrior
prior to copy (with new scale if applicable)
copy( ) |
---|
domain2Unit( dval ) |
---|
u = arctan( ( d - c ) / s ) / π + 0.5
Parameters
- dval : float
value within the domain of a parameter
unit2Domain( uval ) |
---|
d = tan( ( u - 0.5 ) * π ) * s + c
Parameters
- uval : float
value within [0,1]
result( 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 )
- logResult( p )
- numPartialDomain2Unit( dval )
- numPartialLog( p )