CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes
GaussianSumUtilities1D Class Reference

#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 SingleGaussianState1Dmode () 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 MultiGaussianState1DtheState
 

Detailed Description

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.

Member Enumeration Documentation

◆ ModeStatus

Enumerator
Valid 
NotValid 
NotComputed 

Definition at line 18 of file GaussianSumUtilities1D.h.

Constructor & Destructor Documentation

◆ GaussianSumUtilities1D()

GaussianSumUtilities1D::GaussianSumUtilities1D ( const MultiGaussianState1D state)
inline

Definition at line 21 of file GaussianSumUtilities1D.h.

22  : theState(state),
23  // theStates(state.components()),

◆ ~GaussianSumUtilities1D()

GaussianSumUtilities1D::~GaussianSumUtilities1D ( )
inline

Definition at line 25 of file GaussianSumUtilities1D.h.

25 {}

Member Function Documentation

◆ cdf()

double GaussianSumUtilities1D::cdf ( const double &  x) const

value of the c.d.f.

Definition at line 268 of file GaussianSumUtilities1D.cc.

268  {
269  double result(0.);
270  size_t s = size();
271  for (unsigned int i = 0; i < s; i++)
273  return result;
274 }

References gaussInt(), mps_fire::i, mean(), mps_fire::result, alignCSCRings::s, size(), standardDeviation(), weight(), and x.

◆ combinedMean()

double GaussianSumUtilities1D::combinedMean ( ) const
private

Mean value of combined state.

Definition at line 399 of file GaussianSumUtilities1D.cc.

399  {
400  double s0(0.);
401  double s1(0.);
402  int s = size();
403  SingleGaussianState1D const* __restrict__ sgv = &components().front();
404  for (int i = 0; i < s; i++)
405  s0 += sgv[i].weight();
406  for (int i = 0; i < s; i++)
407  s1 += sgv[i].weight() * sgv[i].mean();
408  return s1 / s0;
409 }

References components(), mps_fire::i, alignCSCRings::s, size(), and weight().

◆ components()

const std::vector<SingleGaussianState1D>& GaussianSumUtilities1D::components ( ) const
inline

◆ computeMode()

void GaussianSumUtilities1D::computeMode ( ) const
private

calculation of mode

Definition at line 91 of file GaussianSumUtilities1D.cc.

91  {
92  // TimerStack tstack;
93  // tstack.benchmark("GSU1D::benchmark",100000);
94  // FastTimerStackPush(tstack,"GaussianSumUtilities1D::computeMode");
96  //
97  // check for "degenerate" states (identical values with vanishing error)
98  //
99  if (theState.variance() < 1.e-14) {
102  return;
103  }
104  //
105  // Use means of individual components as start values.
106  // Sort by value of pdf.
107  //
108  typedef std::multimap<double, int, std::greater<double> > StartMap;
109  StartMap xStart;
110  for (unsigned int i = 0; i < size(); i++) {
111  xStart.insert(std::make_pair(pdf(mean(i)), i));
112  }
113  //
114  // Now try with each start value
115  //
116  int iRes(-1); // index of start component for current estimate
117  double xRes(mean((*xStart.begin()).second)); // current estimate of mode
118  double yRes(-1.); // pdf at current estimate of mode
119  // std::pair<double,double> result(-1.,mean((*xStart.begin()).second));
120  for (StartMap::const_iterator i = xStart.begin(); i != xStart.end(); i++) {
121  //
122  // Convergence radius for a single Gaussian = 1 sigma: don't try
123  // start values within 1 sigma of the current solution
124  //
125  if (theModeStatus == Valid && fabs(mean((*i).second) - mean(iRes)) / standardDeviation(iRes) < 1.)
126  continue;
127  //
128  // If a solution exists: drop as soon as the pdf at
129  // start value drops to < 75% of maximum (try to avoid
130  // unnecessary searches for the mode)
131  //
132  if (theModeStatus == Valid && (*i).first / (*xStart.begin()).first < 0.75)
133  break;
134  //
135  // Try to find mode
136  //
137  double x;
138  double y;
139  bool valid = findMode(x, y, mean((*i).second), standardDeviation((*i).second));
140  //
141  // consider only successful searches
142  //
143  if (valid) { //...
144  //
145  // update result only for significant changes in pdf(solution)
146  //
147  if (yRes < 0. || (y - yRes) / (y + yRes) > 1.e-10) {
148  iRes = (*i).second; // store index
149  theModeStatus = Valid; // update status
150  xRes = x; // current solution
151  yRes = y; // and its pdf value
152  // result = std::make_pair(y,x); // store solution and pdf(solution)
153  }
154  } //...
155  }
156  //
157  // check (existance of) solution
158  //
159  if (theModeStatus == Valid) {
160  //
161  // Construct single Gaussian state with
162  // mean = mode
163  // variance = local variance at mode
164  // weight such that the pdf's of the mixture and the
165  // single state are equal at the mode
166  //
167  double mode = xRes;
168  double varMode = localVariance(mode);
169  double wgtMode = pdf(mode) * sqrt(2 * M_PI * varMode);
170  theMode = SingleGaussianState1D(mode, varMode, wgtMode);
171  } else {
172  //
173  // mode finding failed: set solution to highest component
174  // (alternative would be global mean / variance ..?)
175  //
176  //two many log warnings to actually be useful - comment out
177  //edm::LogWarning("GaussianSumUtilities") << "1D mode calculation failed";
178  // double x = mean();
179  // double y = pdf(x);
180  // result = std::make_pair(y,x);
181  // theMode = SingleGaussianState1D(mean(),variance(),weight());
182  //
183  // look for component with highest value at mean
184  //
185  int icMax(0);
186  double ySqMax(0.);
187  int s = size();
188  for (int ic = 0; ic < s; ++ic) {
189  double w = weight(ic);
190  double ySq = w * w / variance(ic);
191  if (ySq > ySqMax) {
192  icMax = ic;
193  ySqMax = ySq;
194  }
195  }
197  }
198 }

References components(), MillePedeFileConverter_cfg::e, findMode(), 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().

◆ d1LnPdf() [1/2]

double GaussianSumUtilities1D::d1LnPdf ( const double &  x) const

first derivative of ln(pdf)

Definition at line 284 of file GaussianSumUtilities1D.cc.

284 { return d1LnPdf(x, pdfComponents(x)); }

References pdfComponents(), and x.

Referenced by d2LnPdf().

◆ d1LnPdf() [2/2]

double GaussianSumUtilities1D::d1LnPdf ( double  x,
const std::vector< double > &  pdfs 
) const
private

first derivative of ln(pdf) using the pdf components at the evaluation point

Definition at line 365 of file GaussianSumUtilities1D.cc.

365  {
366  double f = pdf(x, pdfs);
367  double result(d1Pdf(x, pdfs));
369  result /= f;
370  else
371  result = 0.;
372  return result;
373 }

References d1Pdf(), f, min(), pdf(), mps_fire::result, and x.

◆ d1Pdf() [1/2]

double GaussianSumUtilities1D::d1Pdf ( const double &  x) const

first derivative of the p.d.f.

Definition at line 276 of file GaussianSumUtilities1D.cc.

276 { return d1Pdf(x, pdfComponents(x)); }

References pdfComponents(), and x.

Referenced by d1LnPdf(), and update().

◆ d1Pdf() [2/2]

double GaussianSumUtilities1D::d1Pdf ( double  x,
const std::vector< double > &  pdfs 
) const
private

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

Definition at line 327 of file GaussianSumUtilities1D.cc.

327  {
328  double result(0.);
329  size_t s = size();
330  for (unsigned int i = 0; i < s; i++) {
331  double dx = (x - mean(i)) / standardDeviation(i);
332  result += -pdfs[i] * dx / standardDeviation(i);
333  }
334  return result;
335 }

References PVValHelper::dx, mps_fire::i, mean(), mps_fire::result, alignCSCRings::s, size(), standardDeviation(), and x.

◆ d2LnPdf() [1/2]

double GaussianSumUtilities1D::d2LnPdf ( const double &  x) const

second derivative of ln(pdf)

Definition at line 286 of file GaussianSumUtilities1D.cc.

286 { return d2LnPdf(x, pdfComponents(x)); }

References pdfComponents(), and x.

◆ d2LnPdf() [2/2]

double GaussianSumUtilities1D::d2LnPdf ( double  x,
const std::vector< double > &  pdfs 
) const
private

second derivative of ln(pdf) using the pdf components at the evaluation point

Definition at line 375 of file GaussianSumUtilities1D.cc.

375  {
376  double f = pdf(x, pdfs);
377  double df = d1LnPdf(x, pdfs);
378  double result(-df * df);
380  result += d2Pdf(x, pdfs) / f;
381  return result;
382 }

References d1LnPdf(), d2Pdf(), hgcalPerformanceValidation::df, f, min(), pdf(), mps_fire::result, and x.

◆ d2Pdf() [1/2]

double GaussianSumUtilities1D::d2Pdf ( const double &  x) const

second derivative of the p.d.f.

Definition at line 278 of file GaussianSumUtilities1D.cc.

278 { return d2Pdf(x, pdfComponents(x)); }

References pdfComponents(), and x.

Referenced by d2LnPdf(), localVariance(), and update().

◆ d2Pdf() [2/2]

double GaussianSumUtilities1D::d2Pdf ( double  x,
const std::vector< double > &  pdfs 
) const
private

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

Definition at line 337 of file GaussianSumUtilities1D.cc.

337  {
338  double result(0.);
339  size_t s = size();
340  for (unsigned int i = 0; i < s; i++) {
341  double dx = (x - mean(i)) / standardDeviation(i);
342  result += pdfs[i] / standardDeviation(i) / standardDeviation(i) * (dx * dx - 1);
343  }
344  return result;
345 }

References PVValHelper::dx, mps_fire::i, mean(), mps_fire::result, alignCSCRings::s, size(), standardDeviation(), and x.

◆ d3Pdf() [1/2]

double GaussianSumUtilities1D::d3Pdf ( const double &  x) const

third derivative of the p.d.f.

Definition at line 280 of file GaussianSumUtilities1D.cc.

280 { return d3Pdf(x, pdfComponents(x)); }

References pdfComponents(), and x.

◆ d3Pdf() [2/2]

double GaussianSumUtilities1D::d3Pdf ( double  x,
const std::vector< double > &  pdfs 
) const
private

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

Definition at line 347 of file GaussianSumUtilities1D.cc.

347  {
348  double result(0.);
349  size_t s = size();
350  for (unsigned int i = 0; i < s; i++) {
351  double dx = (x - mean(i)) / standardDeviation(i);
352  result += pdfs[i] / standardDeviation(i) / standardDeviation(i) / standardDeviation(i) * (-dx * dx + 3) * dx;
353  }
354  return result;
355 }

References PVValHelper::dx, mps_fire::i, mean(), mps_fire::result, alignCSCRings::s, size(), standardDeviation(), and x.

◆ findMode()

bool GaussianSumUtilities1D::findMode ( double &  mode,
double &  pdfAtMode,
const double &  xStart,
const double &  scale 
) const
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.

200  {
201  //
202  // try with Newton on (lnPdf)'(x)
203  //
204  double x1(0.);
205  double y1(0.);
206  FinderState state(size());
207  update(state, xStart);
208 
209  double xmin(xStart - 1. * scale);
210  double xmax(xStart + 1. * scale);
211  //
212  // preset result
213  //
214  bool result(false);
215  xMode = state.x;
216  yMode = state.y;
217  //
218  // Iterate
219  //
220  int nLoop(0);
221  while (nLoop++ < 20) {
222  if (nLoop > 1 && state.yd2 < 0. &&
223  (fabs(state.yd * scale) < 1.e-10 || fabs(state.y - y1) / (state.y + y1) < 1.e-14)) {
224  result = true;
225  break;
226  }
227  if (fabs(state.yd2) < std::numeric_limits<float>::min())
228  state.yd2 = state.yd2 > 0. ? std::numeric_limits<float>::min() : -std::numeric_limits<float>::min();
229  double dx = -state.yd / state.yd2;
230  x1 = state.x;
231  y1 = state.y;
232  double x2 = x1 + dx;
233  if (state.yd2 > 0. && (x2 < xmin || x2 > xmax))
234  return false;
235  update(state, x2);
236  }
237  //
238  // result
239  //
240  if (result) {
241  xMode = state.x;
242  yMode = state.y;
243  }
244  return result;
245 }

References PVValHelper::dx, min(), mps_fire::result, L1EGammaCrystalsEmulatorProducer_cfi::scale, size(), update(), testProducerWithPsetDescEmpty_cfi::x1, testProducerWithPsetDescEmpty_cfi::x2, TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, and testProducerWithPsetDescEmpty_cfi::y1.

Referenced by computeMode().

◆ gauss()

double GaussianSumUtilities1D::gauss ( double  x,
double  mean,
double  sigma 
)
staticprivate

Value of gaussian distribution.

Definition at line 384 of file GaussianSumUtilities1D.cc.

384  {
385  // const double fNorm(1./sqrt(2*M_PI));
386  // double result(0.);
387 
388  // double d((x-mean)/sigma);
389  // if ( fabs(d)<20. ) result = exp(-d*d/2.);
390  // result *= fNorm/sigma;
391  // return result;
392  return ROOT::Math::gaussian_pdf(x, sigma, mean);
393 }

References mean(), and x.

Referenced by pdf(), and pdfComponents().

◆ gaussInt()

double GaussianSumUtilities1D::gaussInt ( double  x,
double  mean,
double  sigma 
)
staticprivate

Integrated value of gaussian distribution.

Definition at line 395 of file GaussianSumUtilities1D.cc.

395  {
396  return ROOT::Math::normal_cdf(x, sigma, mean);
397 }

References mean(), and x.

Referenced by cdf().

◆ lnPdf() [1/2]

double GaussianSumUtilities1D::lnPdf ( const double &  x) const

ln(pdf)

Definition at line 282 of file GaussianSumUtilities1D.cc.

282 { return lnPdf(x, pdfComponents(x)); }

References pdfComponents(), and x.

◆ lnPdf() [2/2]

double GaussianSumUtilities1D::lnPdf ( double  x,
const std::vector< double > &  pdfs 
)
staticprivate

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

Definition at line 357 of file GaussianSumUtilities1D.cc.

357  {
358  double f(pdf(x, pdfs));
361  result = log(f);
362  return result;
363 }

References f, dqm-mbProfile::log, SiStripPI::max, min(), pdf(), mps_fire::result, and x.

◆ localVariance()

double GaussianSumUtilities1D::localVariance ( double  x) const
private

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

Definition at line 411 of file GaussianSumUtilities1D.cc.

411  {
412  std::vector<double> pdfs;
413  pdfComponents(x, pdfs);
414  double result = -pdf(x, pdfs) / d2Pdf(x, pdfs);
415  // FIXME: wrong curvature seems to be non-existant but should add a proper recovery
416  if (result < 0.)
417  edm::LogWarning("GaussianSumUtilities") << "1D variance at mode < 0";
418  return result;
419 }

References d2Pdf(), pdf(), pdfComponents(), mps_fire::result, and x.

Referenced by computeMode().

◆ mean() [1/2]

double GaussianSumUtilities1D::mean ( ) const
inline

combined mean

Definition at line 71 of file GaussianSumUtilities1D.h.

71 { return theState.mean(); }

References MultiGaussianState1D::mean(), and theState.

Referenced by cdf(), computeMode(), d1Pdf(), d2Pdf(), d3Pdf(), gauss(), gaussInt(), pdf(), and pdfComponents().

◆ mean() [2/2]

double GaussianSumUtilities1D::mean ( unsigned int  i) const
inline

mean value of a component

Definition at line 34 of file GaussianSumUtilities1D.h.

34 { return components()[i].mean(); }

References components(), and mps_fire::i.

Referenced by multiTrajectoryStateMode::momentumFromModePPhiEta().

◆ mode()

const SingleGaussianState1D & GaussianSumUtilities1D::mode ( void  ) const

◆ modeIsValid()

bool GaussianSumUtilities1D::modeIsValid ( ) const

◆ pdf() [1/3]

double GaussianSumUtilities1D::pdf ( double  x) const

value of the p.d.f.

Definition at line 260 of file GaussianSumUtilities1D.cc.

260  {
261  double result(0.);
262  size_t s = size();
263  for (unsigned int i = 0; i < s; i++)
264  result += pdf(i, x);
265  return result;
266 }

References mps_fire::i, pdf(), mps_fire::result, alignCSCRings::s, size(), and x.

◆ pdf() [2/3]

double GaussianSumUtilities1D::pdf ( double  ,
const std::vector< double > &  pdfs 
)
staticprivate

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

Definition at line 323 of file GaussianSumUtilities1D.cc.

323  {
324  return std::accumulate(pdfs.begin(), pdfs.end(), 0.);
325 }

◆ pdf() [3/3]

double GaussianSumUtilities1D::pdf ( unsigned int  i,
double  x 
) const

pdf of a single component at x

Definition at line 21 of file GaussianSumUtilities1D.cc.

21  {
22  return weight(i) * gauss(x, mean(i), standardDeviation(i));
23 }

References gauss(), mps_fire::i, mean(), standardDeviation(), weight(), and x.

Referenced by computeMode(), d1LnPdf(), d2LnPdf(), lnPdf(), localVariance(), pdf(), and update().

◆ pdfComponents() [1/2]

std::vector< double > GaussianSumUtilities1D::pdfComponents ( const double &  x) const
private

pdf components

Definition at line 288 of file GaussianSumUtilities1D.cc.

288  {
289  std::vector<double> result;
290  result.reserve(size());
291  for (unsigned int i = 0; i < size(); i++)
292  result.push_back(weight(i) * gauss(x, mean(i), standardDeviation(i)));
293  return result;
294 }

References gauss(), mps_fire::i, mean(), mps_fire::result, size(), standardDeviation(), and x.

Referenced by d1LnPdf(), d1Pdf(), d2LnPdf(), d2Pdf(), d3Pdf(), lnPdf(), localVariance(), and update().

◆ pdfComponents() [2/2]

void GaussianSumUtilities1D::pdfComponents ( double  x,
std::vector< double > &  result 
) const
private

pdf components

Definition at line 305 of file GaussianSumUtilities1D.cc.

305  {
306  size_t s = size();
307  if (s != result.size())
308  result.resize(s);
309  std::transform(components().begin(), components().end(), result.begin(), PDF(x));
310 }

References components(), mps_fire::end, ExhumeParameters_cfi::PDF, mps_fire::result, alignCSCRings::s, size(), HcalDetIdTransform::transform(), and x.

◆ quantile()

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.

25 { return ROOT::Math::gaussian_quantile(q, 1.); }

References submitPVResolutionJobs::q.

◆ size()

unsigned int GaussianSumUtilities1D::size ( void  ) const
inline

◆ standardDeviation()

double GaussianSumUtilities1D::standardDeviation ( unsigned int  i) const
inline

standard deviation of a component

Definition at line 36 of file GaussianSumUtilities1D.h.

36  {
37  // return sqrt(components()[i].variance());
38  return components()[i].standardDeviation();
39  }

References components(), and mps_fire::i.

Referenced by cdf(), computeMode(), d1Pdf(), d2Pdf(), d3Pdf(), pdf(), and pdfComponents().

◆ update()

void GaussianSumUtilities1D::update ( FinderState state,
double  x 
) const
private

Definition at line 247 of file GaussianSumUtilities1D.cc.

247  {
248  state.x = x;
249 
250  pdfComponents(state.x, state.pdfs);
251  state.y = pdf(state.x, state.pdfs);
252  state.yd = 0;
254  state.yd = d1Pdf(state.x, state.pdfs) / state.y;
255  state.yd2 = -state.yd * state.yd;
257  state.yd2 += d2Pdf(state.x, state.pdfs) / state.y;
258 }

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().

◆ variance() [1/2]

double GaussianSumUtilities1D::variance ( ) const
inline

combined covariance

Definition at line 73 of file GaussianSumUtilities1D.h.

73 { return theState.variance(); }

References theState, and MultiGaussianState1D::variance().

Referenced by computeMode().

◆ variance() [2/2]

double GaussianSumUtilities1D::variance ( unsigned int  i) const
inline

variance of a component

Definition at line 41 of file GaussianSumUtilities1D.h.

41 { return components()[i].variance(); }

References components(), and mps_fire::i.

◆ weight() [1/2]

double GaussianSumUtilities1D::weight ( ) const
inline

combined weight

Definition at line 69 of file GaussianSumUtilities1D.h.

69 { return theState.weight(); }

References theState, and MultiGaussianState1D::weight().

Referenced by cdf(), combinedMean(), computeMode(), and pdf().

◆ weight() [2/2]

double GaussianSumUtilities1D::weight ( unsigned int  i) const
inline

weight of a component

Definition at line 32 of file GaussianSumUtilities1D.h.

32 { return components()[i].weight(); }

References components(), and mps_fire::i.

Member Data Documentation

◆ theMode

SingleGaussianState1D GaussianSumUtilities1D::theMode
mutableprivate

Definition at line 130 of file GaussianSumUtilities1D.h.

Referenced by computeMode(), and mode().

◆ theModeStatus

ModeStatus GaussianSumUtilities1D::theModeStatus
mutableprivate

Definition at line 129 of file GaussianSumUtilities1D.h.

Referenced by computeMode(), mode(), and modeIsValid().

◆ theState

const MultiGaussianState1D& GaussianSumUtilities1D::theState
private

Definition at line 126 of file GaussianSumUtilities1D.h.

Referenced by components(), computeMode(), mean(), variance(), and weight().

GaussianSumUtilities1D::localVariance
double localVariance(double x) const
Definition: GaussianSumUtilities1D.cc:411
GaussianSumUtilities1D::gaussInt
static double gaussInt(double, double, double)
Integrated value of gaussian distribution.
Definition: GaussianSumUtilities1D.cc:395
DDAxes::y
mps_fire.i
i
Definition: mps_fire.py:428
GaussianSumUtilities1D::mode
const SingleGaussianState1D & mode() const
Definition: GaussianSumUtilities1D.cc:85
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
MultiGaussianState1D::weight
double weight() const
combined weight
Definition: MultiGaussianState1D.cc:5
L1EGammaCrystalsEmulatorProducer_cfi.scale
scale
Definition: L1EGammaCrystalsEmulatorProducer_cfi.py:10
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
min
T min(T a, T b)
Definition: MathUtil.h:58
testProducerWithPsetDescEmpty_cfi.x2
x2
Definition: testProducerWithPsetDescEmpty_cfi.py:28
GaussianSumUtilities1D::lnPdf
double lnPdf(const double &) const
ln(pdf)
Definition: GaussianSumUtilities1D.cc:282
GaussianSumUtilities1D::standardDeviation
double standardDeviation(unsigned int i) const
standard deviation of a component
Definition: GaussianSumUtilities1D.h:36
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
GaussianSumUtilities1D::findMode
bool findMode(double &mode, double &pdfAtMode, const double &xStart, const double &scale) const
Definition: GaussianSumUtilities1D.cc:200
GaussianSumUtilities1D::size
unsigned int size() const
number of components
Definition: GaussianSumUtilities1D.h:28
GaussianSumUtilities1D::d2LnPdf
double d2LnPdf(const double &) const
second derivative of ln(pdf)
Definition: GaussianSumUtilities1D.cc:286
DDAxes::x
ExhumeParameters_cfi.PDF
PDF
Definition: ExhumeParameters_cfi.py:8
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
GaussianSumUtilities1D::d3Pdf
double d3Pdf(const double &) const
third derivative of the p.d.f.
Definition: GaussianSumUtilities1D.cc:280
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
alignCSCRings.s
s
Definition: alignCSCRings.py:92
testProducerWithPsetDescEmpty_cfi.y1
y1
Definition: testProducerWithPsetDescEmpty_cfi.py:29
GaussianSumUtilities1D::weight
double weight() const
combined weight
Definition: GaussianSumUtilities1D.h:69
GaussianSumUtilities1D::d1LnPdf
double d1LnPdf(const double &) const
first derivative of ln(pdf)
Definition: GaussianSumUtilities1D.cc:284
w
const double w
Definition: UKUtility.cc:23
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
mps_fire.end
end
Definition: mps_fire.py:242
GaussianSumUtilities1D::d1Pdf
double d1Pdf(const double &) const
first derivative of the p.d.f.
Definition: GaussianSumUtilities1D.cc:276
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition: HcalDetIdTransform.cc:7
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
GaussianSumUtilities1D::mean
double mean() const
combined mean
Definition: GaussianSumUtilities1D.h:71
GaussianSumUtilities1D::components
const std::vector< SingleGaussianState1D > & components() const
components
Definition: GaussianSumUtilities1D.h:30
GaussianSumUtilities1D::NotComputed
Definition: GaussianSumUtilities1D.h:18
GaussianSumUtilities1D::theState
const MultiGaussianState1D & theState
Definition: GaussianSumUtilities1D.h:126
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
GaussianSumUtilities1D::variance
double variance() const
combined covariance
Definition: GaussianSumUtilities1D.h:73
SingleGaussianState1D
Definition: SingleGaussianState1D.h:10
GaussianSumUtilities1D::computeMode
void computeMode() const
calculation of mode
Definition: GaussianSumUtilities1D.cc:91
MultiGaussianState1D::components
const SingleState1dContainer & components() const
access to components
Definition: MultiGaussianState1D.h:30
GaussianSumUtilities1D::pdf
double pdf(unsigned int i, double x) const
pdf of a single component at x
Definition: GaussianSumUtilities1D.cc:21
GaussianSumUtilities1D::Valid
Definition: GaussianSumUtilities1D.h:18
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
MultiGaussianState1D::mean
double mean() const
combined mean
Definition: MultiGaussianState1D.cc:15
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
GaussianSumUtilities1D::theModeStatus
ModeStatus theModeStatus
Definition: GaussianSumUtilities1D.h:129
std
Definition: JetResolutionObject.h:76
MultiGaussianState1D::variance
double variance() const
combined variance
Definition: MultiGaussianState1D.cc:20
GaussianSumUtilities1D::gauss
static double gauss(double, double, double)
Value of gaussian distribution.
Definition: GaussianSumUtilities1D.cc:384
RunInfoPI::state
state
Definition: RunInfoPayloadInspectoHelper.h:16
hgcalPerformanceValidation.df
df
Definition: hgcalPerformanceValidation.py:733
TrackerOfflineValidation_Dqm_cff.xmax
xmax
Definition: TrackerOfflineValidation_Dqm_cff.py:11
GaussianSumUtilities1D::theMode
SingleGaussianState1D theMode
Definition: GaussianSumUtilities1D.h:130
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
GaussianSumUtilities1D::d2Pdf
double d2Pdf(const double &) const
second derivative of the p.d.f.
Definition: GaussianSumUtilities1D.cc:278
GaussianSumUtilities1D::pdfComponents
std::vector< double > pdfComponents(const double &) const
pdf components
Definition: GaussianSumUtilities1D.cc:288
mps_fire.result
result
Definition: mps_fire.py:311
RunInfoPI::valid
Definition: RunInfoPayloadInspectoHelper.h:16
TrackerOfflineValidation_Dqm_cff.xmin
xmin
Definition: TrackerOfflineValidation_Dqm_cff.py:10
GaussianSumUtilities1D::NotValid
Definition: GaussianSumUtilities1D.h:18
GaussianSumUtilities1D::update
void update(FinderState &state, double x) const
Definition: GaussianSumUtilities1D.cc:247
PVValHelper::dx
Definition: PVValidationHelpers.h:49
weight
Definition: weight.py:1
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37