00001 // @(#)root/mathcore:$Id: ProbFuncMathCore.h 37441 2010-12-09 16:27:54Z moneta $ 00002 // Authors: L. Moneta, A. Zsenei 06/2005 00003 00004 /********************************************************************** 00005 * * 00006 * Copyright (c) 2005 , LCG ROOT MathLib Team * 00007 * * 00008 * * 00009 **********************************************************************/ 00010 00011 00012 #if defined(__CINT__) && !defined(__MAKECINT__) 00013 // avoid to include header file when using CINT 00014 #ifndef _WIN32 00015 #include "../lib/libMathCore.so" 00016 #else 00017 #include "../bin/libMathCore.dll" 00018 #endif 00019 00020 #else 00021 00022 00023 #ifndef ROOT_Math_ProbFuncMathCore 00024 #define ROOT_Math_ProbFuncMathCore 00025 00026 namespace ROOT { 00027 namespace Math { 00028 00029 00030 /** @defgroup ProbFunc Cumulative Distribution Functions (CDF) 00031 00032 @ingroup StatFunc 00033 00034 * Cumulative distribution functions of various distributions. 00035 * The functions with the extension <em>_cdf</em> calculate the 00036 * lower tail integral of the probability density function 00037 * 00038 * \f[ D(x) = \int_{-\infty}^{x} p(x') dx' \f] 00039 * 00040 * while those with the <em>_cdf_c</em> extension calculate the complement of 00041 * cumulative distribution function, called in statistics the survival 00042 * function. 00043 * It corresponds to the upper tail integral of the 00044 * probability density function 00045 * 00046 * \f[ D(x) = \int_{x}^{+\infty} p(x') dx' \f] 00047 * 00048 * 00049 * <strong>NOTE:</strong> In the old releases (< 5.14) the <em>_cdf</em> functions were called 00050 * <em>_quant</em> and the <em>_cdf_c</em> functions were called 00051 * <em>_prob</em>. 00052 * These names are currently kept for backward compatibility, but 00053 * their usage is deprecated. 00054 * 00055 * These functions are defined in the header file <em>Math/ProbFunc.h<em> or in the global one 00056 * including all statistical dunctions <em>Math/DistFunc.h<em> 00057 * 00058 */ 00059 00060 00061 00062 /** 00063 00064 Complement of the cumulative distribution function of the beta distribution. 00065 Upper tail of the integral of the #beta_pdf 00066 00067 @ingroup ProbFunc 00068 00069 */ 00070 00071 double beta_cdf_c(double x, double a, double b); 00072 00073 00074 00075 /** 00076 00077 Cumulative distribution function of the beta distribution 00078 Upper tail of the integral of the #beta_pdf 00079 00080 @ingroup ProbFunc 00081 00082 */ 00083 00084 double beta_cdf(double x, double a, double b); 00085 00086 00087 00088 00089 /** 00090 00091 Complement of the cumulative distribution function (upper tail) of the Breit_Wigner 00092 distribution and it is similar (just a different parameter definition) to the 00093 Cauchy distribution (see #cauchy_cdf_c ) 00094 00095 \f[ D(x) = \int_{x}^{+\infty} \frac{1}{\pi} \frac{\frac{1}{2} \Gamma}{x'^2 + (\frac{1}{2} \Gamma)^2} dx' \f] 00096 00097 00098 @ingroup ProbFunc 00099 00100 */ 00101 double breitwigner_cdf_c(double x, double gamma, double x0 = 0); 00102 00103 00104 /** 00105 00106 Cumulative distribution function (lower tail) of the Breit_Wigner 00107 distribution and it is similar (just a different parameter definition) to the 00108 Cauchy distribution (see #cauchy_cdf ) 00109 00110 \f[ D(x) = \int_{-\infty}^{x} \frac{1}{\pi} \frac{b}{x'^2 + (\frac{1}{2} \Gamma)^2} dx' \f] 00111 00112 00113 @ingroup ProbFunc 00114 00115 */ 00116 double breitwigner_cdf(double x, double gamma, double x0 = 0); 00117 00118 00119 00120 /** 00121 00122 Complement of the cumulative distribution function (upper tail) of the 00123 Cauchy distribution which is also Lorentzian distribution. 00124 It is similar (just a different parameter definition) to the 00125 Breit_Wigner distribution (see #breitwigner_cdf_c ) 00126 00127 \f[ D(x) = \int_{x}^{+\infty} \frac{1}{\pi} \frac{ b }{ (x'-m)^2 + b^2} dx' \f] 00128 00129 For detailed description see 00130 <A HREF="http://mathworld.wolfram.com/CauchyDistribution.html"> 00131 Mathworld</A>. 00132 00133 @ingroup ProbFunc 00134 00135 */ 00136 double cauchy_cdf_c(double x, double b, double x0 = 0); 00137 00138 00139 00140 00141 /** 00142 00143 Cumulative distribution function (lower tail) of the 00144 Cauchy distribution which is also Lorentzian distribution. 00145 It is similar (just a different parameter definition) to the 00146 Breit_Wigner distribution (see #breitwigner_cdf ) 00147 00148 \f[ D(x) = \int_{-\infty}^{x} \frac{1}{\pi} \frac{ b }{ (x'-m)^2 + b^2} dx' \f] 00149 00150 For detailed description see 00151 <A HREF="http://mathworld.wolfram.com/CauchyDistribution.html"> 00152 Mathworld</A>. 00153 00154 00155 @ingroup ProbFunc 00156 00157 */ 00158 double cauchy_cdf(double x, double b, double x0 = 0); 00159 00160 00161 00162 00163 /** 00164 00165 Complement of the cumulative distribution function of the \f$\chi^2\f$ distribution 00166 with \f$r\f$ degrees of freedom (upper tail). 00167 00168 \f[ D_{r}(x) = \int_{x}^{+\infty} \frac{1}{\Gamma(r/2) 2^{r/2}} x'^{r/2-1} e^{-x'/2} dx' \f] 00169 00170 For detailed description see 00171 <A HREF="http://mathworld.wolfram.com/Chi-SquaredDistribution.html"> 00172 Mathworld</A>. It is implemented using the incomplete gamma function, ROOT::Math::inc_gamma_c, 00173 from <A HREF="http://www.netlib.org/cephes">Cephes</A> 00174 00175 @ingroup ProbFunc 00176 00177 */ 00178 00179 double chisquared_cdf_c(double x, double r, double x0 = 0); 00180 00181 00182 00183 /** 00184 00185 Cumulative distribution function of the \f$\chi^2\f$ distribution 00186 with \f$r\f$ degrees of freedom (lower tail). 00187 00188 \f[ D_{r}(x) = \int_{-\infty}^{x} \frac{1}{\Gamma(r/2) 2^{r/2}} x'^{r/2-1} e^{-x'/2} dx' \f] 00189 00190 For detailed description see 00191 <A HREF="http://mathworld.wolfram.com/Chi-SquaredDistribution.html"> 00192 Mathworld</A>. It is implemented using the incomplete gamma function, ROOT::Math::inc_gamma_c, 00193 from <A HREF="http://www.netlib.org/cephes">Cephes</A> 00194 00195 @ingroup ProbFunc 00196 00197 */ 00198 00199 double chisquared_cdf(double x, double r, double x0 = 0); 00200 00201 00202 00203 /** 00204 00205 Complement of the cumulative distribution function of the exponential distribution 00206 (upper tail). 00207 00208 \f[ D(x) = \int_{x}^{+\infty} \lambda e^{-\lambda x'} dx' \f] 00209 00210 For detailed description see 00211 <A HREF="http://mathworld.wolfram.com/ExponentialDistribution.html"> 00212 Mathworld</A>. 00213 00214 @ingroup ProbFunc 00215 00216 */ 00217 00218 double exponential_cdf_c(double x, double lambda, double x0 = 0); 00219 00220 00221 00222 /** 00223 00224 Cumulative distribution function of the exponential distribution 00225 (lower tail). 00226 00227 \f[ D(x) = \int_{-\infty}^{x} \lambda e^{-\lambda x'} dx' \f] 00228 00229 For detailed description see 00230 <A HREF="http://mathworld.wolfram.com/ExponentialDistribution.html"> 00231 Mathworld</A>. 00232 00233 @ingroup ProbFunc 00234 00235 */ 00236 00237 00238 double exponential_cdf(double x, double lambda, double x0 = 0); 00239 00240 00241 00242 /** 00243 00244 Complement of the cumulative distribution function of the F-distribution 00245 (upper tail). 00246 00247 \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] 00248 00249 For detailed description see 00250 <A HREF="http://mathworld.wolfram.com/F-Distribution.html"> 00251 Mathworld</A>. It is implemented using the incomplete beta function, ROOT::Math::inc_beta, 00252 from <A HREF="http://www.netlib.org/cephes">Cephes</A> 00253 00254 @ingroup ProbFunc 00255 00256 */ 00257 00258 double fdistribution_cdf_c(double x, double n, double m, double x0 = 0); 00259 00260 00261 00262 00263 /** 00264 00265 Cumulative distribution function of the F-distribution 00266 (lower tail). 00267 00268 \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] 00269 00270 For detailed description see 00271 <A HREF="http://mathworld.wolfram.com/F-Distribution.html"> 00272 Mathworld</A>. It is implemented using the incomplete beta function, ROOT::Math::inc_beta, 00273 from <A HREF="http://www.netlib.org/cephes">Cephes</A> 00274 00275 @ingroup ProbFunc 00276 00277 */ 00278 00279 double fdistribution_cdf(double x, double n, double m, double x0 = 0); 00280 00281 00282 00283 /** 00284 00285 Complement of the cumulative distribution function of the gamma distribution 00286 (upper tail). 00287 00288 \f[ D(x) = \int_{x}^{+\infty} {1 \over \Gamma(\alpha) \theta^{\alpha}} x'^{\alpha-1} e^{-x'/\theta} dx' \f] 00289 00290 For detailed description see 00291 <A HREF="http://mathworld.wolfram.com/GammaDistribution.html"> 00292 Mathworld</A>. It is implemented using the incomplete gamma function, ROOT::Math::inc_gamma, 00293 from <A HREF="http://www.netlib.org/cephes">Cephes</A> 00294 00295 @ingroup ProbFunc 00296 00297 */ 00298 00299 double gamma_cdf_c(double x, double alpha, double theta, double x0 = 0); 00300 00301 00302 00303 00304 /** 00305 00306 Cumulative distribution function of the gamma distribution 00307 (lower tail). 00308 00309 \f[ D(x) = \int_{-\infty}^{x} {1 \over \Gamma(\alpha) \theta^{\alpha}} x'^{\alpha-1} e^{-x'/\theta} dx' \f] 00310 00311 For detailed description see 00312 <A HREF="http://mathworld.wolfram.com/GammaDistribution.html"> 00313 Mathworld</A>. It is implemented using the incomplete gamma function, ROOT::Math::inc_gamma, 00314 from <A HREF="http://www.netlib.org/cephes">Cephes</A> 00315 00316 @ingroup ProbFunc 00317 00318 */ 00319 00320 double gamma_cdf(double x, double alpha, double theta, double x0 = 0); 00321 00322 00323 00324 /** 00325 00326 Cumulative distribution function of the Landau 00327 distribution (lower tail). 00328 00329 \f[ D(x) = \int_{-\infty}^{x} p(x) dx \f] 00330 00331 where \f$p(x)\f$ is the Landau probability density function : 00332 \f[ p(x) = \frac{1}{\xi} \phi (\lambda) \f] 00333 with 00334 \f[ \phi(\lambda) = \frac{1}{2 \pi i}\int_{c-i\infty}^{c+i\infty} e^{\lambda s + s \log{s}} ds\f] 00335 with \f$\lambda = (x-x_0)/\xi\f$. For a detailed description see 00336 K.S. Kölbig and B. Schorr, A program package for the Landau distribution, 00337 <A HREF="http://dx.doi.org/10.1016/0010-4655(84)90085-7">Computer Phys. Comm. 31 (1984) 97-111</A> 00338 <A HREF="http://dx.doi.org/10.1016/j.cpc.2008.03.002">[Erratum-ibid. 178 (2008) 972]</A>. 00339 The same algorithms as in 00340 <A HREF="http://wwwasdoc.web.cern.ch/wwwasdoc/shortwrupsdir/g110/top.html"> 00341 CERNLIB</A> (DISLAN) is used. 00342 00343 @param x The argument \f$x\f$ 00344 @param xi The width parameter \f$\xi\f$ 00345 @param x0 The location parameter \f$x_0\f$ 00346 00347 @ingroup ProbFunc 00348 00349 */ 00350 00351 double landau_cdf(double x, double xi = 1, double x0 = 0); 00352 00353 /** 00354 00355 Complement of the distribution function of the Landau 00356 distribution (upper tail). 00357 00358 \f[ D(x) = \int_{x}^{+\infty} p(x) dx \f] 00359 00360 where p(x) is the Landau probability density function. 00361 It is implemented simply as 1. - #landau_cdf 00362 00363 @param x The argument \f$x\f$ 00364 @param xi The width parameter \f$\xi\f$ 00365 @param x0 The location parameter \f$x_0\f$ 00366 00367 @ingroup ProbFunc 00368 00369 */ 00370 inline double landau_cdf_c(double x, double xi = 1, double x0 = 0) { 00371 return 1. - landau_cdf(x,xi,x0); 00372 } 00373 00374 /** 00375 00376 Complement of the cumulative distribution function of the lognormal distribution 00377 (upper tail). 00378 00379 \f[ D(x) = \int_{x}^{+\infty} {1 \over x' \sqrt{2 \pi s^2} } e^{-(\ln{x'} - m)^2/2 s^2} dx' \f] 00380 00381 For detailed description see 00382 <A HREF="http://mathworld.wolfram.com/LogNormalDistribution.html"> 00383 Mathworld</A>. 00384 00385 @ingroup ProbFunc 00386 00387 */ 00388 00389 double lognormal_cdf_c(double x, double m, double s, double x0 = 0); 00390 00391 00392 00393 00394 /** 00395 00396 Cumulative distribution function of the lognormal distribution 00397 (lower tail). 00398 00399 \f[ D(x) = \int_{-\infty}^{x} {1 \over x' \sqrt{2 \pi s^2} } e^{-(\ln{x'} - m)^2/2 s^2} dx' \f] 00400 00401 For detailed description see 00402 <A HREF="http://mathworld.wolfram.com/LogNormalDistribution.html"> 00403 Mathworld</A>. 00404 00405 @ingroup ProbFunc 00406 00407 */ 00408 00409 double lognormal_cdf(double x, double m, double s, double x0 = 0); 00410 00411 00412 00413 00414 /** 00415 00416 Complement of the cumulative distribution function of the normal (Gaussian) 00417 distribution (upper tail). 00418 00419 \f[ D(x) = \int_{x}^{+\infty} {1 \over \sqrt{2 \pi \sigma^2}} e^{-x'^2 / 2\sigma^2} dx' \f] 00420 00421 For detailed description see 00422 <A HREF="http://mathworld.wolfram.com/NormalDistribution.html"> 00423 Mathworld</A>. 00424 00425 @ingroup ProbFunc 00426 00427 */ 00428 00429 double normal_cdf_c(double x, double sigma = 1, double x0 = 0); 00430 /// Alternative name for same function 00431 inline double gaussian_cdf_c(double x, double sigma = 1, double x0 = 0) { 00432 return normal_cdf_c(x,sigma,x0); 00433 } 00434 00435 00436 00437 /** 00438 00439 Cumulative distribution function of the normal (Gaussian) 00440 distribution (lower tail). 00441 00442 \f[ D(x) = \int_{-\infty}^{x} {1 \over \sqrt{2 \pi \sigma^2}} e^{-x'^2 / 2\sigma^2} dx' \f] 00443 00444 For detailed description see 00445 <A HREF="http://mathworld.wolfram.com/NormalDistribution.html"> 00446 Mathworld</A>. 00447 @ingroup ProbFunc 00448 00449 */ 00450 00451 double normal_cdf(double x, double sigma = 1, double x0 = 0); 00452 /// Alternative name for same function 00453 inline double gaussian_cdf(double x, double sigma = 1, double x0 = 0) { 00454 return normal_cdf(x,sigma,x0); 00455 } 00456 00457 00458 00459 /** 00460 00461 Complement of the cumulative distribution function of Student's 00462 t-distribution (upper tail). 00463 00464 \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] 00465 00466 For detailed description see 00467 <A HREF="http://mathworld.wolfram.com/Studentst-Distribution.html"> 00468 Mathworld</A>. It is implemented using the incomplete beta function, ROOT::Math::inc_beta, 00469 from <A HREF="http://www.netlib.org/cephes">Cephes</A> 00470 00471 @ingroup ProbFunc 00472 00473 */ 00474 00475 double tdistribution_cdf_c(double x, double r, double x0 = 0); 00476 00477 00478 00479 00480 /** 00481 00482 Cumulative distribution function of Student's 00483 t-distribution (lower tail). 00484 00485 \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] 00486 00487 For detailed description see 00488 <A HREF="http://mathworld.wolfram.com/Studentst-Distribution.html"> 00489 Mathworld</A>. It is implemented using the incomplete beta function, ROOT::Math::inc_beta, 00490 from <A HREF="http://www.netlib.org/cephes">Cephes</A> 00491 00492 @ingroup ProbFunc 00493 00494 */ 00495 00496 double tdistribution_cdf(double x, double r, double x0 = 0); 00497 00498 00499 /** 00500 00501 Complement of the cumulative distribution function of the uniform (flat) 00502 distribution (upper tail). 00503 00504 \f[ D(x) = \int_{x}^{+\infty} {1 \over (b-a)} dx' \f] 00505 00506 For detailed description see 00507 <A HREF="http://mathworld.wolfram.com/UniformDistribution.html"> 00508 Mathworld</A>. 00509 00510 @ingroup ProbFunc 00511 00512 */ 00513 00514 double uniform_cdf_c(double x, double a, double b, double x0 = 0); 00515 00516 00517 00518 00519 /** 00520 00521 Cumulative distribution function of the uniform (flat) 00522 distribution (lower tail). 00523 00524 \f[ D(x) = \int_{-\infty}^{x} {1 \over (b-a)} dx' \f] 00525 00526 For detailed description see 00527 <A HREF="http://mathworld.wolfram.com/UniformDistribution.html"> 00528 Mathworld</A>. 00529 00530 @ingroup ProbFunc 00531 00532 */ 00533 00534 double uniform_cdf(double x, double a, double b, double x0 = 0); 00535 00536 00537 00538 00539 /** 00540 00541 Complement of the cumulative distribution function of the Poisson distribution. 00542 Upper tail of the integral of the #poisson_pdf 00543 00544 @ingroup ProbFunc 00545 00546 */ 00547 00548 double poisson_cdf_c(unsigned int n, double mu); 00549 00550 /** 00551 00552 Cumulative distribution function of the Poisson distribution 00553 Lower tail of the integral of the #poisson_pdf 00554 00555 @ingroup ProbFunc 00556 00557 */ 00558 00559 double poisson_cdf(unsigned int n, double mu); 00560 00561 /** 00562 00563 Complement of the cumulative distribution function of the Binomial distribution. 00564 Upper tail of the integral of the #binomial_pdf 00565 00566 @ingroup ProbFunc 00567 00568 */ 00569 00570 double binomial_cdf_c(unsigned int k, double p, unsigned int n); 00571 00572 /** 00573 00574 Cumulative distribution function of the Binomial distribution 00575 Lower tail of the integral of the #binomial_pdf 00576 00577 @ingroup ProbFunc 00578 00579 */ 00580 00581 double binomial_cdf(unsigned int k, double p, unsigned int n); 00582 00583 00584 /** 00585 00586 Complement of the cumulative distribution function of the Negative Binomial distribution. 00587 Upper tail of the integral of the #negative_binomial_pdf 00588 00589 @ingroup ProbFunc 00590 00591 */ 00592 00593 double negative_binomial_cdf_c(unsigned int k, double p, double n); 00594 00595 /** 00596 00597 Cumulative distribution function of the Negative Binomial distribution 00598 Lower tail of the integral of the #negative_binomial_pdf 00599 00600 @ingroup ProbFunc 00601 00602 */ 00603 00604 double negative_binomial_cdf(unsigned int k, double p, double n); 00605 00606 00607 00608 #ifdef HAVE_OLD_STAT_FUNC 00609 00610 /** @name Backward compatible MathCore CDF functions */ 00611 00612 00613 inline double breitwigner_prob(double x, double gamma, double x0 = 0) { 00614 return breitwigner_cdf_c(x,gamma,x0); 00615 } 00616 inline double breitwigner_quant(double x, double gamma, double x0 = 0) { 00617 return breitwigner_cdf(x,gamma,x0); 00618 } 00619 00620 inline double cauchy_prob(double x, double b, double x0 = 0) { 00621 return cauchy_cdf_c(x,b,x0); 00622 } 00623 inline double cauchy_quant(double x, double b, double x0 = 0) { 00624 return cauchy_cdf (x,b,x0); 00625 } 00626 inline double chisquared_prob(double x, double r, double x0 = 0) { 00627 return chisquared_cdf_c(x, r, x0); 00628 } 00629 inline double chisquared_quant(double x, double r, double x0 = 0) { 00630 return chisquared_cdf (x, r, x0); 00631 } 00632 inline double exponential_prob(double x, double lambda, double x0 = 0) { 00633 return exponential_cdf_c(x, lambda, x0 ); 00634 } 00635 inline double exponential_quant(double x, double lambda, double x0 = 0) { 00636 return exponential_cdf (x, lambda, x0 ); 00637 } 00638 00639 inline double gaussian_prob(double x, double sigma, double x0 = 0) { 00640 return gaussian_cdf_c( x, sigma, x0 ); 00641 } 00642 inline double gaussian_quant(double x, double sigma, double x0 = 0) { 00643 return gaussian_cdf ( x, sigma, x0 ); 00644 } 00645 00646 inline double lognormal_prob(double x, double m, double s, double x0 = 0) { 00647 return lognormal_cdf_c( x, m, s, x0 ); 00648 } 00649 inline double lognormal_quant(double x, double m, double s, double x0 = 0) { 00650 return lognormal_cdf ( x, m, s, x0 ); 00651 } 00652 00653 inline double normal_prob(double x, double sigma, double x0 = 0) { 00654 return normal_cdf_c( x, sigma, x0 ); 00655 } 00656 inline double normal_quant(double x, double sigma, double x0 = 0) { 00657 return normal_cdf ( x, sigma, x0 ); 00658 } 00659 00660 inline double uniform_prob(double x, double a, double b, double x0 = 0) { 00661 return uniform_cdf_c( x, a, b, x0 ); 00662 } 00663 inline double uniform_quant(double x, double a, double b, double x0 = 0) { 00664 return uniform_cdf ( x, a, b, x0 ); 00665 } 00666 inline double fdistribution_prob(double x, double n, double m, double x0 = 0) { 00667 return fdistribution_cdf_c (x, n, m, x0); 00668 } 00669 inline double fdistribution_quant(double x, double n, double m, double x0 = 0) { 00670 return fdistribution_cdf (x, n, m, x0); 00671 } 00672 00673 inline double gamma_prob(double x, double alpha, double theta, double x0 = 0) { 00674 return gamma_cdf_c (x, alpha, theta, x0); 00675 } 00676 inline double gamma_quant(double x, double alpha, double theta, double x0 = 0) { 00677 return gamma_cdf (x, alpha, theta, x0); 00678 } 00679 00680 inline double tdistribution_prob(double x, double r, double x0 = 0) { 00681 return tdistribution_cdf_c (x, r, x0); 00682 } 00683 00684 inline double tdistribution_quant(double x, double r, double x0 = 0) { 00685 return tdistribution_cdf (x, r, x0); 00686 } 00687 00688 #endif 00689 00690 /** @defgroup TruncFunc Statistical functions from truncated distributions 00691 00692 @ingroup StatFunc 00693 00694 Statistical functions for the truncated distributions. Examples of such functions are the 00695 first or the second momentum of the truncated distribution. 00696 In the case of the Landau, first and second momentum functions are provided for the Landau 00697 distribution truncated only on the right side. 00698 These functions are defined in the header file <em>Math/ProbFunc.h<em> or in the global one 00699 including all statistical dunctions <em>Math/StatFunc.h<em> 00700 00701 */ 00702 00703 /** 00704 00705 First moment (mean) of the truncated Landau distribution. 00706 \f[ \frac{1}{D (x)} \int_{-\infty}^{x} t\, p(t) d t \f] 00707 where \f$p(x)\f$ is the Landau distribution 00708 and \f$D(x)\f$ its cumulative distribution function. 00709 00710 For detailed description see 00711 K.S. Kölbig and B. Schorr, A program package for the Landau distribution, 00712 <A HREF="http://dx.doi.org/10.1016/0010-4655(84)90085-7">Computer Phys. Comm. 31 (1984) 97-111</A> 00713 <A HREF="http://dx.doi.org/10.1016/j.cpc.2008.03.002">[Erratum-ibid. 178 (2008) 972]</A>. 00714 The same algorithms as in 00715 <A HREF="http://wwwasdoc.web.cern.ch/wwwasdoc/shortwrupsdir/g110/top.html"> 00716 CERNLIB</A> (XM1LAN) is used 00717 00718 @param x The argument \f$x\f$ 00719 @param xi The width parameter \f$\xi\f$ 00720 @param x0 The location parameter \f$x_0\f$ 00721 00722 @ingroup TruncFunc 00723 00724 */ 00725 00726 double landau_xm1(double x, double xi = 1, double x0 = 0); 00727 00728 00729 00730 /** 00731 00732 Second moment of the truncated Landau distribution. 00733 \f[ \frac{1}{D (x)} \int_{-\infty}^{x} t^2\, p(t) d t \f] 00734 where \f$p(x)\f$ is the Landau distribution 00735 and \f$D(x)\f$ its cumulative distribution function. 00736 00737 For detailed description see 00738 K.S. Kölbig and B. Schorr, A program package for the Landau distribution, 00739 <A HREF="http://dx.doi.org/10.1016/0010-4655(84)90085-7">Computer Phys. Comm. 31 (1984) 97-111</A> 00740 <A HREF="http://dx.doi.org/10.1016/j.cpc.2008.03.002">[Erratum-ibid. 178 (2008) 972]</A>. 00741 The same algorithms as in 00742 <A HREF="http://wwwasdoc.web.cern.ch/wwwasdoc/shortwrupsdir/g110/top.html"> 00743 CERNLIB</A> (XM1LAN) is used 00744 00745 @param x The argument \f$x\f$ 00746 @param xi The width parameter \f$\xi\f$ 00747 @param x0 The location parameter \f$x_0\f$ 00748 00749 @ingroup TruncFunc 00750 00751 */ 00752 00753 double landau_xm2(double x, double xi = 1, double x0 = 0); 00754 00755 00756 00757 } // namespace Math 00758 } // namespace ROOT 00759 00760 00761 #endif // ROOT_Math_ProbFuncMathCore 00762 00763 #endif // if defined (__CINT__) && !defined(__MAKECINT__)