CMS 3D CMS Logo

Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes

GaussianSumUtilities< N > Class Template Reference

#include <GaussianSumUtilities.h>

List of all members.

Public Types

typedef ROOT::Math::SMatrix
< double, N, N,
ROOT::Math::MatRepStd< double,
N > > 
GenMatrix
typedef SingleState::Matrix Matrix
typedef MultiGaussianState< N > MultiState
typedef SingleGaussianState< N > SingleState
typedef
MultiState::SingleStateContainer 
SingleStateContainer
typedef MultiState::SingleStatePtr SingleStatePtr
typedef SingleState::Vector Vector

Public Member Functions

const SingleStateContainercomponents () const
 components
const Matrixcovariance (unsigned int i) const
 covariance matrix of a component
const Matrixcovariance () const
 combined covariance
Vector d1LnPdf (const Vector &) const
 gradient of ln(pdf)
Vector d1Pdf (const Vector &) const
 gradient
Matrix d2LnPdf (const Vector &) const
 Hessian of ln(pdf)
Matrix d2Pdf (const Vector &) const
 Hessian.
 GaussianSumUtilities (const MultiState &state)
double lnPdf (const Vector &) const
 value of ln(pdf)
const Vectormean () const
 combined mean
const Vectormean (unsigned int i) const
 mean value of a component
const SingleGaussianState< N > & mode () const
bool modeIsValid () const
 mode status
double pdf (const Vector &) const
 value of the p.d.f.
unsigned int size () const
 number of components
const MultiStatestate () const
 multi-state
double weight () const
 combined weight
double weight (unsigned int i) const
 weight of a component
 ~GaussianSumUtilities ()

Protected Member Functions

Vector computeModeWithoutTransform () const
 calculation of mode

Private Types

enum  ModeStatus { Valid, NotValid, NotComputed }

Private Member Functions

void computeMode () const
 calculation of mode with transformation of pdf
MultiGaussianState1D constrainedState (const Vector &d, const Vector &x0) const
 state constrained to a line x = s*d+x0
Vector d1LnPdf (const Vector &, const std::vector< double > &) const
 gradient of ln(pdf) using the pdf components at the evaluation point
Vector d1Pdf (const Vector &, const std::vector< double > &) const
 gradient using the pdf components at the evaluation point
Matrix d2LnPdf (const Vector &, const std::vector< double > &) const
 Hessian of ln(pdf) using the pdf components at the evaluation point.
Matrix d2Pdf (const Vector &, const std::vector< double > &) const
 Hessian using the pdf components at the evaluation point.
bool findMode (Vector &mode, double &pdfAtMode, const Vector &xStart) const
 mode from starting value in ln(pdf); returns true on success
double gauss (const double &, const double &, const double &) const
 value of gaussian distribution
double gauss (const Vector &, const Vector &, const Matrix &) const
 value of multidimensional gaussian distribution
double lnPdf (const Vector &, const std::vector< double > &) const
 value of ln(pdf) using the pdf components at the evaluation point
Matrix localCovariance (const Vector &x) const
double pdf (const Vector &, const std::vector< double > &) const
 value of the p.d.f. using the pdf components at the evaluation point
std::vector< double > pdfComponents (const Vector &) const
 pdf components
void setInvalidMode () const
 set mode "state" in case of failure
void setMode (const Vector &mode) const
 set mode "state" from solution of mode finding
Matrix tensorProduct (const Vector &) const
 Symmetric Tensor Product (not recognized by standard ROOT Math)

Private Attributes

SingleGaussianState< N > theMode
ModeStatus theModeStatus
const MultiStatetheState

Detailed Description

template<unsigned int N>
class GaussianSumUtilities< N >

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

Definition at line 15 of file GaussianSumUtilities.h.


Member Typedef Documentation

template<unsigned int N>
typedef ROOT::Math::SMatrix<double,N,N,ROOT::Math::MatRepStd<double,N> > GaussianSumUtilities< N >::GenMatrix

Definition at line 20 of file GaussianSumUtilities.h.

template<unsigned int N>
typedef SingleState::Matrix GaussianSumUtilities< N >::Matrix

Definition at line 23 of file GaussianSumUtilities.h.

template<unsigned int N>
typedef MultiGaussianState<N> GaussianSumUtilities< N >::MultiState

Definition at line 18 of file GaussianSumUtilities.h.

template<unsigned int N>
typedef SingleGaussianState<N> GaussianSumUtilities< N >::SingleState

Definition at line 17 of file GaussianSumUtilities.h.

Definition at line 25 of file GaussianSumUtilities.h.

template<unsigned int N>
typedef MultiState::SingleStatePtr GaussianSumUtilities< N >::SingleStatePtr

Definition at line 24 of file GaussianSumUtilities.h.

template<unsigned int N>
typedef SingleState::Vector GaussianSumUtilities< N >::Vector

Definition at line 22 of file GaussianSumUtilities.h.


Member Enumeration Documentation

template<unsigned int N>
enum GaussianSumUtilities::ModeStatus [private]
Enumerator:
Valid 
NotValid 
NotComputed 

Definition at line 28 of file GaussianSumUtilities.h.


Constructor & Destructor Documentation

template<unsigned int N>
GaussianSumUtilities< N >::GaussianSumUtilities ( const MultiState state) [inline]

Definition at line 31 of file GaussianSumUtilities.h.

template<unsigned int N>
GaussianSumUtilities< N >::~GaussianSumUtilities ( ) [inline]

Definition at line 35 of file GaussianSumUtilities.h.

                           {
  }

Member Function Documentation

template<unsigned int N>
const SingleStateContainer& GaussianSumUtilities< N >::components ( ) const [inline]
template<unsigned int N>
void GaussianSumUtilities< N >::computeMode ( ) const [private]

calculation of mode with transformation of pdf

template<unsigned int N>
Vector GaussianSumUtilities< N >::computeModeWithoutTransform ( ) const [protected]

calculation of mode

template<unsigned int N>
MultiGaussianState1D GaussianSumUtilities< N >::constrainedState ( const Vector d,
const Vector x0 
) const [private]

state constrained to a line x = s*d+x0

template<unsigned int N>
const Matrix& GaussianSumUtilities< N >::covariance ( void  ) const [inline]

combined covariance

Definition at line 89 of file GaussianSumUtilities.h.

References MultiGaussianState< N >::covariance(), and GaussianSumUtilities< N >::theState.

                                    {
    return theState.covariance();
  }
template<unsigned int N>
const Matrix& GaussianSumUtilities< N >::covariance ( unsigned int  i) const [inline]

covariance matrix of a component

Definition at line 59 of file GaussianSumUtilities.h.

References GaussianSumUtilities< N >::components(), and i.

                                                         {
    return components()[i]->covariance();
  }
template<unsigned int N>
Vector GaussianSumUtilities< N >::d1LnPdf ( const Vector ,
const std::vector< double > &   
) const [private]

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

template<unsigned int N>
Vector GaussianSumUtilities< N >::d1LnPdf ( const Vector ) const

gradient of ln(pdf)

template<unsigned int N>
Vector GaussianSumUtilities< N >::d1Pdf ( const Vector ) const

gradient

template<unsigned int N>
Vector GaussianSumUtilities< N >::d1Pdf ( const Vector ,
const std::vector< double > &   
) const [private]

gradient using the pdf components at the evaluation point

template<unsigned int N>
Matrix GaussianSumUtilities< N >::d2LnPdf ( const Vector ,
const std::vector< double > &   
) const [private]

Hessian of ln(pdf) using the pdf components at the evaluation point.

template<unsigned int N>
Matrix GaussianSumUtilities< N >::d2LnPdf ( const Vector ) const

Hessian of ln(pdf)

template<unsigned int N>
Matrix GaussianSumUtilities< N >::d2Pdf ( const Vector ,
const std::vector< double > &   
) const [private]

Hessian using the pdf components at the evaluation point.

template<unsigned int N>
Matrix GaussianSumUtilities< N >::d2Pdf ( const Vector ) const

Hessian.

template<unsigned int N>
bool GaussianSumUtilities< N >::findMode ( Vector mode,
double &  pdfAtMode,
const Vector xStart 
) const [private]

mode from starting value in ln(pdf); returns true on success

template<unsigned int N>
double GaussianSumUtilities< N >::gauss ( const double &  ,
const double &  ,
const double &   
) const [private]

value of gaussian distribution

template<unsigned int N>
double GaussianSumUtilities< N >::gauss ( const Vector ,
const Vector ,
const Matrix  
) const [private]

value of multidimensional gaussian distribution

template<unsigned int N>
double GaussianSumUtilities< N >::lnPdf ( const Vector ,
const std::vector< double > &   
) const [private]

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

template<unsigned int N>
double GaussianSumUtilities< N >::lnPdf ( const Vector ) const

value of ln(pdf)

template<unsigned int N>
Matrix GaussianSumUtilities< N >::localCovariance ( const Vector x) const [private]

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

template<unsigned int N>
const Vector& GaussianSumUtilities< N >::mean ( ) const [inline]

combined mean

Definition at line 85 of file GaussianSumUtilities.h.

References MultiGaussianState< N >::mean(), and GaussianSumUtilities< N >::theState.

                              {
    return theState.mean();
  }
template<unsigned int N>
const Vector& GaussianSumUtilities< N >::mean ( unsigned int  i) const [inline]

mean value of a component

Definition at line 55 of file GaussianSumUtilities.h.

References GaussianSumUtilities< N >::components(), and i.

                                                   {
    return components()[i]->mean();
  }
template<unsigned int N>
const SingleGaussianState<N>& GaussianSumUtilities< N >::mode ( ) const

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

template<unsigned int N>
bool GaussianSumUtilities< N >::modeIsValid ( ) const

mode status

template<unsigned int N>
double GaussianSumUtilities< N >::pdf ( const Vector ,
const std::vector< double > &   
) const [private]

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

template<unsigned int N>
double GaussianSumUtilities< N >::pdf ( const Vector ) const

value of the p.d.f.

template<unsigned int N>
std::vector<double> GaussianSumUtilities< N >::pdfComponents ( const Vector ) const [private]

pdf components

template<unsigned int N>
void GaussianSumUtilities< N >::setInvalidMode ( ) const [private]

set mode "state" in case of failure

template<unsigned int N>
void GaussianSumUtilities< N >::setMode ( const Vector mode) const [private]

set mode "state" from solution of mode finding

template<unsigned int N>
unsigned int GaussianSumUtilities< N >::size ( void  ) const [inline]

number of components

Definition at line 39 of file GaussianSumUtilities.h.

References GaussianSumUtilities< N >::components().

                                    {
    return components().size();
  }
template<unsigned int N>
const MultiState& GaussianSumUtilities< N >::state ( ) const [inline]

multi-state

Definition at line 47 of file GaussianSumUtilities.h.

References GaussianSumUtilities< N >::theState.

                                   {
    return theState;
  }
template<unsigned int N>
Matrix GaussianSumUtilities< N >::tensorProduct ( const Vector ) const [private]

Symmetric Tensor Product (not recognized by standard ROOT Math)

template<unsigned int N>
double GaussianSumUtilities< N >::weight ( ) const [inline]

combined weight

Definition at line 81 of file GaussianSumUtilities.h.

References GaussianSumUtilities< N >::theState, and MultiGaussianState< N >::weight().

                         {
    return theState.weight();
  }
template<unsigned int N>
double GaussianSumUtilities< N >::weight ( unsigned int  i) const [inline]

weight of a component

Definition at line 51 of file GaussianSumUtilities.h.

References GaussianSumUtilities< N >::components(), and i.

                                              {
    return components()[i]->weight();
  }

Member Data Documentation

template<unsigned int N>
SingleGaussianState<N> GaussianSumUtilities< N >::theMode [mutable, private]

Definition at line 148 of file GaussianSumUtilities.h.

template<unsigned int N>
ModeStatus GaussianSumUtilities< N >::theModeStatus [mutable, private]

Definition at line 146 of file GaussianSumUtilities.h.

template<unsigned int N>
const MultiState& GaussianSumUtilities< N >::theState [private]