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. &&
233 if (
state.yd2 > 0. && (x2 < xmin || x2 >
xmax))
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 variance() const
combined covariance
double weight() const
combined weight
void computeMode() const
calculation of mode
const std::vector< SingleGaussianState1D > & components() const
components
const MultiGaussianState1D & theState
double mean() const
combined mean
double pdf(unsigned int i, double x) const
pdf of a single component at x
static double gauss(double, double, double)
Value of gaussian distribution.
SingleGaussianState1D theMode
std::vector< double > pdfComponents(const double &) const
pdf components
U second(std::pair< T, U > const &p)
double d2Pdf(const double &) const
second derivative of the p.d.f.
double variance() const
combined variance
static double gaussInt(double, double, double)
Integrated value of gaussian distribution.
double localVariance(double x) const
double standardDeviation() const
standardDeviation
void update(FinderState &state, double x) const
double combinedMean() const
Mean value of combined state.
bool modeIsValid() const
mode status
const SingleGaussianState1D & mode() const
double mean() const
parameter vector
double standardDeviation(unsigned int i) const
standard deviation of a component
double weight() const
weight
double lnPdf(const double &) const
ln(pdf)
double cdf(const double &) const
value of the c.d.f.
bool findMode(double &mode, double &pdfAtMode, const double &xStart, const double &scale) const
unsigned int size() const
number of components
double d3Pdf(const double &) const
third derivative of the p.d.f.
double d2LnPdf(const double &) const
second derivative of ln(pdf)
double weight() const
combined weight
double quantile(const double) const
Quantile (i.e. x for a given value of the c.d.f.)
Log< level::Warning, false > LogWarning
double d1Pdf(const double &) const
first derivative of the p.d.f.
double d1LnPdf(const double &) const
first derivative of ln(pdf)
double mean() const
combined mean