BayesicFitting

Model Fitting and Evidence Calculation

View project on GitHub



class UniformRatioPrior( Prior )[source]

Distribution of the ratio of two uniform distributed, positive variables.

A uniform ratio prior is a proper prior.
     Pr( x ) = 0 if x < 0
               0.5 if 0 < x < 1
               0.5/x**2 if x > 1

domain2Unit.
     u = 0.5 d if 0 < d < 1
         1 - 0.5/d if d > 1

unit2Domain.
     d = 2 u if 0 < u < 0.5
         1/2(1-u) if 0.5 < u < 1

The keyword "circular" does not apply to this prior.

Examples

pr = UniformRatioPrior()

Attributes from Prior
lowLimit, highLimit, deltaP, _lowDomain, _highDomain

UniformRatioPrior( range=None, median=1.0, limits=None, prior=None ) [source]

Constructor.

Parameters

  • range : None or float
         set limits tp [1/range, range]
  • median : float
         median point of the ratio
  • limits : None or [float,float]
         None no limits are set
         2 floats lowlimit and highlimit
  • prior : UniformRatioPrior
         to be copied

copy( ) [source]
Return a (deep) copy of itself.

getIntegral( ) [source]
Return integral of UniformRatioPrior from lowLimit to highLimit.

domain2Unit( dval ) [source]
Return a value in [0,1] given a positive ratio value

Parameters

  • dval : float
         value within the domain of a parameter

unit2Domain( uval ) [source]
Return a ratio value given a value in [0,1].

Parameters

  • uval : float
         value within [0,1]

result( x ) [source]
Return a the result of the distribution function at x.

Parameters

  • x : float or array_like
         value within the domain of a parameter

logResult( x ) [source]
Return a the log of the result of the distribution function at x.

Parameters

  • x : float or array_like
         value within the domain of a parameter

partialLog( p ) [source]
Return partial derivative of log( Prior ) wrt parameter.

Parameters

  • p : float or array_like
         the value

isBound( ) [source]
Return true if the integral over the prior is bound.

shortName( ) [source]
Return a string representation of the prior.
Methods inherited from Prior