BayesicFitting

Model Fitting and Evidence Calculation

View project on GitHub



class PhantomCollection( object )Source

Helper class for NestedSamplers Engines to collect all trial walkers obtained during the NS run. They are kept ordered according to their logL.
They are used to find the minimum and maximum values of the parameter settings as function of the likelihood.

There are different methods for static models and for dynamic models.

For dynamic models only parameter sets of the proper length are searched. The kth item in self.logL belongs to the kth list in self.pars. If the model had np parameters then self.logL[np][k] pertain to self.pars[np][k,:] which has np items

For static models there is only one array of self.logL and one 2-d array od self.pars.

Attributes

  • phantoms : WalkerList or dict of { int : WalkerList }
         int number of parameters in the model
         Wlakerlist list of (phantom) walkers
  • paramMin : array_like or None
         minimum values of the parameters at this stage of lowLhood
         None if too few items of this parameter length is present
  • paramMax : array_like or None
         maximum values of the parameters at this stage of lowLhood
         None if too few items of this parameter length is present

Author Do Kester.

PhantomCollection( dynamic=False )

Constructor.

Parameters

  • dynamic : bool
         whether it is a dynamic model

length( np=0 )
Return length of internal walkerlist

Parameters

  • np : int
         number of parameters (in case of dynamic only)

getList( walker )
Return the applicable WalkerList

Parameters

  • walker : Walker
         return list pertaining to this walker (not used here)

storeItems( walker )
Store both items as arrays.

Parameters

  • walker : Walker
         to be added to the PhantomCollection

calculateParamMinmax( lowLhood, np=0 )
Calculate the min and max values of the present parameter values.

Parameters

  • lowLhood : float
         lower boundary of the log Likelihood
  • np : int
         number of parameters (not used in this implementation)

getParamMinmax( lowLhood, np=0 )
Obtain the min and max values of the present parameter values.

Parameters

  • lowLhood : float
         lower boundary of the log Likelihood
  • np : int
         number of parameters (not used in this implementation)

lengthDynamic( np=None )
Return length of internal walkerlist

Parameters

  • np : int
         number of parameters (in case of dynamic only)

getDynamicList( walker )
Return the applicable WalkerList or None if not present.

Parameters

  • walker : Walker
         return list pertaining to this walker

storeDynamic( walker )
Put both items in the dictionaries with npars as key

Parameters

  • logL : float
         log Likelihood
  • pars : 1d array
         parameters

calculateDynamic( lowLhood, np=0 )
Calculate the min and max values of the present parameters of length np.

Parameters

  • lowLhood : float
         lower boundary of the log Likelihood
  • np : int
         number of parameters

getDynamic( lowLhood, np=0 )
Return the min and max values of the present parameters of length np.

Parameters

  • lowLhood : float
         lower boundary of the log Likelihood
  • np : int
         number of parameters