1 #ifndef GaussianSumUtilities_h_ 2 #define GaussianSumUtilities_h_ 14 template <
unsigned int N>
20 typedef ROOT::Math::SMatrix<double,N,N,ROOT::Math::MatRepStd<double,N> >
GenMatrix;
39 inline unsigned int size ()
const {
47 const MultiState&
state ()
const {
51 inline double weight (
unsigned int i)
const {
55 inline const Vector&
mean (
unsigned int i)
const {
68 double pdf (
const Vector&)
const;
70 Vector
d1Pdf (
const Vector&)
const;
72 Matrix
d2Pdf (
const Vector&)
const;
74 double lnPdf (
const Vector&)
const;
76 Vector
d1LnPdf (
const Vector&)
const;
78 Matrix
d2LnPdf (
const Vector&)
const;
85 const Vector&
mean ()
const {
102 double gauss (
const double&,
const double&,
const double&)
const;
104 double gauss (
const Vector&,
106 const Matrix&)
const;
108 bool findMode (Vector& mode,
double& pdfAtMode,
109 const Vector& xStart)
const;
114 const Vector& x0)
const;
121 void setMode (
const Vector& mode)
const;
128 double pdf (
const Vector&,
const std::vector<double>&)
const;
130 Vector
d1Pdf (
const Vector&,
const std::vector<double>&)
const;
132 Matrix
d2Pdf (
const Vector&,
const std::vector<double>&)
const;
134 double lnPdf (
const Vector&,
const std::vector<double>&)
const;
136 Vector
d1LnPdf (
const Vector&,
const std::vector<double>&)
const;
138 Matrix
d2LnPdf (
const Vector&,
const std::vector<double>&)
const;
152 #include "TrackingTools/GsfTools/interface/GaussianSumUtilities.icc" Matrix d2Pdf(const Vector &) const
Hessian.
double lnPdf(const Vector &) const
value of ln(pdf)
Vector computeModeWithoutTransform() const
calculation of mode
MultiState::SingleStatePtr SingleStatePtr
std::vector< double > pdfComponents(const Vector &) const
pdf components
void setMode(const Vector &mode) const
set mode "state" from solution of mode finding
const SingleStateContainer & components() const
components
const Matrix & covariance(unsigned int i) const
covariance matrix of a component
Matrix tensorProduct(const Vector &) const
Symmetric Tensor Product (not recognized by standard ROOT Math)
Matrix d2LnPdf(const Vector &) const
Hessian of ln(pdf)
const SingleStateContainer & components() const
access to components (single Gaussian states)
SingleState::Matrix Matrix
const Matrix & covariance() const
combined covariance matrix
const SingleGaussianState< N > & mode() const
double pdf(const Vector &) const
value of the p.d.f.
Mixture of multi-variate gaussian states.
GaussianSumUtilities(const MultiState &state)
std::vector< SingleStatePtr > SingleStateContainer
ROOT::Math::SVector< double, N > Vector
Vector d1Pdf(const Vector &) const
gradient
MultiGaussianState1D constrainedState(const Vector &d, const Vector &x0) const
state constrained to a line x = s*d+x0
const Vector & mean() const
combined mean
Matrix localCovariance(const Vector &x) const
void setInvalidMode() const
set mode "state" in case of failure
const Matrix & covariance() const
combined covariance
bool findMode(Vector &mode, double &pdfAtMode, const Vector &xStart) const
mode from starting value in ln(pdf); returns true on success
MultiState::SingleStateContainer SingleStateContainer
const MultiState & state() const
multi-state
double weight() const
combined weight
std::shared_ptr< SingleState > SingleStatePtr
Vector d1LnPdf(const Vector &) const
gradient of ln(pdf)
const Vector & mean(unsigned int i) const
mean value of a component
unsigned int size() const
number of components
MultiGaussianState< N > MultiState
double weight() const
combined weight
SingleGaussianState< N > SingleState
double gauss(const double &, const double &, const double &) const
value of gaussian distribution
const MultiState & theState
SingleGaussianState< N > theMode
bool modeIsValid() const
mode status
const Vector & mean() const
combined mean
SingleState::Vector Vector
void computeMode() const
calculation of mode with transformation of pdf
ROOT::Math::SMatrix< double, N, N, ROOT::Math::MatRepStd< double, N > > GenMatrix
ROOT::Math::SMatrix< double, N, N, ROOT::Math::MatRepSym< double, N >> Matrix
double weight(unsigned int i) const
weight of a component