class JeffreysPrior( Prior ) | Source |
---|
Jeffreys prior distribution, for scale-like parameters.
Jeffreys prior is a improper prior ( i.e. its integral is unbound ).
Because of that it always needs limits, low and high, such that 0 < low < high < +Inf.
Pr( x ) = 1.0 / ( x * norm ) if ( low < x < high ) else 0
where norm = log( high ) - log( low )
No limits are set by default.
domain2unit:
u = ( log( d ) - log( lo ) ) / ( log( hi ) - log( lo ) );
unit2domain:
d = exp( u * ( log( hi ) - log( lo ) ) + log( lo ) );
Examples
pr = JeffreysPrior() # unbound prior
pr = JeffreysPrior( limits=[0.1,1.0] ) # limited to the range [0.1,1.0]
Hidden Attributes
- _logLo : float
log( lowLimit ) - _norm : float
log( highLimit / lowLimit )
Attributes from Prior
lowLimit, highLimit, deltaP, _lowDomain, _highDomain
The default of lowLimit and _lowDomain is zero.
JeffreysPrior( limits=None, prior=None ) |
---|
Default constructor.
Parameters
- limits : list of 2 floats
2 limits resp. low and high - prior : JeffreysPrior
prior to copy (with new limits if applicable)
copy( ) |
---|
getIntegral( ) |
---|
domain2Unit( dval ) |
---|
Parameters
- dval : float
value within the domain of a parameter
unit2Domain( uval ) |
---|
Parameters
- uval : float
value within [0,1]
result( x ) |
---|
Parameters
- x : float
value within the domain of a parameter
partialLog( p ) |
---|
Parameters
- p : 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( )
- getRange( )
- partialDomain2Unit( p )
- logResult( p )
- numPartialDomain2Unit( dval )
- numPartialLog( p )