BayesicFitting

Model Fitting and Evidence Calculation

View project on GitHub



class Sample( object )Source

Sample is weighted random draw from a Posterior distribution as provided by a Sampler

Each Sample maintains 5 attributes

Attributes

  • id : int
         identification number
  • parent : int
         id of the parent (-1 for Adam/Eve)
  • model : Model
         the model being used
  • logL : float
         log Likelihood = log Prob( data | params )
  • logW : float
         log Weights of the log of the weight of the sample.
         The weight is the relative contribution to the evidence integral.
         logW = logL + log( width )
         The logZ, the evidence, equals the log of the sum of the contributions.
         logZ = log( sum( exp( logW ) ) )
  • parameters : array_like
         parameters (of the model)
  • nuisance : array_like (optional)
         nuisance parameters (of the problem)
  • hyper : array_like (optional)
         list of hyper parameters (of the error distribution)
  • fitIndex : array_like or None
         list of allpars to be fitted.
  • allpars : array_like (read only)
         list of parameters, nuisance parameters and hyperparameters

Author Do Kester

Sample( id, parent, start, model, parameters=None, fitIndex=None, copy=None )

Constructor.

Parameters

  • id : int
         id of the sample
  • parent : int
         id of the parent (-1 for Adam/Eve)
  • start : int
         iteration in which the walker was constructed
  • model : Model
         the model being used. Parameters are copied from this model.
  • parameters : array_like
         list of model parameters
  • fitIndex : array_like
         list of indices in allpars that need fitting
  • copy : Sample
         the sample to be copied

copy( )
Copy.