#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 SingleGaussianState1D & | mode () 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 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 |
Enumerator | |
---|---|
Valid | |
NotValid | |
NotComputed |
Definition at line 18 of file GaussianSumUtilities1D.h.
|
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 288 of file GaussianSumUtilities1D.cc.
References gaussInt(), mps_fire::i, mean(), mps_fire::result, alignCSCRings::s, size(), standardDeviation(), and weight().
Referenced by variance().
|
private |
Mean value of combined state.
Definition at line 463 of file GaussianSumUtilities1D.cc.
References components(), mps_fire::i, alignCSCRings::s, size(), and weight().
Referenced by variance().
|
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 101 of file GaussianSumUtilities1D.cc.
References components(), MillePedeFileConverter_cfg::e, findMode(), plotBeamSpotDB::first, mps_fire::i, localVariance(), M_PI, MultiGaussianState1D::mean(), mean(), mode(), NotValid, pdf(), alignCSCRings::s, edm::second(), size(), mathSSE::sqrt(), standardDeviation(), theMode, theModeStatus, theState, Valid, MultiGaussianState1D::variance(), variance(), w, MultiGaussianState1D::weight(), weight(), x, and y.
Referenced by mode(), modeIsValid(), and variance().
double GaussianSumUtilities1D::d1LnPdf | ( | const double & | x | ) | const |
first derivative of ln(pdf)
Definition at line 322 of file GaussianSumUtilities1D.cc.
References pdfComponents().
Referenced by d2LnPdf(), and variance().
|
private |
first derivative of ln(pdf) using the pdf components at the evaluation point
Definition at line 422 of file GaussianSumUtilities1D.cc.
References d1Pdf(), f, min(), pdf(), and mps_fire::result.
double GaussianSumUtilities1D::d1Pdf | ( | const double & | x | ) | const |
first derivative of the p.d.f.
Definition at line 298 of file GaussianSumUtilities1D.cc.
References pdfComponents().
Referenced by d1LnPdf(), update(), and variance().
|
private |
first derivative of the p.d.f. using the pdf components at the evaluation point
Definition at line 376 of file GaussianSumUtilities1D.cc.
References PVValHelper::dx, mps_fire::i, mean(), mps_fire::result, alignCSCRings::s, size(), and standardDeviation().
double GaussianSumUtilities1D::d2LnPdf | ( | const double & | x | ) | const |
second derivative of ln(pdf)
Definition at line 328 of file GaussianSumUtilities1D.cc.
References pdfComponents().
Referenced by variance().
|
private |
second derivative of ln(pdf) using the pdf components at the evaluation point
Definition at line 433 of file GaussianSumUtilities1D.cc.
References d1LnPdf(), d2Pdf(), f, min(), pdf(), and mps_fire::result.
double GaussianSumUtilities1D::d2Pdf | ( | const double & | x | ) | const |
second derivative of the p.d.f.
Definition at line 304 of file GaussianSumUtilities1D.cc.
References pdfComponents().
Referenced by d2LnPdf(), localVariance(), update(), and variance().
|
private |
second derivative of the p.d.f. using the pdf components at the evaluation point
Definition at line 388 of file GaussianSumUtilities1D.cc.
References PVValHelper::dx, mps_fire::i, mean(), mps_fire::result, alignCSCRings::s, size(), and standardDeviation().
double GaussianSumUtilities1D::d3Pdf | ( | const double & | x | ) | const |
third derivative of the p.d.f.
Definition at line 310 of file GaussianSumUtilities1D.cc.
References pdfComponents().
Referenced by variance().
|
private |
third derivative of the p.d.f. using the pdf components at the evaluation point
Definition at line 400 of file GaussianSumUtilities1D.cc.
References PVValHelper::dx, mps_fire::i, mean(), mps_fire::result, alignCSCRings::s, size(), and standardDeviation().
|
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.
References PVValHelper::dx, min(), mps_fire::result, size(), update(), GaussianSumUtilities1D::FinderState::x, globals_cff::x1, globals_cff::x2, TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, GaussianSumUtilities1D::FinderState::y, GaussianSumUtilities1D::FinderState::yd, and GaussianSumUtilities1D::FinderState::yd2.
Referenced by computeMode(), and variance().
|
staticprivate |
Value of gaussian distribution.
Definition at line 444 of file GaussianSumUtilities1D.cc.
Referenced by pdf(), pdfComponents(), and variance().
|
staticprivate |
Integrated value of gaussian distribution.
Definition at line 457 of file GaussianSumUtilities1D.cc.
Referenced by cdf(), and variance().
double GaussianSumUtilities1D::lnPdf | ( | const double & | x | ) | const |
ln(pdf)
Definition at line 316 of file GaussianSumUtilities1D.cc.
References pdfComponents().
Referenced by variance().
|
staticprivate |
ln(pdf) using the pdf components at the evaluation point
Definition at line 413 of file GaussianSumUtilities1D.cc.
References f, cmsBatch::log, SiStripPI::max, min(), pdf(), and mps_fire::result.
|
private |
Local variance from Hessian matrix. Only valid if x corresponds to a (local) maximum!
Definition at line 477 of file GaussianSumUtilities1D.cc.
References d2Pdf(), pdf(), pdfComponents(), and mps_fire::result.
Referenced by computeMode(), and variance().
|
inline |
mean value of a component
Definition at line 36 of file GaussianSumUtilities1D.h.
References components(), and mps_fire::i.
Referenced by MultiTrajectoryStateMode::chargeFromMode(), GsfTrackProducerBase::fillMode(), MultiTrajectoryStateMode::momentumFromModeLocal(), MultiTrajectoryStateMode::momentumFromModeP(), MultiTrajectoryStateMode::momentumFromModePPhiEta(), MultiTrajectoryStateMode::momentumFromModeQP(), and MultiTrajectoryStateMode::positionFromModeLocal().
|
inline |
combined mean
Definition at line 75 of file GaussianSumUtilities1D.h.
References MultiGaussianState1D::mean(), and theState.
Referenced by cdf(), computeMode(), d1Pdf(), d2Pdf(), d3Pdf(), pdf(), and pdfComponents().
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.
References computeMode(), NotComputed, theMode, and theModeStatus.
Referenced by MultiTrajectoryStateMode::chargeFromMode(), computeMode(), PFGsfHelper::computeQpMode(), ElectronMomentumCorrector::correct(), GsfTrackProducerBase::fillMode(), GsfTrackProducerBase::localParametersFromQpMode(), MultiTrajectoryStateMode::momentumFromModeCartesian(), MultiTrajectoryStateMode::momentumFromModeLocal(), MultiTrajectoryStateMode::momentumFromModeP(), MultiTrajectoryStateMode::momentumFromModePPhiEta(), MultiTrajectoryStateMode::momentumFromModeQP(), PFGsfHelper::PFGsfHelper(), MultiTrajectoryStateMode::positionFromModeCartesian(), MultiTrajectoryStateMode::positionFromModeLocal(), and variance().
bool GaussianSumUtilities1D::modeIsValid | ( | ) | const |
mode status
Definition at line 87 of file GaussianSumUtilities1D.cc.
References computeMode(), NotComputed, theModeStatus, and Valid.
Referenced by MultiTrajectoryStateMode::chargeFromMode(), PFGsfHelper::computeQpMode(), GsfTrackProducerBase::fillMode(), GsfTrackProducerBase::localParametersFromQpMode(), MultiTrajectoryStateMode::momentumFromModeLocal(), MultiTrajectoryStateMode::momentumFromModeP(), MultiTrajectoryStateMode::momentumFromModePPhiEta(), MultiTrajectoryStateMode::momentumFromModeQP(), MultiTrajectoryStateMode::positionFromModeLocal(), and variance().
double GaussianSumUtilities1D::pdf | ( | unsigned int | i, |
double | x | ||
) | const |
pdf of a single component at x
Definition at line 22 of file GaussianSumUtilities1D.cc.
References gauss(), mean(), standardDeviation(), and weight().
Referenced by computeMode(), d1LnPdf(), d2LnPdf(), lnPdf(), localVariance(), pdf(), update(), and variance().
double GaussianSumUtilities1D::pdf | ( | double | x | ) | const |
value of the p.d.f.
Definition at line 278 of file GaussianSumUtilities1D.cc.
References mps_fire::i, pdf(), mps_fire::result, alignCSCRings::s, and size().
|
staticprivate |
value of the p.d.f. using the pdf components at the evaluation point
Definition at line 370 of file GaussianSumUtilities1D.cc.
|
private |
pdf components
Definition at line 334 of file GaussianSumUtilities1D.cc.
References gauss(), mps_fire::i, SingleGaussianState1D::mean(), mean(), mps_fire::result, size(), SingleGaussianState1D::standardDeviation(), standardDeviation(), SingleGaussianState1D::weight(), and x.
Referenced by d1LnPdf(), d1Pdf(), d2LnPdf(), d2Pdf(), d3Pdf(), lnPdf(), localVariance(), and update().
|
private |
pdf components
Definition at line 352 of file GaussianSumUtilities1D.cc.
References begin, components(), end, alignCSCRings::s, size(), and create_public_lumi_plots::transform.
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.
Referenced by variance().
|
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 38 of file GaussianSumUtilities1D.h.
References components(), and mps_fire::i.
Referenced by cdf(), computeMode(), d1Pdf(), d2Pdf(), d3Pdf(), pdf(), and pdfComponents().
|
private |
Definition at line 265 of file GaussianSumUtilities1D.cc.
References d1Pdf(), d2Pdf(), min(), pdf(), pdfComponents(), GaussianSumUtilities1D::FinderState::pdfs, x, GaussianSumUtilities1D::FinderState::x, GaussianSumUtilities1D::FinderState::y, GaussianSumUtilities1D::FinderState::yd, and GaussianSumUtilities1D::FinderState::yd2.
Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), findMode(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().
|
inline |
variance of a component
Definition at line 43 of file GaussianSumUtilities1D.h.
References cdf(), components(), d1LnPdf(), d1Pdf(), d2LnPdf(), d2Pdf(), d3Pdf(), mps_fire::i, lnPdf(), mode(), modeIsValid(), pdf(), quantile(), and x.
Referenced by GsfTrackProducerBase::fillMode().
|
inline |
combined covariance
Definition at line 79 of file GaussianSumUtilities1D.h.
References combinedMean(), computeMode(), findMode(), gauss(), gaussInt(), localVariance(), Scenarios_cff::scale, theState, and MultiGaussianState1D::variance().
Referenced by computeMode().
|
inline |
weight of a component
Definition at line 34 of file GaussianSumUtilities1D.h.
References components(), and mps_fire::i.
|
inline |
combined weight
Definition at line 71 of file GaussianSumUtilities1D.h.
References theState, and MultiGaussianState1D::weight().
Referenced by cdf(), combinedMean(), computeMode(), and pdf().
|
mutableprivate |
Definition at line 139 of file GaussianSumUtilities1D.h.
Referenced by computeMode(), and mode().
|
mutableprivate |
Definition at line 138 of file GaussianSumUtilities1D.h.
Referenced by computeMode(), mode(), and modeIsValid().
|
private |
Definition at line 135 of file GaussianSumUtilities1D.h.
Referenced by components(), computeMode(), mean(), variance(), and weight().