|
|
Go to the documentation of this file.
9 #include "Math/ProbFuncMathCore.h"
10 #include "Math/PdfFuncMathCore.h"
11 #include "Math/QuantFuncMathCore.h"
108 typedef std::multimap<double, int, std::greater<double> > StartMap;
110 for (
unsigned int i = 0;
i <
size();
i++) {
111 xStart.insert(std::make_pair(
pdf(
mean(
i)),
i));
120 for (StartMap::const_iterator
i = xStart.begin();
i != xStart.end();
i++) {
147 if (yRes < 0. || (
y - yRes) / (
y + yRes) > 1.
e-10) {
188 for (
int ic = 0; ic <
s; ++ic) {
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)) {
229 double dx = -state.
yd / state.
yd2;
233 if (state.
yd2 > 0. && (x2 < xmin || x2 >
xmax))
255 state.
yd2 = -state.
yd * state.
yd;
263 for (
unsigned int i = 0;
i <
s;
i++)
271 for (
unsigned int i = 0;
i <
s;
i++)
289 std::vector<double>
result;
291 for (
unsigned int i = 0;
i <
size();
i++)
298 PDF(
double ix) :
x(ix) {}
324 return std::accumulate(pdfs.begin(), pdfs.end(), 0.);
330 for (
unsigned int i = 0;
i <
s;
i++) {
340 for (
unsigned int i = 0;
i <
s;
i++) {
350 for (
unsigned int i = 0;
i <
s;
i++) {
358 double f(
pdf(
x, pdfs));
366 double f =
pdf(
x, pdfs);
376 double f =
pdf(
x, pdfs);
392 return ROOT::Math::gaussian_pdf(
x, sigma,
mean);
396 return ROOT::Math::normal_cdf(
x, sigma,
mean);
404 for (
int i = 0;
i <
s;
i++)
406 for (
int i = 0;
i <
s;
i++)
407 s1 += sgv[
i].
weight() * sgv[
i].mean();
412 std::vector<double> pdfs;
double localVariance(double x) const
static double gaussInt(double, double, double)
Integrated value of gaussian distribution.
double combinedMean() const
Mean value of combined state.
const SingleGaussianState1D & mode() const
double weight() const
combined weight
double lnPdf(const double &) const
ln(pdf)
double standardDeviation(unsigned int i) const
standard deviation of a component
double cdf(const double &) const
value of the c.d.f.
U second(std::pair< T, U > const &p)
bool findMode(double &mode, double &pdfAtMode, const double &xStart, const double &scale) const
unsigned int size() const
number of components
double d2LnPdf(const double &) const
second derivative of ln(pdf)
double mean() const
parameter vector
double d3Pdf(const double &) const
third derivative of the p.d.f.
double quantile(const double) const
Quantile (i.e. x for a given value of the c.d.f.)
double weight() const
combined weight
double d1LnPdf(const double &) const
first derivative of ln(pdf)
double d1Pdf(const double &) const
first derivative of the p.d.f.
double mean() const
combined mean
const std::vector< SingleGaussianState1D > & components() const
components
double weight() const
weight
const MultiGaussianState1D & theState
double variance() const
combined covariance
void computeMode() const
calculation of mode
double pdf(unsigned int i, double x) const
pdf of a single component at x
double mean() const
combined mean
double variance() const
combined variance
static double gauss(double, double, double)
Value of gaussian distribution.
SingleGaussianState1D theMode
std::vector< double > pdfs
double d2Pdf(const double &) const
second derivative of the p.d.f.
std::vector< double > pdfComponents(const double &) const
pdf components
void update(FinderState &state, double x) const
bool modeIsValid() const
mode status
double standardDeviation() const
standardDeviation