#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 () const |
combined mean More... | |
double | mean (unsigned int i) const |
mean value of a component More... | |
const SingleGaussianState1D & | mode () const |
bool | modeIsValid () const |
mode status More... | |
double | pdf (double) const |
value of the p.d.f. More... | |
double | pdf (unsigned int i, double x) const |
pdf of a single component at x 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 () const |
combined covariance More... | |
double | variance (unsigned int i) const |
variance of a component More... | |
double | weight () const |
combined weight More... | |
double | weight (unsigned int i) const |
weight of a component 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 MultiGaussianState1D & | theState |
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.
|
private |
|
inline |
Definition at line 21 of file GaussianSumUtilities1D.h.
|
inline |
Definition at line 25 of file GaussianSumUtilities1D.h.
double GaussianSumUtilities1D::cdf | ( | const double & | x | ) | const |
value of the c.d.f.
Definition at line 268 of file GaussianSumUtilities1D.cc.
References gaussInt(), mps_fire::i, mean(), mps_fire::result, alignCSCRings::s, size(), standardDeviation(), weight(), and x.
|
private |
Mean value of combined state.
Definition at line 399 of file GaussianSumUtilities1D.cc.
References components(), mps_fire::i, alignCSCRings::s, size(), and weight().
|
inline |
components
Definition at line 30 of file GaussianSumUtilities1D.h.
References MultiGaussianState1D::components(), and theState.
Referenced by combinedMean(), computeMode(), mean(), pdfComponents(), size(), standardDeviation(), variance(), and weight().
|
private |
calculation of mode
Definition at line 91 of file GaussianSumUtilities1D.cc.
References components(), MillePedeFileConverter_cfg::e, findMode(), dqmdumpme::first, mps_fire::i, localVariance(), M_PI, MultiGaussianState1D::mean(), mean(), mode(), NotValid, pdf(), alignCSCRings::s, edm::second(), size(), mathSSE::sqrt(), standardDeviation(), theMode, theModeStatus, theState, RunInfoPI::valid, Valid, MultiGaussianState1D::variance(), variance(), w, MultiGaussianState1D::weight(), weight(), x, and y.
Referenced by mode(), and modeIsValid().
double GaussianSumUtilities1D::d1LnPdf | ( | const double & | x | ) | const |
first derivative of ln(pdf)
Definition at line 284 of file GaussianSumUtilities1D.cc.
References pdfComponents(), and x.
Referenced by d2LnPdf().
|
private |
first derivative of ln(pdf) using the pdf components at the evaluation point
Definition at line 365 of file GaussianSumUtilities1D.cc.
References d1Pdf(), f, min(), pdf(), mps_fire::result, and x.
double GaussianSumUtilities1D::d1Pdf | ( | const double & | x | ) | const |
first derivative of the p.d.f.
Definition at line 276 of file GaussianSumUtilities1D.cc.
References pdfComponents(), and x.
|
private |
first derivative of the p.d.f. using the pdf components at the evaluation point
Definition at line 327 of file GaussianSumUtilities1D.cc.
References PVValHelper::dx, mps_fire::i, mean(), mps_fire::result, alignCSCRings::s, size(), standardDeviation(), and x.
double GaussianSumUtilities1D::d2LnPdf | ( | const double & | x | ) | const |
second derivative of ln(pdf)
Definition at line 286 of file GaussianSumUtilities1D.cc.
References pdfComponents(), and x.
|
private |
second derivative of ln(pdf) using the pdf components at the evaluation point
Definition at line 375 of file GaussianSumUtilities1D.cc.
References d1LnPdf(), d2Pdf(), hgcalPerformanceValidation::df, f, min(), pdf(), mps_fire::result, and x.
double GaussianSumUtilities1D::d2Pdf | ( | const double & | x | ) | const |
second derivative of the p.d.f.
Definition at line 278 of file GaussianSumUtilities1D.cc.
References pdfComponents(), and x.
Referenced by d2LnPdf(), localVariance(), and update().
|
private |
second derivative of the p.d.f. using the pdf components at the evaluation point
Definition at line 337 of file GaussianSumUtilities1D.cc.
References PVValHelper::dx, mps_fire::i, mean(), mps_fire::result, alignCSCRings::s, size(), standardDeviation(), and x.
double GaussianSumUtilities1D::d3Pdf | ( | const double & | x | ) | const |
third derivative of the p.d.f.
Definition at line 280 of file GaussianSumUtilities1D.cc.
References pdfComponents(), and x.
|
private |
third derivative of the p.d.f. using the pdf components at the evaluation point
Definition at line 347 of file GaussianSumUtilities1D.cc.
References PVValHelper::dx, mps_fire::i, mean(), mps_fire::result, alignCSCRings::s, size(), standardDeviation(), and x.
|
private |
Finds mode. Input: start value and typical scale. Output: mode and pdf(mode). Return value is true on success.
Definition at line 200 of file GaussianSumUtilities1D.cc.
References PVValHelper::dx, min(), mps_fire::result, HLT_FULL_cff::scale, size(), update(), testProducerWithPsetDescEmpty_cfi::x1, testProducerWithPsetDescEmpty_cfi::x2, TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, and testProducerWithPsetDescEmpty_cfi::y1.
Referenced by computeMode().
|
staticprivate |
Value of gaussian distribution.
Definition at line 384 of file GaussianSumUtilities1D.cc.
Referenced by pdf(), and pdfComponents().
|
staticprivate |
double GaussianSumUtilities1D::lnPdf | ( | const double & | x | ) | const |
ln(pdf)
Definition at line 282 of file GaussianSumUtilities1D.cc.
References pdfComponents(), and x.
|
staticprivate |
ln(pdf) using the pdf components at the evaluation point
Definition at line 357 of file GaussianSumUtilities1D.cc.
References f, dqm-mbProfile::log, SiStripPI::max, min(), pdf(), mps_fire::result, and x.
|
private |
Local variance from Hessian matrix. Only valid if x corresponds to a (local) maximum!
Definition at line 411 of file GaussianSumUtilities1D.cc.
References d2Pdf(), pdf(), pdfComponents(), mps_fire::result, and x.
Referenced by computeMode().
|
inline |
combined mean
Definition at line 71 of file GaussianSumUtilities1D.h.
References MultiGaussianState1D::mean(), and theState.
Referenced by cdf(), computeMode(), d1Pdf(), d2Pdf(), d3Pdf(), gauss(), gaussInt(), pdf(), and pdfComponents().
|
inline |
mean value of a component
Definition at line 34 of file GaussianSumUtilities1D.h.
References components(), and mps_fire::i.
Referenced by multiTrajectoryStateMode::momentumFromModePPhiEta().
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 85 of file GaussianSumUtilities1D.cc.
References computeMode(), NotComputed, theMode, and theModeStatus.
Referenced by computeMode(), PFGsfHelper::computeQpMode(), egamma::correctElectronMomentum(), GsfTrackProducerBase::localParametersFromQpMode(), multiTrajectoryStateMode::momentumFromModeCartesian(), multiTrajectoryStateMode::momentumFromModePPhiEta(), PFGsfHelper::PFGsfHelper(), and multiTrajectoryStateMode::positionFromModeCartesian().
bool GaussianSumUtilities1D::modeIsValid | ( | ) | const |
mode status
Definition at line 79 of file GaussianSumUtilities1D.cc.
References computeMode(), NotComputed, theModeStatus, and Valid.
Referenced by PFGsfHelper::computeQpMode(), GsfTrackProducerBase::localParametersFromQpMode(), and multiTrajectoryStateMode::momentumFromModePPhiEta().
double GaussianSumUtilities1D::pdf | ( | double | x | ) | const |
value of the p.d.f.
Definition at line 260 of file GaussianSumUtilities1D.cc.
References mps_fire::i, pdf(), mps_fire::result, alignCSCRings::s, size(), and x.
|
staticprivate |
value of the p.d.f. using the pdf components at the evaluation point
Definition at line 323 of file GaussianSumUtilities1D.cc.
double GaussianSumUtilities1D::pdf | ( | unsigned int | i, |
double | x | ||
) | const |
pdf of a single component at x
Definition at line 21 of file GaussianSumUtilities1D.cc.
References gauss(), mps_fire::i, mean(), standardDeviation(), weight(), and x.
Referenced by computeMode(), d1LnPdf(), d2LnPdf(), lnPdf(), localVariance(), pdf(), and update().
|
private |
pdf components
Definition at line 288 of file GaussianSumUtilities1D.cc.
References gauss(), mps_fire::i, mean(), mps_fire::result, size(), standardDeviation(), and x.
Referenced by d1LnPdf(), d1Pdf(), d2LnPdf(), d2Pdf(), d3Pdf(), lnPdf(), localVariance(), and update().
|
private |
pdf components
Definition at line 305 of file GaussianSumUtilities1D.cc.
References components(), mps_fire::end, ExhumeParameters_cfi::PDF, mps_fire::result, alignCSCRings::s, size(), HcalDetIdTransform::transform(), and x.
double GaussianSumUtilities1D::quantile | ( | const double | q | ) | const |
Quantile (i.e. x for a given value of the c.d.f.)
Definition at line 25 of file GaussianSumUtilities1D.cc.
References submitPVResolutionJobs::q.
|
inline |
number of components
Definition at line 28 of file GaussianSumUtilities1D.h.
References components().
Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), cdf(), combinedMean(), computeMode(), d1Pdf(), d2Pdf(), d3Pdf(), findMode(), pdf(), and pdfComponents().
|
inline |
standard deviation of a component
Definition at line 36 of file GaussianSumUtilities1D.h.
References components(), and mps_fire::i.
Referenced by cdf(), computeMode(), d1Pdf(), d2Pdf(), d3Pdf(), pdf(), and pdfComponents().
|
private |
Definition at line 247 of file GaussianSumUtilities1D.cc.
References d1Pdf(), d2Pdf(), min(), pdf(), pdfComponents(), and x.
Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), findMode(), progressbar.ProgressBar::finish(), and MatrixUtil.Steps::overwrite().
|
inline |
combined covariance
Definition at line 73 of file GaussianSumUtilities1D.h.
References theState, and MultiGaussianState1D::variance().
Referenced by computeMode().
|
inline |
variance of a component
Definition at line 41 of file GaussianSumUtilities1D.h.
References components(), and mps_fire::i.
|
inline |
combined weight
Definition at line 69 of file GaussianSumUtilities1D.h.
References theState, and MultiGaussianState1D::weight().
Referenced by cdf(), combinedMean(), computeMode(), and pdf().
|
inline |
weight of a component
Definition at line 32 of file GaussianSumUtilities1D.h.
References components(), and mps_fire::i.
|
mutableprivate |
Definition at line 130 of file GaussianSumUtilities1D.h.
Referenced by computeMode(), and mode().
|
mutableprivate |
Definition at line 129 of file GaussianSumUtilities1D.h.
Referenced by computeMode(), mode(), and modeIsValid().
|
private |
Definition at line 126 of file GaussianSumUtilities1D.h.
Referenced by components(), computeMode(), mean(), variance(), and weight().