CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes
GaussianSumUtilities1D Class Reference

#include <GaussianSumUtilities1D.h>

Classes

struct  FinderState
 

Public Member Functions

double cdf (const double &) const
 value of the c.d.f. More...
 
const std::vector
< SingleGaussianState1D > & 
components () const
 components More...
 
double d1LnPdf (const double &) const
 first derivative of ln(pdf) More...
 
double d1Pdf (const double &) const
 first derivative of the p.d.f. More...
 
double d2LnPdf (const double &) const
 second derivative of ln(pdf) More...
 
double d2Pdf (const double &) const
 second derivative of the p.d.f. More...
 
double d3Pdf (const double &) const
 third derivative of the p.d.f. More...
 
 GaussianSumUtilities1D (const MultiGaussianState1D &state)
 
double lnPdf (const double &) const
 ln(pdf) More...
 
double mean (unsigned int i) const
 mean value of a component More...
 
double mean () const
 combined mean More...
 
const SingleGaussianState1Dmode () const
 
bool modeIsValid () const
 mode status More...
 
double pdf (unsigned int i, double x) const
 pdf of a single component at x More...
 
double pdf (double) const
 value of the p.d.f. More...
 
double quantile (const double) const
 Quantile (i.e. x for a given value of the c.d.f.) More...
 
unsigned int size () const
 number of components More...
 
double standardDeviation (unsigned int i) const
 standard deviation of a component More...
 
double variance (unsigned int i) const
 variance of a component More...
 
double variance () const
 combined covariance More...
 
double weight (unsigned int i) const
 weight of a component More...
 
double weight () const
 combined weight More...
 
 ~GaussianSumUtilities1D ()
 

Private Types

enum  ModeStatus { Valid, NotValid, NotComputed }
 

Private Member Functions

double combinedMean () const
 Mean value of combined state. More...
 
void computeMode () const
 calculation of mode More...
 
double d1LnPdf (double, const std::vector< double > &) const
 first derivative of ln(pdf) using the pdf components at the evaluation point More...
 
double d1Pdf (double, const std::vector< double > &) const
 first derivative of the p.d.f. using the pdf components at the evaluation point More...
 
double d2LnPdf (double, const std::vector< double > &) const
 second derivative of ln(pdf) using the pdf components at the evaluation point More...
 
double d2Pdf (double, const std::vector< double > &) const
 second derivative of the p.d.f. using the pdf components at the evaluation point More...
 
double d3Pdf (double, const std::vector< double > &) const
 third derivative of the p.d.f. using the pdf components at the evaluation point More...
 
bool findMode (double &mode, double &pdfAtMode, const double &xStart, const double &scale) const
 
double localVariance (double x) const
 
std::vector< double > pdfComponents (const double &) const
 pdf components More...
 
void pdfComponents (double, std::vector< double > &) const
 pdf components More...
 
void update (FinderState &state, double x) const
 

Static Private Member Functions

static double gauss (double, double, double)
 Value of gaussian distribution. More...
 
static double gaussInt (double, double, double)
 Integrated value of gaussian distribution. More...
 
static double lnPdf (double, const std::vector< double > &)
 ln(pdf) using the pdf components at the evaluation point More...
 
static double pdf (double, const std::vector< double > &)
 value of the p.d.f. using the pdf components at the evaluation point More...
 

Private Attributes

SingleGaussianState1D theMode
 
ModeStatus theModeStatus
 
const MultiGaussianState1DtheState
 

Detailed Description

Utility class for the analysis of one-dimensional Gaussian mixtures. The input state is assumed to exist for the lifetime of this object.

Definition at line 16 of file GaussianSumUtilities1D.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

GaussianSumUtilities1D::GaussianSumUtilities1D ( const MultiGaussianState1D state)
inline

Definition at line 21 of file GaussianSumUtilities1D.h.

21  :
22  theState(state),
23 // theStates(state.components()),
const MultiGaussianState1D & theState
GaussianSumUtilities1D::~GaussianSumUtilities1D ( )
inline

Definition at line 25 of file GaussianSumUtilities1D.h.

25 {}

Member Function Documentation

double GaussianSumUtilities1D::cdf ( const double &  x) const

value of the c.d.f.

Definition at line 288 of file GaussianSumUtilities1D.cc.

double GaussianSumUtilities1D::combinedMean ( ) const
private

Mean value of combined state.

Definition at line 463 of file GaussianSumUtilities1D.cc.

const std::vector<SingleGaussianState1D>& GaussianSumUtilities1D::components ( ) const
inline

components

Definition at line 30 of file GaussianSumUtilities1D.h.

References MultiGaussianState1D::components(), and theState.

Referenced by mean(), size(), standardDeviation(), variance(), and weight().

30  {
31  return theState.components();
32  }
const MultiGaussianState1D & theState
const SingleState1dContainer & components() const
access to components
void GaussianSumUtilities1D::computeMode ( ) const
private

calculation of mode

Definition at line 101 of file GaussianSumUtilities1D.cc.

double GaussianSumUtilities1D::d1LnPdf ( const double &  x) const

first derivative of ln(pdf)

Definition at line 322 of file GaussianSumUtilities1D.cc.

double GaussianSumUtilities1D::d1LnPdf ( double  x,
const std::vector< double > &  pdfs 
) const
private

first derivative of ln(pdf) using the pdf components at the evaluation point

Definition at line 422 of file GaussianSumUtilities1D.cc.

double GaussianSumUtilities1D::d1Pdf ( const double &  x) const

first derivative of the p.d.f.

Definition at line 298 of file GaussianSumUtilities1D.cc.

double GaussianSumUtilities1D::d1Pdf ( double  x,
const std::vector< double > &  pdfs 
) const
private

first derivative of the p.d.f. using the pdf components at the evaluation point

Definition at line 376 of file GaussianSumUtilities1D.cc.

double GaussianSumUtilities1D::d2LnPdf ( const double &  x) const

second derivative of ln(pdf)

Definition at line 328 of file GaussianSumUtilities1D.cc.

double GaussianSumUtilities1D::d2LnPdf ( double  x,
const std::vector< double > &  pdfs 
) const
private

second derivative of ln(pdf) using the pdf components at the evaluation point

Definition at line 433 of file GaussianSumUtilities1D.cc.

double GaussianSumUtilities1D::d2Pdf ( const double &  x) const

second derivative of the p.d.f.

Definition at line 304 of file GaussianSumUtilities1D.cc.

double GaussianSumUtilities1D::d2Pdf ( double  x,
const std::vector< double > &  pdfs 
) const
private

second derivative of the p.d.f. using the pdf components at the evaluation point

Definition at line 388 of file GaussianSumUtilities1D.cc.

double GaussianSumUtilities1D::d3Pdf ( const double &  x) const

third derivative of the p.d.f.

Definition at line 310 of file GaussianSumUtilities1D.cc.

double GaussianSumUtilities1D::d3Pdf ( double  x,
const std::vector< double > &  pdfs 
) const
private

third derivative of the p.d.f. using the pdf components at the evaluation point

Definition at line 400 of file GaussianSumUtilities1D.cc.

bool GaussianSumUtilities1D::findMode ( double &  mode,
double &  pdfAtMode,
const double &  xStart,
const double &  scale 
) const
private

Finds mode. Input: start value and typical scale. Output: mode and pdf(mode). Return value is true on success.

Definition at line 215 of file GaussianSumUtilities1D.cc.

double GaussianSumUtilities1D::gauss ( double  x,
double  mean,
double  sigma 
)
staticprivate

Value of gaussian distribution.

Definition at line 444 of file GaussianSumUtilities1D.cc.

double GaussianSumUtilities1D::gaussInt ( double  x,
double  mean,
double  sigma 
)
staticprivate

Integrated value of gaussian distribution.

Definition at line 457 of file GaussianSumUtilities1D.cc.

double GaussianSumUtilities1D::lnPdf ( const double &  x) const

ln(pdf)

Definition at line 316 of file GaussianSumUtilities1D.cc.

double GaussianSumUtilities1D::lnPdf ( double  x,
const std::vector< double > &  pdfs 
)
staticprivate

ln(pdf) using the pdf components at the evaluation point

Definition at line 413 of file GaussianSumUtilities1D.cc.

double GaussianSumUtilities1D::localVariance ( double  x) const
private

Local variance from Hessian matrix. Only valid if x corresponds to a (local) maximum!

Definition at line 477 of file GaussianSumUtilities1D.cc.

double GaussianSumUtilities1D::mean ( unsigned int  i) const
inline

mean value of a component

Definition at line 36 of file GaussianSumUtilities1D.h.

References components(), and i.

36 {return components()[i].mean();}
int i
Definition: DBlmapReader.cc:9
const std::vector< SingleGaussianState1D > & components() const
components
double GaussianSumUtilities1D::mean ( ) const
inline

combined mean

Definition at line 75 of file GaussianSumUtilities1D.h.

References MultiGaussianState1D::mean(), and theState.

75  {
76  return theState.mean();
77  }
const MultiGaussianState1D & theState
double mean() const
combined mean
const SingleGaussianState1D & GaussianSumUtilities1D::mode ( void  ) const

Mode "state": mean = mode, variance = local variance at mode, weight chosen to have pdf(mode) equal to the one of the mixture

Definition at line 94 of file GaussianSumUtilities1D.cc.

bool GaussianSumUtilities1D::modeIsValid ( ) const

mode status

Definition at line 87 of file GaussianSumUtilities1D.cc.

double GaussianSumUtilities1D::pdf ( unsigned int  i,
double  x 
) const

pdf of a single component at x

Definition at line 22 of file GaussianSumUtilities1D.cc.

double GaussianSumUtilities1D::pdf ( double  x) const

value of the p.d.f.

Definition at line 278 of file GaussianSumUtilities1D.cc.

double GaussianSumUtilities1D::pdf ( double  ,
const std::vector< double > &  pdfs 
)
staticprivate

value of the p.d.f. using the pdf components at the evaluation point

Definition at line 370 of file GaussianSumUtilities1D.cc.

std::vector< double > GaussianSumUtilities1D::pdfComponents ( const double &  x) const
private

pdf components

Definition at line 334 of file GaussianSumUtilities1D.cc.

void GaussianSumUtilities1D::pdfComponents ( double  x,
std::vector< double > &  result 
) const
private

pdf components

Definition at line 352 of file GaussianSumUtilities1D.cc.

double GaussianSumUtilities1D::quantile ( const double  q) const

Quantile (i.e. x for a given value of the c.d.f.)

Definition at line 28 of file GaussianSumUtilities1D.cc.

unsigned int GaussianSumUtilities1D::size ( void  ) const
inline

number of components

Definition at line 28 of file GaussianSumUtilities1D.h.

References components().

28 {return components().size();}
const std::vector< SingleGaussianState1D > & components() const
components
double GaussianSumUtilities1D::standardDeviation ( unsigned int  i) const
inline

standard deviation of a component

Definition at line 38 of file GaussianSumUtilities1D.h.

References components(), and i.

38  {
39 // return sqrt(components()[i].variance());
40  return components()[i].standardDeviation();
41  }
int i
Definition: DBlmapReader.cc:9
const std::vector< SingleGaussianState1D > & components() const
components
void GaussianSumUtilities1D::update ( FinderState state,
double  x 
) const
private
double GaussianSumUtilities1D::variance ( unsigned int  i) const
inline

variance of a component

Definition at line 43 of file GaussianSumUtilities1D.h.

References components(), and i.

43 {return components()[i].variance();}
int i
Definition: DBlmapReader.cc:9
const std::vector< SingleGaussianState1D > & components() const
components
double GaussianSumUtilities1D::variance ( ) const
inline

combined covariance

Definition at line 79 of file GaussianSumUtilities1D.h.

References theState, and MultiGaussianState1D::variance().

79  {
80  return theState.variance();
81  }
const MultiGaussianState1D & theState
double variance() const
combined variance
double GaussianSumUtilities1D::weight ( unsigned int  i) const
inline

weight of a component

Definition at line 34 of file GaussianSumUtilities1D.h.

References components(), and i.

34 {return components()[i].weight();}
int i
Definition: DBlmapReader.cc:9
const std::vector< SingleGaussianState1D > & components() const
components
double GaussianSumUtilities1D::weight ( void  ) const
inline

combined weight

Definition at line 71 of file GaussianSumUtilities1D.h.

References theState, and MultiGaussianState1D::weight().

71  {
72  return theState.weight();
73  }
const MultiGaussianState1D & theState
double weight() const
combined weight

Member Data Documentation

SingleGaussianState1D GaussianSumUtilities1D::theMode
mutableprivate

Definition at line 139 of file GaussianSumUtilities1D.h.

ModeStatus GaussianSumUtilities1D::theModeStatus
mutableprivate

Definition at line 138 of file GaussianSumUtilities1D.h.

const MultiGaussianState1D& GaussianSumUtilities1D::theState
private

Definition at line 135 of file GaussianSumUtilities1D.h.

Referenced by components(), mean(), variance(), and weight().