Skip to content

Latest commit

 

History

History
119 lines (92 loc) · 5.79 KB

File metadata and controls

119 lines (92 loc) · 5.79 KB




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 ) [source]

Constructor.

Parameters

  • dynamic : bool
         whether it is a dynamic model

length( np=None ) [source]
Return length of internal walkerlist

Parameters

  • np : int or None
         None return overall length
         number of parameters (in case of dynamic only)

getBest( np ) [source]
Return the best phantom with np parameters; or -1 if no phantom has np parameters

Parameters

  • np : int
         number of parameters

nextLowPhantom( lowLhood ) [source]
Generator for phantoms with logL < lowLhood

Parameters

  • lowLhood : float
         low border for likelihood

storeItems( walker ) [source]
Store both items as arrays.

Parameters

  • walker : Walker
         to be added to the PhantomCollection

getParamMinmax( lowLhood, np=None ) [source]
Obtain the min and max values of the present parameter values.

Parameters

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

calculateParamMinmax( lowLhood, np=None ) [source]
Calculate the min and max values of the present parameters of length np.

Parameters

  • lowLhood : float
         lower boundary of the log Likelihood
  • np : int or None
         None for static models.
         number of parameters