BayesicFitting

Model Fitting and Evidence Calculation

View project on GitHub



class HyperParameter( object )Source

Values and priors for the parameter(s) of an ErrorDistribution.

Hyperparameters are not directly related to the model, they are parameters of the error distribution.

Information about the scale of the noise is stored in a derived class, noiseScale.

The full use of priors is reserved for Bayesian calculations as in NestedSampler

Attributes

  • hypar : float
         the value of the hyperparameter. Default: 1.0
  • stdev : float
         the standard deviation of the hyperparameter. Default: None
  • prior : Prior
         the prior for the hyperparameter.
  • isFixed : boolean
         keep the hyperparameter fixed at the value given by hypar.
         default: True

HyperParameter( hypar=1, isFixed=True, prior=None, limits=None, copy=None )

Constructor.

Parameters

  • hypar : float
         value of the hyperparameter
  • isFixed : bool
         True: Consider the hyperparameter as fixed
         False: Optimize the parameter too (when relevant)
                 It might need a prior and/or limits to be set
  • prior : None or Prior
         None : no prior is set if no limits are given else JeffreysPrior
         prior probability on the hyperparameter
  • limits : None or list of 2 floats [lo,hi]
         low limit and high limit on hypar.
  • copy : HyperParameter
         HyperParameter to copy

copy( )

Return a copy.

checkPrior( )
Raises

ValueError when no prior has been set.

setLimits( limits )
Set the limits on the scale within the prior.

Parameters

  • limits : list of 2 float
         the [low,high] limits.

getLimits( )

Return the limits on the scale.

isBound( )

Return true is the itergral over the prior is bound.

domain2Unit( dval )
Return a value in [0,1] given a value within the valid domain of a parameter for the prior distribution.

Parameters

  • dval : float
         value within the domain of a parameter

unit2Domain( uval )
Return a value within the valid domain of the parameter given a value between [0,1] for the prior distribution.

Parameters

  • uval : float
         value within [0,1]

partialDomain2Unit( dval )
Return a the derivate of the domain2Unit function to dval.

Parameters

  • dval : float
         value within the domain of a parameter