ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ProbFuncMathCore.h
Go to the documentation of this file.
1 // @(#)root/mathcore:$Id$
2 // Authors: L. Moneta, A. Zsenei 06/2005
3 
4 /**********************************************************************
5  * *
6  * Copyright (c) 2005 , LCG ROOT MathLib Team *
7  * *
8  * *
9  **********************************************************************/
10 
11 
12 #if defined(__CINT__) && !defined(__MAKECINT__)
13 // avoid to include header file when using CINT
14 #ifndef _WIN32
15 #include "../lib/libMathCore.so"
16 #else
17 #include "../bin/libMathCore.dll"
18 #endif
19 
20 #else
21 
22 
23 #ifndef ROOT_Math_ProbFuncMathCore
24 #define ROOT_Math_ProbFuncMathCore
25 
26 
27 namespace ROOT {
28 namespace Math {
29 
30 
31  /** @defgroup ProbFunc Cumulative Distribution Functions (CDF)
32 
33  @ingroup StatFunc
34 
35  * Cumulative distribution functions of various distributions.
36  * The functions with the extension <em>_cdf</em> calculate the
37  * lower tail integral of the probability density function
38  *
39  * \f[ D(x) = \int_{-\infty}^{x} p(x') dx' \f]
40  *
41  * while those with the <em>_cdf_c</em> extension calculate the complement of
42  * cumulative distribution function, called in statistics the survival
43  * function.
44  * It corresponds to the upper tail integral of the
45  * probability density function
46  *
47  * \f[ D(x) = \int_{x}^{+\infty} p(x') dx' \f]
48  *
49  *
50  * <strong>NOTE:</strong> In the old releases (< 5.14) the <em>_cdf</em> functions were called
51  * <em>_quant</em> and the <em>_cdf_c</em> functions were called
52  * <em>_prob</em>.
53  * These names are currently kept for backward compatibility, but
54  * their usage is deprecated.
55  *
56  * These functions are defined in the header file <em>Math/ProbFunc.h<em> or in the global one
57  * including all statistical dunctions <em>Math/DistFunc.h<em>
58  *
59  */
60 
61 
62 
63  /**
64 
65  Complement of the cumulative distribution function of the beta distribution.
66  Upper tail of the integral of the #beta_pdf
67 
68  @ingroup ProbFunc
69 
70  */
71 
72  double beta_cdf_c(double x, double a, double b);
73 
74 
75 
76  /**
77 
78  Cumulative distribution function of the beta distribution
79  Upper tail of the integral of the #beta_pdf
80 
81  @ingroup ProbFunc
82 
83  */
84 
85  double beta_cdf(double x, double a, double b);
86 
87 
88 
89 
90  /**
91 
92  Complement of the cumulative distribution function (upper tail) of the Breit_Wigner
93  distribution and it is similar (just a different parameter definition) to the
94  Cauchy distribution (see #cauchy_cdf_c )
95 
96  \f[ D(x) = \int_{x}^{+\infty} \frac{1}{\pi} \frac{\frac{1}{2} \Gamma}{x'^2 + (\frac{1}{2} \Gamma)^2} dx' \f]
97 
98 
99  @ingroup ProbFunc
100 
101  */
102  double breitwigner_cdf_c(double x, double gamma, double x0 = 0);
103 
104 
105  /**
106 
107  Cumulative distribution function (lower tail) of the Breit_Wigner
108  distribution and it is similar (just a different parameter definition) to the
109  Cauchy distribution (see #cauchy_cdf )
110 
111  \f[ D(x) = \int_{-\infty}^{x} \frac{1}{\pi} \frac{b}{x'^2 + (\frac{1}{2} \Gamma)^2} dx' \f]
112 
113 
114  @ingroup ProbFunc
115 
116  */
117  double breitwigner_cdf(double x, double gamma, double x0 = 0);
118 
119 
120 
121  /**
122 
123  Complement of the cumulative distribution function (upper tail) of the
124  Cauchy distribution which is also Lorentzian distribution.
125  It is similar (just a different parameter definition) to the
126  Breit_Wigner distribution (see #breitwigner_cdf_c )
127 
128  \f[ D(x) = \int_{x}^{+\infty} \frac{1}{\pi} \frac{ b }{ (x'-m)^2 + b^2} dx' \f]
129 
130  For detailed description see
131  <A HREF="http://mathworld.wolfram.com/CauchyDistribution.html">
132  Mathworld</A>.
133 
134  @ingroup ProbFunc
135 
136  */
137  double cauchy_cdf_c(double x, double b, double x0 = 0);
138 
139 
140 
141 
142  /**
143 
144  Cumulative distribution function (lower tail) of the
145  Cauchy distribution which is also Lorentzian distribution.
146  It is similar (just a different parameter definition) to the
147  Breit_Wigner distribution (see #breitwigner_cdf )
148 
149  \f[ D(x) = \int_{-\infty}^{x} \frac{1}{\pi} \frac{ b }{ (x'-m)^2 + b^2} dx' \f]
150 
151  For detailed description see
152  <A HREF="http://mathworld.wolfram.com/CauchyDistribution.html">
153  Mathworld</A>.
154 
155 
156  @ingroup ProbFunc
157 
158  */
159  double cauchy_cdf(double x, double b, double x0 = 0);
160 
161 
162 
163 
164  /**
165 
166  Complement of the cumulative distribution function of the \f$\chi^2\f$ distribution
167  with \f$r\f$ degrees of freedom (upper tail).
168 
169  \f[ D_{r}(x) = \int_{x}^{+\infty} \frac{1}{\Gamma(r/2) 2^{r/2}} x'^{r/2-1} e^{-x'/2} dx' \f]
170 
171  For detailed description see
172  <A HREF="http://mathworld.wolfram.com/Chi-SquaredDistribution.html">
173  Mathworld</A>. It is implemented using the incomplete gamma function, ROOT::Math::inc_gamma_c,
174  from <A HREF="http://www.netlib.org/cephes">Cephes</A>
175 
176  @ingroup ProbFunc
177 
178  */
179 
180  double chisquared_cdf_c(double x, double r, double x0 = 0);
181 
182 
183 
184  /**
185 
186  Cumulative distribution function of the \f$\chi^2\f$ distribution
187  with \f$r\f$ degrees of freedom (lower tail).
188 
189  \f[ D_{r}(x) = \int_{-\infty}^{x} \frac{1}{\Gamma(r/2) 2^{r/2}} x'^{r/2-1} e^{-x'/2} dx' \f]
190 
191  For detailed description see
192  <A HREF="http://mathworld.wolfram.com/Chi-SquaredDistribution.html">
193  Mathworld</A>. It is implemented using the incomplete gamma function, ROOT::Math::inc_gamma_c,
194  from <A HREF="http://www.netlib.org/cephes">Cephes</A>
195 
196  @ingroup ProbFunc
197 
198  */
199 
200  double chisquared_cdf(double x, double r, double x0 = 0);
201 
202 
203  /**
204 
205  Cumulative distribution for the Crystal Ball distribution function
206 
207  See the definition of the Crystal Ball function at
208  <A HREF="http://en.wikipedia.org/wiki/Crystal_Ball_function">
209  Wikipedia</A>.
210 
211  The distribution is defined only for n > 1 when the integral converges
212 
213  @ingroup ProbFunc
214 
215  */
216  double crystalball_cdf(double x, double alpha, double n, double sigma, double x0 = 0);
217 
218  /**
219 
220  Complement of the Cumulative distribution for the Crystal Ball distribution
221 
222  See the definition of the Crystal Ball function at
223  <A HREF="http://en.wikipedia.org/wiki/Crystal_Ball_function">
224  Wikipedia</A>.
225 
226  The distribution is defined only for n > 1 when the integral converges
227 
228  @ingroup ProbFunc
229 
230  */
231  double crystalball_cdf_c(double x, double alpha, double n, double sigma, double x0 = 0);
232 
233  /**
234  Integral of the not-normalized Crystal Ball function
235 
236  See the definition of the Crystal Ball function at
237  <A HREF="http://en.wikipedia.org/wiki/Crystal_Ball_function">
238  Wikipedia</A>.
239 
240  see ROOT::Math::crystalball_function for the function evaluation.
241 
242  @ingroup ProbFunc
243 
244  */
245  double crystalball_integral(double x, double alpha, double n, double sigma, double x0 = 0);
246 
247  /**
248 
249  Complement of the cumulative distribution function of the exponential distribution
250  (upper tail).
251 
252  \f[ D(x) = \int_{x}^{+\infty} \lambda e^{-\lambda x'} dx' \f]
253 
254  For detailed description see
255  <A HREF="http://mathworld.wolfram.com/ExponentialDistribution.html">
256  Mathworld</A>.
257 
258  @ingroup ProbFunc
259 
260  */
261 
262  double exponential_cdf_c(double x, double lambda, double x0 = 0);
263 
264 
265 
266  /**
267 
268  Cumulative distribution function of the exponential distribution
269  (lower tail).
270 
271  \f[ D(x) = \int_{-\infty}^{x} \lambda e^{-\lambda x'} dx' \f]
272 
273  For detailed description see
274  <A HREF="http://mathworld.wolfram.com/ExponentialDistribution.html">
275  Mathworld</A>.
276 
277  @ingroup ProbFunc
278 
279  */
280 
281 
282  double exponential_cdf(double x, double lambda, double x0 = 0);
283 
284 
285 
286  /**
287 
288  Complement of the cumulative distribution function of the F-distribution
289  (upper tail).
290 
291  \f[ D_{n,m}(x) = \int_{x}^{+\infty} \frac{\Gamma(\frac{n+m}{2})}{\Gamma(\frac{n}{2}) \Gamma(\frac{m}{2})} n^{n/2} m^{m/2} x'^{n/2 -1} (m+nx')^{-(n+m)/2} dx' \f]
292 
293  For detailed description see
294  <A HREF="http://mathworld.wolfram.com/F-Distribution.html">
295  Mathworld</A>. It is implemented using the incomplete beta function, ROOT::Math::inc_beta,
296  from <A HREF="http://www.netlib.org/cephes">Cephes</A>
297 
298  @ingroup ProbFunc
299 
300  */
301 
302  double fdistribution_cdf_c(double x, double n, double m, double x0 = 0);
303 
304 
305 
306 
307  /**
308 
309  Cumulative distribution function of the F-distribution
310  (lower tail).
311 
312  \f[ D_{n,m}(x) = \int_{-\infty}^{x} \frac{\Gamma(\frac{n+m}{2})}{\Gamma(\frac{n}{2}) \Gamma(\frac{m}{2})} n^{n/2} m^{m/2} x'^{n/2 -1} (m+nx')^{-(n+m)/2} dx' \f]
313 
314  For detailed description see
315  <A HREF="http://mathworld.wolfram.com/F-Distribution.html">
316  Mathworld</A>. It is implemented using the incomplete beta function, ROOT::Math::inc_beta,
317  from <A HREF="http://www.netlib.org/cephes">Cephes</A>
318 
319  @ingroup ProbFunc
320 
321  */
322 
323  double fdistribution_cdf(double x, double n, double m, double x0 = 0);
324 
325 
326 
327  /**
328 
329  Complement of the cumulative distribution function of the gamma distribution
330  (upper tail).
331 
332  \f[ D(x) = \int_{x}^{+\infty} {1 \over \Gamma(\alpha) \theta^{\alpha}} x'^{\alpha-1} e^{-x'/\theta} dx' \f]
333 
334  For detailed description see
335  <A HREF="http://mathworld.wolfram.com/GammaDistribution.html">
336  Mathworld</A>. It is implemented using the incomplete gamma function, ROOT::Math::inc_gamma,
337  from <A HREF="http://www.netlib.org/cephes">Cephes</A>
338 
339  @ingroup ProbFunc
340 
341  */
342 
343  double gamma_cdf_c(double x, double alpha, double theta, double x0 = 0);
344 
345 
346 
347 
348  /**
349 
350  Cumulative distribution function of the gamma distribution
351  (lower tail).
352 
353  \f[ D(x) = \int_{-\infty}^{x} {1 \over \Gamma(\alpha) \theta^{\alpha}} x'^{\alpha-1} e^{-x'/\theta} dx' \f]
354 
355  For detailed description see
356  <A HREF="http://mathworld.wolfram.com/GammaDistribution.html">
357  Mathworld</A>. It is implemented using the incomplete gamma function, ROOT::Math::inc_gamma,
358  from <A HREF="http://www.netlib.org/cephes">Cephes</A>
359 
360  @ingroup ProbFunc
361 
362  */
363 
364  double gamma_cdf(double x, double alpha, double theta, double x0 = 0);
365 
366 
367 
368  /**
369 
370  Cumulative distribution function of the Landau
371  distribution (lower tail).
372 
373  \f[ D(x) = \int_{-\infty}^{x} p(x) dx \f]
374 
375  where \f$p(x)\f$ is the Landau probability density function :
376  \f[ p(x) = \frac{1}{\xi} \phi (\lambda) \f]
377  with
378  \f[ \phi(\lambda) = \frac{1}{2 \pi i}\int_{c-i\infty}^{c+i\infty} e^{\lambda s + s \log{s}} ds\f]
379  with \f$\lambda = (x-x_0)/\xi\f$. For a detailed description see
380  K.S. K&ouml;lbig and B. Schorr, A program package for the Landau distribution,
381  <A HREF="http://dx.doi.org/10.1016/0010-4655(84)90085-7">Computer Phys. Comm. 31 (1984) 97-111</A>
382  <A HREF="http://dx.doi.org/10.1016/j.cpc.2008.03.002">[Erratum-ibid. 178 (2008) 972]</A>.
383  The same algorithms as in
384  <A HREF="http://wwwasdoc.web.cern.ch/wwwasdoc/shortwrupsdir/g110/top.html">
385  CERNLIB</A> (DISLAN) is used.
386 
387  @param x The argument \f$x\f$
388  @param xi The width parameter \f$\xi\f$
389  @param x0 The location parameter \f$x_0\f$
390 
391  @ingroup ProbFunc
392 
393  */
394 
395  double landau_cdf(double x, double xi = 1, double x0 = 0);
396 
397  /**
398 
399  Complement of the distribution function of the Landau
400  distribution (upper tail).
401 
402  \f[ D(x) = \int_{x}^{+\infty} p(x) dx \f]
403 
404  where p(x) is the Landau probability density function.
405  It is implemented simply as 1. - #landau_cdf
406 
407  @param x The argument \f$x\f$
408  @param xi The width parameter \f$\xi\f$
409  @param x0 The location parameter \f$x_0\f$
410 
411  @ingroup ProbFunc
412 
413  */
414  inline double landau_cdf_c(double x, double xi = 1, double x0 = 0) {
415  return 1. - landau_cdf(x,xi,x0);
416  }
417 
418  /**
419 
420  Complement of the cumulative distribution function of the lognormal distribution
421  (upper tail).
422 
423  \f[ D(x) = \int_{x}^{+\infty} {1 \over x' \sqrt{2 \pi s^2} } e^{-(\ln{x'} - m)^2/2 s^2} dx' \f]
424 
425  For detailed description see
426  <A HREF="http://mathworld.wolfram.com/LogNormalDistribution.html">
427  Mathworld</A>.
428 
429  @ingroup ProbFunc
430 
431  */
432 
433  double lognormal_cdf_c(double x, double m, double s, double x0 = 0);
434 
435 
436 
437 
438  /**
439 
440  Cumulative distribution function of the lognormal distribution
441  (lower tail).
442 
443  \f[ D(x) = \int_{-\infty}^{x} {1 \over x' \sqrt{2 \pi s^2} } e^{-(\ln{x'} - m)^2/2 s^2} dx' \f]
444 
445  For detailed description see
446  <A HREF="http://mathworld.wolfram.com/LogNormalDistribution.html">
447  Mathworld</A>.
448 
449  @ingroup ProbFunc
450 
451  */
452 
453  double lognormal_cdf(double x, double m, double s, double x0 = 0);
454 
455 
456 
457 
458  /**
459 
460  Complement of the cumulative distribution function of the normal (Gaussian)
461  distribution (upper tail).
462 
463  \f[ D(x) = \int_{x}^{+\infty} {1 \over \sqrt{2 \pi \sigma^2}} e^{-x'^2 / 2\sigma^2} dx' \f]
464 
465  For detailed description see
466  <A HREF="http://mathworld.wolfram.com/NormalDistribution.html">
467  Mathworld</A>.
468 
469  @ingroup ProbFunc
470 
471  */
472 
473  double normal_cdf_c(double x, double sigma = 1, double x0 = 0);
474  /// Alternative name for same function
475  inline double gaussian_cdf_c(double x, double sigma = 1, double x0 = 0) {
476  return normal_cdf_c(x,sigma,x0);
477  }
478 
479 
480 
481  /**
482 
483  Cumulative distribution function of the normal (Gaussian)
484  distribution (lower tail).
485 
486  \f[ D(x) = \int_{-\infty}^{x} {1 \over \sqrt{2 \pi \sigma^2}} e^{-x'^2 / 2\sigma^2} dx' \f]
487 
488  For detailed description see
489  <A HREF="http://mathworld.wolfram.com/NormalDistribution.html">
490  Mathworld</A>.
491  @ingroup ProbFunc
492 
493  */
494 
495  double normal_cdf(double x, double sigma = 1, double x0 = 0);
496  /// Alternative name for same function
497  inline double gaussian_cdf(double x, double sigma = 1, double x0 = 0) {
498  return normal_cdf(x,sigma,x0);
499  }
500 
501 
502 
503  /**
504 
505  Complement of the cumulative distribution function of Student's
506  t-distribution (upper tail).
507 
508  \f[ D_{r}(x) = \int_{x}^{+\infty} \frac{\Gamma(\frac{r+1}{2})}{\sqrt{r \pi}\Gamma(\frac{r}{2})} \left( 1+\frac{x'^2}{r}\right)^{-(r+1)/2} dx' \f]
509 
510  For detailed description see
511  <A HREF="http://mathworld.wolfram.com/Studentst-Distribution.html">
512  Mathworld</A>. It is implemented using the incomplete beta function, ROOT::Math::inc_beta,
513  from <A HREF="http://www.netlib.org/cephes">Cephes</A>
514 
515  @ingroup ProbFunc
516 
517  */
518 
519  double tdistribution_cdf_c(double x, double r, double x0 = 0);
520 
521 
522 
523 
524  /**
525 
526  Cumulative distribution function of Student's
527  t-distribution (lower tail).
528 
529  \f[ D_{r}(x) = \int_{-\infty}^{x} \frac{\Gamma(\frac{r+1}{2})}{\sqrt{r \pi}\Gamma(\frac{r}{2})} \left( 1+\frac{x'^2}{r}\right)^{-(r+1)/2} dx' \f]
530 
531  For detailed description see
532  <A HREF="http://mathworld.wolfram.com/Studentst-Distribution.html">
533  Mathworld</A>. It is implemented using the incomplete beta function, ROOT::Math::inc_beta,
534  from <A HREF="http://www.netlib.org/cephes">Cephes</A>
535 
536  @ingroup ProbFunc
537 
538  */
539 
540  double tdistribution_cdf(double x, double r, double x0 = 0);
541 
542 
543  /**
544 
545  Complement of the cumulative distribution function of the uniform (flat)
546  distribution (upper tail).
547 
548  \f[ D(x) = \int_{x}^{+\infty} {1 \over (b-a)} dx' \f]
549 
550  For detailed description see
551  <A HREF="http://mathworld.wolfram.com/UniformDistribution.html">
552  Mathworld</A>.
553 
554  @ingroup ProbFunc
555 
556  */
557 
558  double uniform_cdf_c(double x, double a, double b, double x0 = 0);
559 
560 
561 
562 
563  /**
564 
565  Cumulative distribution function of the uniform (flat)
566  distribution (lower tail).
567 
568  \f[ D(x) = \int_{-\infty}^{x} {1 \over (b-a)} dx' \f]
569 
570  For detailed description see
571  <A HREF="http://mathworld.wolfram.com/UniformDistribution.html">
572  Mathworld</A>.
573 
574  @ingroup ProbFunc
575 
576  */
577 
578  double uniform_cdf(double x, double a, double b, double x0 = 0);
579 
580 
581 
582 
583  /**
584 
585  Complement of the cumulative distribution function of the Poisson distribution.
586  Upper tail of the integral of the #poisson_pdf
587 
588  @ingroup ProbFunc
589 
590  */
591 
592  double poisson_cdf_c(unsigned int n, double mu);
593 
594  /**
595 
596  Cumulative distribution function of the Poisson distribution
597  Lower tail of the integral of the #poisson_pdf
598 
599  @ingroup ProbFunc
600 
601  */
602 
603  double poisson_cdf(unsigned int n, double mu);
604 
605  /**
606 
607  Complement of the cumulative distribution function of the Binomial distribution.
608  Upper tail of the integral of the #binomial_pdf
609 
610  @ingroup ProbFunc
611 
612  */
613 
614  double binomial_cdf_c(unsigned int k, double p, unsigned int n);
615 
616  /**
617 
618  Cumulative distribution function of the Binomial distribution
619  Lower tail of the integral of the #binomial_pdf
620 
621  @ingroup ProbFunc
622 
623  */
624 
625  double binomial_cdf(unsigned int k, double p, unsigned int n);
626 
627 
628  /**
629 
630  Complement of the cumulative distribution function of the Negative Binomial distribution.
631  Upper tail of the integral of the #negative_binomial_pdf
632 
633  @ingroup ProbFunc
634 
635  */
636 
637  double negative_binomial_cdf_c(unsigned int k, double p, double n);
638 
639  /**
640 
641  Cumulative distribution function of the Negative Binomial distribution
642  Lower tail of the integral of the #negative_binomial_pdf
643 
644  @ingroup ProbFunc
645 
646  */
647 
648  double negative_binomial_cdf(unsigned int k, double p, double n);
649 
650 
651 
652 #ifdef HAVE_OLD_STAT_FUNC
653 
654  /** @name Backward compatible MathCore CDF functions */
655 
656 
657  inline double breitwigner_prob(double x, double gamma, double x0 = 0) {
658  return breitwigner_cdf_c(x,gamma,x0);
659  }
660  inline double breitwigner_quant(double x, double gamma, double x0 = 0) {
661  return breitwigner_cdf(x,gamma,x0);
662  }
663 
664  inline double cauchy_prob(double x, double b, double x0 = 0) {
665  return cauchy_cdf_c(x,b,x0);
666  }
667  inline double cauchy_quant(double x, double b, double x0 = 0) {
668  return cauchy_cdf (x,b,x0);
669  }
670  inline double chisquared_prob(double x, double r, double x0 = 0) {
671  return chisquared_cdf_c(x, r, x0);
672  }
673  inline double chisquared_quant(double x, double r, double x0 = 0) {
674  return chisquared_cdf (x, r, x0);
675  }
676  inline double exponential_prob(double x, double lambda, double x0 = 0) {
677  return exponential_cdf_c(x, lambda, x0 );
678  }
679  inline double exponential_quant(double x, double lambda, double x0 = 0) {
680  return exponential_cdf (x, lambda, x0 );
681  }
682 
683  inline double gaussian_prob(double x, double sigma, double x0 = 0) {
684  return gaussian_cdf_c( x, sigma, x0 );
685  }
686  inline double gaussian_quant(double x, double sigma, double x0 = 0) {
687  return gaussian_cdf ( x, sigma, x0 );
688  }
689 
690  inline double lognormal_prob(double x, double m, double s, double x0 = 0) {
691  return lognormal_cdf_c( x, m, s, x0 );
692  }
693  inline double lognormal_quant(double x, double m, double s, double x0 = 0) {
694  return lognormal_cdf ( x, m, s, x0 );
695  }
696 
697  inline double normal_prob(double x, double sigma, double x0 = 0) {
698  return normal_cdf_c( x, sigma, x0 );
699  }
700  inline double normal_quant(double x, double sigma, double x0 = 0) {
701  return normal_cdf ( x, sigma, x0 );
702  }
703 
704  inline double uniform_prob(double x, double a, double b, double x0 = 0) {
705  return uniform_cdf_c( x, a, b, x0 );
706  }
707  inline double uniform_quant(double x, double a, double b, double x0 = 0) {
708  return uniform_cdf ( x, a, b, x0 );
709  }
710  inline double fdistribution_prob(double x, double n, double m, double x0 = 0) {
711  return fdistribution_cdf_c (x, n, m, x0);
712  }
713  inline double fdistribution_quant(double x, double n, double m, double x0 = 0) {
714  return fdistribution_cdf (x, n, m, x0);
715  }
716 
717  inline double gamma_prob(double x, double alpha, double theta, double x0 = 0) {
718  return gamma_cdf_c (x, alpha, theta, x0);
719  }
720  inline double gamma_quant(double x, double alpha, double theta, double x0 = 0) {
721  return gamma_cdf (x, alpha, theta, x0);
722  }
723 
724  inline double tdistribution_prob(double x, double r, double x0 = 0) {
725  return tdistribution_cdf_c (x, r, x0);
726  }
727 
728  inline double tdistribution_quant(double x, double r, double x0 = 0) {
729  return tdistribution_cdf (x, r, x0);
730  }
731 
732 #endif
733 
734  /** @defgroup TruncFunc Statistical functions from truncated distributions
735 
736  @ingroup StatFunc
737 
738  Statistical functions for the truncated distributions. Examples of such functions are the
739  first or the second momentum of the truncated distribution.
740  In the case of the Landau, first and second momentum functions are provided for the Landau
741  distribution truncated only on the right side.
742  These functions are defined in the header file <em>Math/ProbFunc.h<em> or in the global one
743  including all statistical dunctions <em>Math/StatFunc.h<em>
744 
745  */
746 
747  /**
748 
749  First moment (mean) of the truncated Landau distribution.
750  \f[ \frac{1}{D (x)} \int_{-\infty}^{x} t\, p(t) d t \f]
751  where \f$p(x)\f$ is the Landau distribution
752  and \f$D(x)\f$ its cumulative distribution function.
753 
754  For detailed description see
755  K.S. K&ouml;lbig and B. Schorr, A program package for the Landau distribution,
756  <A HREF="http://dx.doi.org/10.1016/0010-4655(84)90085-7">Computer Phys. Comm. 31 (1984) 97-111</A>
757  <A HREF="http://dx.doi.org/10.1016/j.cpc.2008.03.002">[Erratum-ibid. 178 (2008) 972]</A>.
758  The same algorithms as in
759  <A HREF="http://wwwasdoc.web.cern.ch/wwwasdoc/shortwrupsdir/g110/top.html">
760  CERNLIB</A> (XM1LAN) is used
761 
762  @param x The argument \f$x\f$
763  @param xi The width parameter \f$\xi\f$
764  @param x0 The location parameter \f$x_0\f$
765 
766  @ingroup TruncFunc
767 
768  */
769 
770  double landau_xm1(double x, double xi = 1, double x0 = 0);
771 
772 
773 
774  /**
775 
776  Second moment of the truncated Landau distribution.
777  \f[ \frac{1}{D (x)} \int_{-\infty}^{x} t^2\, p(t) d t \f]
778  where \f$p(x)\f$ is the Landau distribution
779  and \f$D(x)\f$ its cumulative distribution function.
780 
781  For detailed description see
782  K.S. K&ouml;lbig and B. Schorr, A program package for the Landau distribution,
783  <A HREF="http://dx.doi.org/10.1016/0010-4655(84)90085-7">Computer Phys. Comm. 31 (1984) 97-111</A>
784  <A HREF="http://dx.doi.org/10.1016/j.cpc.2008.03.002">[Erratum-ibid. 178 (2008) 972]</A>.
785  The same algorithms as in
786  <A HREF="http://wwwasdoc.web.cern.ch/wwwasdoc/shortwrupsdir/g110/top.html">
787  CERNLIB</A> (XM1LAN) is used
788 
789  @param x The argument \f$x\f$
790  @param xi The width parameter \f$\xi\f$
791  @param x0 The location parameter \f$x_0\f$
792 
793  @ingroup TruncFunc
794 
795  */
796 
797  double landau_xm2(double x, double xi = 1, double x0 = 0);
798 
799 
800 
801 } // namespace Math
802 } // namespace ROOT
803 
804 
805 #endif // ROOT_Math_ProbFuncMathCore
806 
807 #endif // if defined (__CINT__) && !defined(__MAKECINT__)
double tdistribution_cdf(double x, double r, double x0=0)
Cumulative distribution function of Student's t-distribution (lower tail).
double binomial_cdf(unsigned int k, double p, unsigned int n)
Cumulative distribution function of the Binomial distribution Lower tail of the integral of the binom...
double landau_cdf_c(double x, double xi=1, double x0=0)
Complement of the distribution function of the Landau distribution (upper tail).
Float_t theta
Definition: shapesAnim.C:5
double crystalball_cdf(double x, double alpha, double n, double sigma, double x0=0)
Cumulative distribution for the Crystal Ball distribution function.
double negative_binomial_cdf_c(unsigned int k, double p, double n)
Complement of the cumulative distribution function of the Negative Binomial distribution.
double poisson_cdf(unsigned int n, double mu)
Cumulative distribution function of the Poisson distribution Lower tail of the integral of the poisso...
double poisson_cdf_c(unsigned int n, double mu)
Complement of the cumulative distribution function of the Poisson distribution.
double binomial_cdf_c(unsigned int k, double p, unsigned int n)
Complement of the cumulative distribution function of the Binomial distribution.
double gamma_cdf_c(double x, double alpha, double theta, double x0=0)
Complement of the cumulative distribution function of the gamma distribution (upper tail)...
TArc * a
Definition: textangle.C:12
double uniform_cdf_c(double x, double a, double b, double x0=0)
Complement of the cumulative distribution function of the uniform (flat) distribution (upper tail)...
double landau_xm1(double x, double xi=1, double x0=0)
First moment (mean) of the truncated Landau distribution.
double lognormal_cdf(double x, double m, double s, double x0=0)
Cumulative distribution function of the lognormal distribution (lower tail).
double negative_binomial_cdf(unsigned int k, double p, double n)
Cumulative distribution function of the Negative Binomial distribution Lower tail of the integral of ...
Double_t x[n]
Definition: legend1.C:17
double fdistribution_cdf_c(double x, double n, double m, double x0=0)
Complement of the cumulative distribution function of the F-distribution (upper tail).
double normal_cdf(double x, double sigma=1, double x0=0)
Cumulative distribution function of the normal (Gaussian) distribution (lower tail).
double cauchy_cdf_c(double x, double b, double x0=0)
Complement of the cumulative distribution function (upper tail) of the Cauchy distribution which is a...
double fdistribution_cdf(double x, double n, double m, double x0=0)
Cumulative distribution function of the F-distribution (lower tail).
const Double_t sigma
double uniform_cdf(double x, double a, double b, double x0=0)
Cumulative distribution function of the uniform (flat) distribution (lower tail). ...
double beta_cdf(double x, double a, double b)
Cumulative distribution function of the beta distribution Upper tail of the integral of the beta_pdf...
double breitwigner_cdf(double x, double gamma, double x0=0)
Cumulative distribution function (lower tail) of the Breit_Wigner distribution and it is similar (jus...
double landau_cdf(double x, double xi=1, double x0=0)
Cumulative distribution function of the Landau distribution (lower tail).
double landau_xm2(double x, double xi=1, double x0=0)
Second moment of the truncated Landau distribution.
double gamma(double x)
ROOT::R::TRInterface & r
Definition: Object.C:4
double exponential_cdf_c(double x, double lambda, double x0=0)
Complement of the cumulative distribution function of the exponential distribution (upper tail)...
double cauchy_cdf(double x, double b, double x0=0)
Cumulative distribution function (lower tail) of the Cauchy distribution which is also Lorentzian dis...
TMarker * m
Definition: textangle.C:8
double normal_cdf_c(double x, double sigma=1, double x0=0)
Complement of the cumulative distribution function of the normal (Gaussian) distribution (upper tail)...
double tdistribution_cdf_c(double x, double r, double x0=0)
Complement of the cumulative distribution function of Student's t-distribution (upper tail)...
double gaussian_cdf_c(double x, double sigma=1, double x0=0)
Alternative name for same function.
double gaussian_cdf(double x, double sigma=1, double x0=0)
Alternative name for same function.
double beta_cdf_c(double x, double a, double b)
Complement of the cumulative distribution function of the beta distribution.
double gamma_cdf(double x, double alpha, double theta, double x0=0)
Cumulative distribution function of the gamma distribution (lower tail).
double chisquared_cdf_c(double x, double r, double x0=0)
Complement of the cumulative distribution function of the distribution with degrees of freedom (upp...
double crystalball_integral(double x, double alpha, double n, double sigma, double x0=0)
Integral of the not-normalized Crystal Ball function.
double chisquared_cdf(double x, double r, double x0=0)
Cumulative distribution function of the distribution with degrees of freedom (lower tail)...
double breitwigner_cdf_c(double x, double gamma, double x0=0)
Complement of the cumulative distribution function (upper tail) of the Breit_Wigner distribution and ...
double crystalball_cdf_c(double x, double alpha, double n, double sigma, double x0=0)
Complement of the Cumulative distribution for the Crystal Ball distribution.
const Int_t n
Definition: legend1.C:16
double lognormal_cdf_c(double x, double m, double s, double x0=0)
Complement of the cumulative distribution function of the lognormal distribution (upper tail)...
double exponential_cdf(double x, double lambda, double x0=0)
Cumulative distribution function of the exponential distribution (lower tail).