#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 |
|
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(), i, mean(), query::result, alignCSCRings::s, size(), standardDeviation(), and weight().
|
private |
Mean value of combined state.
Definition at line 463 of file GaussianSumUtilities1D.cc.
References components(), 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 101 of file GaussianSumUtilities1D.cc.
References components(), alignCSCRings::e, findMode(), first, i, localVariance(), M_PI, MultiGaussianState1D::mean(), mean(), mode(), NotValid, pdf(), alignCSCRings::s, edm::second(), size(), mathSSE::sqrt(), standardDeviation(), theMode, theModeStatus, theState, Valid, TrackValidation_HighPurity_cff::valid, MultiGaussianState1D::variance(), variance(), w(), MultiGaussianState1D::weight(), weight(), x, and detailsBasic3DVector::y.
Referenced by mode(), and modeIsValid().
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().
|
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, bookConverter::min, pdf(), and query::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(), and update().
|
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 i, mean(), query::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().
|
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, bookConverter::min, pdf(), and query::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(), and update().
|
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 i, mean(), query::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().
|
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 i, mean(), query::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 bookConverter::min, query::result, size(), update(), GaussianSumUtilities1D::FinderState::x, SiStripMonitorClusterAlca_cfi::xmax, SiStripMonitorClusterAlca_cfi::xmin, GaussianSumUtilities1D::FinderState::y, GaussianSumUtilities1D::FinderState::yd, and GaussianSumUtilities1D::FinderState::yd2.
Referenced by computeMode().
|
staticprivate |
Value of gaussian distribution.
Definition at line 444 of file GaussianSumUtilities1D.cc.
Referenced by pdf(), and pdfComponents().
|
staticprivate |
Integrated value of gaussian distribution.
Definition at line 457 of file GaussianSumUtilities1D.cc.
Referenced by cdf().
double GaussianSumUtilities1D::lnPdf | ( | const double & | x | ) | const |
ln(pdf)
Definition at line 316 of file GaussianSumUtilities1D.cc.
References pdfComponents().
|
staticprivate |
ln(pdf) using the pdf components at the evaluation point
Definition at line 413 of file GaussianSumUtilities1D.cc.
References f, create_public_lumi_plots::log, max(), bookConverter::min, pdf(), and query::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 query::result.
Referenced by computeMode().
|
inline |
mean value of a component
Definition at line 36 of file GaussianSumUtilities1D.h.
References components(), and 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(), and MultiTrajectoryStateMode::positionFromModeLocal().
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(), and MultiTrajectoryStateMode::positionFromModeLocal().
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(), and update().
double GaussianSumUtilities1D::pdf | ( | double | x | ) | const |
value of the p.d.f.
Definition at line 278 of file GaussianSumUtilities1D.cc.
References i, pdf(), query::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(), i, mean(), query::result, size(), standardDeviation(), and weight().
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.
|
inline |
number of components
Definition at line 28 of file GaussianSumUtilities1D.h.
References components().
Referenced by 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 i.
Referenced by cdf(), computeMode(), d1Pdf(), d2Pdf(), d3Pdf(), pdf(), and pdfComponents().
|
private |
Definition at line 265 of file GaussianSumUtilities1D.cc.
References d1Pdf(), d2Pdf(), bookConverter::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__(), relval_steps.Matrix::__setitem__(), relval_steps.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(), relval_steps.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 components(), and i.
Referenced by GsfTrackProducerBase::fillMode().
|
inline |
combined covariance
Definition at line 79 of file GaussianSumUtilities1D.h.
References theState, and MultiGaussianState1D::variance().
Referenced by computeMode().
|
inline |
weight of a component
Definition at line 34 of file GaussianSumUtilities1D.h.
References components(), and i.
Referenced by cuy.ValElement::__init__(), cuy.additionElement::__init__(), cuy.superimposeElement::__init__(), and cuy.graphElement::__init__().
|
inline |
combined weight
Definition at line 71 of file GaussianSumUtilities1D.h.
References theState, and MultiGaussianState1D::weight().
Referenced by cuy.ValElement::__init__(), cuy.additionElement::__init__(), cuy.superimposeElement::__init__(), cuy.graphElement::__init__(), cdf(), combinedMean(), computeMode(), pdf(), and pdfComponents().
|
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().