|
||||
File indexing completed on 2025-01-18 10:10:20
0001 // @(#)root/mathcore:$Id$ 0002 // Authors: L. Moneta, A. Zsenei 06/2005 0003 0004 /********************************************************************** 0005 * * 0006 * Copyright (c) 2005 , LCG ROOT MathLib Team * 0007 * * 0008 * * 0009 **********************************************************************/ 0010 0011 #ifndef ROOT_Math_ProbFuncMathCore 0012 #define ROOT_Math_ProbFuncMathCore 0013 0014 0015 namespace ROOT { 0016 namespace Math { 0017 0018 0019 /** @defgroup ProbFunc Cumulative Distribution Functions (CDF) 0020 0021 @ingroup StatFunc 0022 0023 * Cumulative distribution functions of various distributions. 0024 * The functions with the extension <em>_cdf</em> calculate the 0025 * lower tail integral of the probability density function 0026 * 0027 * \f[ D(x) = \int_{-\infty}^{x} p(x') dx' \f] 0028 * 0029 * while those with the <em>_cdf_c</em> extension calculate the complement of 0030 * cumulative distribution function, called in statistics the survival 0031 * function. 0032 * It corresponds to the upper tail integral of the 0033 * probability density function 0034 * 0035 * \f[ D(x) = \int_{x}^{+\infty} p(x') dx' \f] 0036 * 0037 * 0038 * <strong>NOTE:</strong> In the old releases (< 5.14) the <em>_cdf</em> functions were called 0039 * <em>_quant</em> and the <em>_cdf_c</em> functions were called 0040 * <em>_prob</em>. 0041 * These names are currently kept for backward compatibility, but 0042 * their usage is deprecated. 0043 * 0044 * These functions are defined in the header file <em>Math/ProbFunc.h</em> or in the global one 0045 * including all statistical functions <em>Math/DistFunc.h</em> 0046 * 0047 */ 0048 0049 0050 0051 /** 0052 0053 Complement of the cumulative distribution function of the beta distribution. 0054 Upper tail of the integral of the #beta_pdf 0055 0056 @ingroup ProbFunc 0057 0058 */ 0059 0060 double beta_cdf_c(double x, double a, double b); 0061 0062 0063 0064 /** 0065 0066 Cumulative distribution function of the beta distribution 0067 Upper tail of the integral of the #beta_pdf 0068 0069 @ingroup ProbFunc 0070 0071 */ 0072 0073 double beta_cdf(double x, double a, double b); 0074 0075 0076 0077 0078 /** 0079 0080 Complement of the cumulative distribution function (upper tail) of the Breit_Wigner 0081 distribution and it is similar (just a different parameter definition) to the 0082 Cauchy distribution (see #cauchy_cdf_c ) 0083 0084 \f[ D(x) = \int_{x}^{+\infty} \frac{1}{\pi} \frac{\frac{1}{2} \Gamma}{x'^2 + (\frac{1}{2} \Gamma)^2} dx' \f] 0085 0086 0087 @ingroup ProbFunc 0088 0089 */ 0090 double breitwigner_cdf_c(double x, double gamma, double x0 = 0); 0091 0092 0093 /** 0094 0095 Cumulative distribution function (lower tail) of the Breit_Wigner 0096 distribution and it is similar (just a different parameter definition) to the 0097 Cauchy distribution (see #cauchy_cdf ) 0098 0099 \f[ D(x) = \int_{-\infty}^{x} \frac{1}{\pi} \frac{b}{x'^2 + (\frac{1}{2} \Gamma)^2} dx' \f] 0100 0101 0102 @ingroup ProbFunc 0103 0104 */ 0105 double breitwigner_cdf(double x, double gamma, double x0 = 0); 0106 0107 0108 0109 /** 0110 0111 Complement of the cumulative distribution function (upper tail) of the 0112 Cauchy distribution which is also Lorentzian distribution. 0113 It is similar (just a different parameter definition) to the 0114 Breit_Wigner distribution (see #breitwigner_cdf_c ) 0115 0116 \f[ D(x) = \int_{x}^{+\infty} \frac{1}{\pi} \frac{ b }{ (x'-m)^2 + b^2} dx' \f] 0117 0118 For detailed description see 0119 <A HREF="http://mathworld.wolfram.com/CauchyDistribution.html"> 0120 Mathworld</A>. 0121 0122 @ingroup ProbFunc 0123 0124 */ 0125 double cauchy_cdf_c(double x, double b, double x0 = 0); 0126 0127 0128 0129 0130 /** 0131 0132 Cumulative distribution function (lower tail) of the 0133 Cauchy distribution which is also Lorentzian distribution. 0134 It is similar (just a different parameter definition) to the 0135 Breit_Wigner distribution (see #breitwigner_cdf ) 0136 0137 \f[ D(x) = \int_{-\infty}^{x} \frac{1}{\pi} \frac{ b }{ (x'-m)^2 + b^2} dx' \f] 0138 0139 For detailed description see 0140 <A HREF="http://mathworld.wolfram.com/CauchyDistribution.html"> 0141 Mathworld</A>. 0142 0143 0144 @ingroup ProbFunc 0145 0146 */ 0147 double cauchy_cdf(double x, double b, double x0 = 0); 0148 0149 0150 0151 0152 /** 0153 0154 Complement of the cumulative distribution function of the \f$\chi^2\f$ distribution 0155 with \f$r\f$ degrees of freedom (upper tail). 0156 0157 \f[ D_{r}(x) = \int_{x}^{+\infty} \frac{1}{\Gamma(r/2) 2^{r/2}} x'^{r/2-1} e^{-x'/2} dx' \f] 0158 0159 For detailed description see 0160 <A HREF="http://mathworld.wolfram.com/Chi-SquaredDistribution.html"> 0161 Mathworld</A>. It is implemented using the incomplete gamma function, ROOT::Math::inc_gamma_c, 0162 from <A HREF="http://www.netlib.org/cephes">Cephes</A> 0163 0164 @ingroup ProbFunc 0165 0166 */ 0167 0168 double chisquared_cdf_c(double x, double r, double x0 = 0); 0169 0170 0171 0172 /** 0173 0174 Cumulative distribution function of the \f$\chi^2\f$ distribution 0175 with \f$r\f$ degrees of freedom (lower tail). 0176 0177 \f[ D_{r}(x) = \int_{-\infty}^{x} \frac{1}{\Gamma(r/2) 2^{r/2}} x'^{r/2-1} e^{-x'/2} dx' \f] 0178 0179 For detailed description see 0180 <A HREF="http://mathworld.wolfram.com/Chi-SquaredDistribution.html"> 0181 Mathworld</A>. It is implemented using the incomplete gamma function, ROOT::Math::inc_gamma_c, 0182 from <A HREF="http://www.netlib.org/cephes">Cephes</A> 0183 0184 @ingroup ProbFunc 0185 0186 */ 0187 0188 double chisquared_cdf(double x, double r, double x0 = 0); 0189 0190 0191 /** 0192 0193 Cumulative distribution for the Crystal Ball distribution function 0194 0195 See the definition of the Crystal Ball function at 0196 <A HREF="http://en.wikipedia.org/wiki/Crystal_Ball_function"> 0197 Wikipedia</A>. 0198 0199 The distribution is defined only for n > 1 when the integral converges 0200 0201 @ingroup ProbFunc 0202 0203 */ 0204 double crystalball_cdf(double x, double alpha, double n, double sigma, double x0 = 0); 0205 0206 /** 0207 0208 Complement of the Cumulative distribution for the Crystal Ball distribution 0209 0210 See the definition of the Crystal Ball function at 0211 <A HREF="http://en.wikipedia.org/wiki/Crystal_Ball_function"> 0212 Wikipedia</A>. 0213 0214 The distribution is defined only for n > 1 when the integral converges 0215 0216 @ingroup ProbFunc 0217 0218 */ 0219 double crystalball_cdf_c(double x, double alpha, double n, double sigma, double x0 = 0); 0220 0221 /** 0222 Integral of the not-normalized Crystal Ball function 0223 0224 See the definition of the Crystal Ball function at 0225 <A HREF="http://en.wikipedia.org/wiki/Crystal_Ball_function"> 0226 Wikipedia</A>. 0227 0228 see ROOT::Math::crystalball_function for the function evaluation. 0229 0230 @ingroup ProbFunc 0231 0232 */ 0233 double crystalball_integral(double x, double alpha, double n, double sigma, double x0 = 0); 0234 0235 /** 0236 0237 Complement of the cumulative distribution function of the exponential distribution 0238 (upper tail). 0239 0240 \f[ D(x) = \int_{x}^{+\infty} \lambda e^{-\lambda x'} dx' \f] 0241 0242 For detailed description see 0243 <A HREF="http://mathworld.wolfram.com/ExponentialDistribution.html"> 0244 Mathworld</A>. 0245 0246 @ingroup ProbFunc 0247 0248 */ 0249 0250 double exponential_cdf_c(double x, double lambda, double x0 = 0); 0251 0252 0253 0254 /** 0255 0256 Cumulative distribution function of the exponential distribution 0257 (lower tail). 0258 0259 \f[ D(x) = \int_{-\infty}^{x} \lambda e^{-\lambda x'} dx' \f] 0260 0261 For detailed description see 0262 <A HREF="http://mathworld.wolfram.com/ExponentialDistribution.html"> 0263 Mathworld</A>. 0264 0265 @ingroup ProbFunc 0266 0267 */ 0268 0269 0270 double exponential_cdf(double x, double lambda, double x0 = 0); 0271 0272 0273 0274 /** 0275 0276 Complement of the cumulative distribution function of the F-distribution 0277 (upper tail). 0278 0279 \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] 0280 0281 For detailed description see 0282 <A HREF="http://mathworld.wolfram.com/F-Distribution.html"> 0283 Mathworld</A>. It is implemented using the incomplete beta function, ROOT::Math::inc_beta, 0284 from <A HREF="http://www.netlib.org/cephes">Cephes</A> 0285 0286 @ingroup ProbFunc 0287 0288 */ 0289 0290 double fdistribution_cdf_c(double x, double n, double m, double x0 = 0); 0291 0292 0293 0294 0295 /** 0296 0297 Cumulative distribution function of the F-distribution 0298 (lower tail). 0299 0300 \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] 0301 0302 For detailed description see 0303 <A HREF="http://mathworld.wolfram.com/F-Distribution.html"> 0304 Mathworld</A>. It is implemented using the incomplete beta function, ROOT::Math::inc_beta, 0305 from <A HREF="http://www.netlib.org/cephes">Cephes</A> 0306 0307 @ingroup ProbFunc 0308 0309 */ 0310 0311 double fdistribution_cdf(double x, double n, double m, double x0 = 0); 0312 0313 0314 0315 /** 0316 0317 Complement of the cumulative distribution function of the gamma distribution 0318 (upper tail). 0319 0320 \f[ D(x) = \int_{x}^{+\infty} {1 \over \Gamma(\alpha) \theta^{\alpha}} x'^{\alpha-1} e^{-x'/\theta} dx' \f] 0321 0322 For detailed description see 0323 <A HREF="http://mathworld.wolfram.com/GammaDistribution.html"> 0324 Mathworld</A>. It is implemented using the incomplete gamma function, ROOT::Math::inc_gamma, 0325 from <A HREF="http://www.netlib.org/cephes">Cephes</A> 0326 0327 @ingroup ProbFunc 0328 0329 */ 0330 0331 double gamma_cdf_c(double x, double alpha, double theta, double x0 = 0); 0332 0333 0334 0335 0336 /** 0337 0338 Cumulative distribution function of the gamma distribution 0339 (lower tail). 0340 0341 \f[ D(x) = \int_{-\infty}^{x} {1 \over \Gamma(\alpha) \theta^{\alpha}} x'^{\alpha-1} e^{-x'/\theta} dx' \f] 0342 0343 For detailed description see 0344 <A HREF="http://mathworld.wolfram.com/GammaDistribution.html"> 0345 Mathworld</A>. It is implemented using the incomplete gamma function, ROOT::Math::inc_gamma, 0346 from <A HREF="http://www.netlib.org/cephes">Cephes</A> 0347 0348 @ingroup ProbFunc 0349 0350 */ 0351 0352 double gamma_cdf(double x, double alpha, double theta, double x0 = 0); 0353 0354 0355 0356 /** 0357 0358 Cumulative distribution function of the Landau 0359 distribution (lower tail). 0360 0361 \f[ D(x) = \int_{-\infty}^{x} p(x) dx \f] 0362 0363 where \f$p(x)\f$ is the Landau probability density function : 0364 \f[ p(x) = \frac{1}{\xi} \phi (\lambda) \f] 0365 with 0366 \f[ \phi(\lambda) = \frac{1}{2 \pi i}\int_{c-i\infty}^{c+i\infty} e^{\lambda s + s \log{s}} ds\f] 0367 with \f$\lambda = (x-x_0)/\xi\f$. For a detailed description see 0368 K.S. Kölbig and B. Schorr, A program package for the Landau distribution, 0369 <A HREF="http://dx.doi.org/10.1016/0010-4655(84)90085-7">Computer Phys. Comm. 31 (1984) 97-111</A> 0370 <A HREF="http://dx.doi.org/10.1016/j.cpc.2008.03.002">[Erratum-ibid. 178 (2008) 972]</A>. 0371 The same algorithms as in 0372 <A HREF="https://cern-tex.web.cern.ch/cern-tex/shortwrupsdir/g110/top.html"> 0373 CERNLIB</A> (DISLAN) is used. 0374 0375 @param x The argument \f$x\f$ 0376 @param xi The width parameter \f$\xi\f$ 0377 @param x0 The location parameter \f$x_0\f$ 0378 0379 @ingroup ProbFunc 0380 0381 */ 0382 0383 double landau_cdf(double x, double xi = 1, double x0 = 0); 0384 0385 /** 0386 0387 Complement of the distribution function of the Landau 0388 distribution (upper tail). 0389 0390 \f[ D(x) = \int_{x}^{+\infty} p(x) dx \f] 0391 0392 where p(x) is the Landau probability density function. 0393 It is implemented simply as 1. - #landau_cdf 0394 0395 @param x The argument \f$x\f$ 0396 @param xi The width parameter \f$\xi\f$ 0397 @param x0 The location parameter \f$x_0\f$ 0398 0399 @ingroup ProbFunc 0400 0401 */ 0402 inline double landau_cdf_c(double x, double xi = 1, double x0 = 0) { 0403 return 1. - landau_cdf(x,xi,x0); 0404 } 0405 0406 /** 0407 0408 Complement of the cumulative distribution function of the lognormal distribution 0409 (upper tail). 0410 0411 \f[ D(x) = \int_{x}^{+\infty} {1 \over x' \sqrt{2 \pi s^2} } e^{-(\ln{x'} - m)^2/2 s^2} dx' \f] 0412 0413 For detailed description see 0414 <A HREF="http://mathworld.wolfram.com/LogNormalDistribution.html"> 0415 Mathworld</A>. 0416 0417 @ingroup ProbFunc 0418 0419 */ 0420 0421 double lognormal_cdf_c(double x, double m, double s, double x0 = 0); 0422 0423 0424 0425 0426 /** 0427 0428 Cumulative distribution function of the lognormal distribution 0429 (lower tail). 0430 0431 \f[ D(x) = \int_{-\infty}^{x} {1 \over x' \sqrt{2 \pi s^2} } e^{-(\ln{x'} - m)^2/2 s^2} dx' \f] 0432 0433 For detailed description see 0434 <A HREF="http://mathworld.wolfram.com/LogNormalDistribution.html"> 0435 Mathworld</A>. 0436 0437 @ingroup ProbFunc 0438 0439 */ 0440 0441 double lognormal_cdf(double x, double m, double s, double x0 = 0); 0442 0443 0444 0445 0446 /** 0447 0448 Complement of the cumulative distribution function of the normal (Gaussian) 0449 distribution (upper tail). 0450 0451 \f[ D(x) = \int_{x}^{+\infty} {1 \over \sqrt{2 \pi \sigma^2}} e^{-x'^2 / 2\sigma^2} dx' \f] 0452 0453 For detailed description see 0454 <A HREF="http://mathworld.wolfram.com/NormalDistribution.html"> 0455 Mathworld</A>. 0456 0457 @ingroup ProbFunc 0458 0459 */ 0460 0461 double normal_cdf_c(double x, double sigma = 1, double x0 = 0); 0462 /// Alternative name for same function 0463 inline double gaussian_cdf_c(double x, double sigma = 1, double x0 = 0) { 0464 return normal_cdf_c(x,sigma,x0); 0465 } 0466 0467 0468 0469 /** 0470 0471 Cumulative distribution function of the normal (Gaussian) 0472 distribution (lower tail). 0473 0474 \f[ D(x) = \int_{-\infty}^{x} {1 \over \sqrt{2 \pi \sigma^2}} e^{-x'^2 / 2\sigma^2} dx' \f] 0475 0476 For detailed description see 0477 <A HREF="http://mathworld.wolfram.com/NormalDistribution.html"> 0478 Mathworld</A>. 0479 @ingroup ProbFunc 0480 0481 */ 0482 0483 double normal_cdf(double x, double sigma = 1, double x0 = 0); 0484 /// Alternative name for same function 0485 inline double gaussian_cdf(double x, double sigma = 1, double x0 = 0) { 0486 return normal_cdf(x,sigma,x0); 0487 } 0488 0489 0490 0491 /** 0492 0493 Complement of the cumulative distribution function of Student's 0494 t-distribution (upper tail). 0495 0496 \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] 0497 0498 For detailed description see 0499 <A HREF="http://mathworld.wolfram.com/Studentst-Distribution.html"> 0500 Mathworld</A>. It is implemented using the incomplete beta function, ROOT::Math::inc_beta, 0501 from <A HREF="http://www.netlib.org/cephes">Cephes</A> 0502 0503 @ingroup ProbFunc 0504 0505 */ 0506 0507 double tdistribution_cdf_c(double x, double r, double x0 = 0); 0508 0509 0510 0511 0512 /** 0513 0514 Cumulative distribution function of Student's 0515 t-distribution (lower tail). 0516 0517 \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] 0518 0519 For detailed description see 0520 <A HREF="http://mathworld.wolfram.com/Studentst-Distribution.html"> 0521 Mathworld</A>. It is implemented using the incomplete beta function, ROOT::Math::inc_beta, 0522 from <A HREF="http://www.netlib.org/cephes">Cephes</A> 0523 0524 @ingroup ProbFunc 0525 0526 */ 0527 0528 double tdistribution_cdf(double x, double r, double x0 = 0); 0529 0530 0531 /** 0532 0533 Complement of the cumulative distribution function of the uniform (flat) 0534 distribution (upper tail). 0535 0536 \f[ D(x) = \int_{x}^{+\infty} {1 \over (b-a)} dx' \f] 0537 0538 For detailed description see 0539 <A HREF="http://mathworld.wolfram.com/UniformDistribution.html"> 0540 Mathworld</A>. 0541 0542 @ingroup ProbFunc 0543 0544 */ 0545 0546 double uniform_cdf_c(double x, double a, double b, double x0 = 0); 0547 0548 0549 0550 0551 /** 0552 0553 Cumulative distribution function of the uniform (flat) 0554 distribution (lower tail). 0555 0556 \f[ D(x) = \int_{-\infty}^{x} {1 \over (b-a)} dx' \f] 0557 0558 For detailed description see 0559 <A HREF="http://mathworld.wolfram.com/UniformDistribution.html"> 0560 Mathworld</A>. 0561 0562 @ingroup ProbFunc 0563 0564 */ 0565 0566 double uniform_cdf(double x, double a, double b, double x0 = 0); 0567 0568 0569 0570 0571 /** 0572 0573 Complement of the cumulative distribution function of the Poisson distribution. 0574 Upper tail of the integral of the #poisson_pdf 0575 0576 @ingroup ProbFunc 0577 0578 */ 0579 0580 double poisson_cdf_c(unsigned int n, double mu); 0581 0582 /** 0583 0584 Cumulative distribution function of the Poisson distribution 0585 Lower tail of the integral of the #poisson_pdf 0586 0587 @ingroup ProbFunc 0588 0589 */ 0590 0591 double poisson_cdf(unsigned int n, double mu); 0592 0593 /** 0594 0595 Complement of the cumulative distribution function of the Binomial distribution. 0596 Upper tail of the integral of the #binomial_pdf 0597 0598 @ingroup ProbFunc 0599 0600 */ 0601 0602 double binomial_cdf_c(unsigned int k, double p, unsigned int n); 0603 0604 /** 0605 0606 Cumulative distribution function of the Binomial distribution 0607 Lower tail of the integral of the #binomial_pdf 0608 0609 @ingroup ProbFunc 0610 0611 */ 0612 0613 double binomial_cdf(unsigned int k, double p, unsigned int n); 0614 0615 0616 /** 0617 0618 Complement of the cumulative distribution function of the Negative Binomial distribution. 0619 Upper tail of the integral of the #negative_binomial_pdf 0620 0621 @ingroup ProbFunc 0622 0623 */ 0624 0625 double negative_binomial_cdf_c(unsigned int k, double p, double n); 0626 0627 /** 0628 0629 Cumulative distribution function of the Negative Binomial distribution 0630 Lower tail of the integral of the #negative_binomial_pdf 0631 0632 @ingroup ProbFunc 0633 0634 */ 0635 0636 double negative_binomial_cdf(unsigned int k, double p, double n); 0637 0638 0639 0640 #ifdef HAVE_OLD_STAT_FUNC 0641 0642 /** @name Backward compatible MathCore CDF functions */ 0643 0644 0645 inline double breitwigner_prob(double x, double gamma, double x0 = 0) { 0646 return breitwigner_cdf_c(x,gamma,x0); 0647 } 0648 inline double breitwigner_quant(double x, double gamma, double x0 = 0) { 0649 return breitwigner_cdf(x,gamma,x0); 0650 } 0651 0652 inline double cauchy_prob(double x, double b, double x0 = 0) { 0653 return cauchy_cdf_c(x,b,x0); 0654 } 0655 inline double cauchy_quant(double x, double b, double x0 = 0) { 0656 return cauchy_cdf (x,b,x0); 0657 } 0658 inline double chisquared_prob(double x, double r, double x0 = 0) { 0659 return chisquared_cdf_c(x, r, x0); 0660 } 0661 inline double chisquared_quant(double x, double r, double x0 = 0) { 0662 return chisquared_cdf (x, r, x0); 0663 } 0664 inline double exponential_prob(double x, double lambda, double x0 = 0) { 0665 return exponential_cdf_c(x, lambda, x0 ); 0666 } 0667 inline double exponential_quant(double x, double lambda, double x0 = 0) { 0668 return exponential_cdf (x, lambda, x0 ); 0669 } 0670 0671 inline double gaussian_prob(double x, double sigma, double x0 = 0) { 0672 return gaussian_cdf_c( x, sigma, x0 ); 0673 } 0674 inline double gaussian_quant(double x, double sigma, double x0 = 0) { 0675 return gaussian_cdf ( x, sigma, x0 ); 0676 } 0677 0678 inline double lognormal_prob(double x, double m, double s, double x0 = 0) { 0679 return lognormal_cdf_c( x, m, s, x0 ); 0680 } 0681 inline double lognormal_quant(double x, double m, double s, double x0 = 0) { 0682 return lognormal_cdf ( x, m, s, x0 ); 0683 } 0684 0685 inline double normal_prob(double x, double sigma, double x0 = 0) { 0686 return normal_cdf_c( x, sigma, x0 ); 0687 } 0688 inline double normal_quant(double x, double sigma, double x0 = 0) { 0689 return normal_cdf ( x, sigma, x0 ); 0690 } 0691 0692 inline double uniform_prob(double x, double a, double b, double x0 = 0) { 0693 return uniform_cdf_c( x, a, b, x0 ); 0694 } 0695 inline double uniform_quant(double x, double a, double b, double x0 = 0) { 0696 return uniform_cdf ( x, a, b, x0 ); 0697 } 0698 inline double fdistribution_prob(double x, double n, double m, double x0 = 0) { 0699 return fdistribution_cdf_c (x, n, m, x0); 0700 } 0701 inline double fdistribution_quant(double x, double n, double m, double x0 = 0) { 0702 return fdistribution_cdf (x, n, m, x0); 0703 } 0704 0705 inline double gamma_prob(double x, double alpha, double theta, double x0 = 0) { 0706 return gamma_cdf_c (x, alpha, theta, x0); 0707 } 0708 inline double gamma_quant(double x, double alpha, double theta, double x0 = 0) { 0709 return gamma_cdf (x, alpha, theta, x0); 0710 } 0711 0712 inline double tdistribution_prob(double x, double r, double x0 = 0) { 0713 return tdistribution_cdf_c (x, r, x0); 0714 } 0715 0716 inline double tdistribution_quant(double x, double r, double x0 = 0) { 0717 return tdistribution_cdf (x, r, x0); 0718 } 0719 0720 #endif 0721 0722 /** @defgroup TruncFunc Statistical functions from truncated distributions 0723 0724 @ingroup StatFunc 0725 0726 Statistical functions for the truncated distributions. Examples of such functions are the 0727 first or the second momentum of the truncated distribution. 0728 In the case of the Landau, first and second momentum functions are provided for the Landau 0729 distribution truncated only on the right side. 0730 These functions are defined in the header file <em>Math/ProbFunc.h</em> or in the global one 0731 including all statistical functions <em>Math/StatFunc.h</em> 0732 0733 */ 0734 0735 /** 0736 0737 First moment (mean) of the truncated Landau distribution. 0738 \f[ \frac{1}{D (x)} \int_{-\infty}^{x} t\, p(t) d t \f] 0739 where \f$p(x)\f$ is the Landau distribution 0740 and \f$D(x)\f$ its cumulative distribution function. 0741 0742 For detailed description see 0743 K.S. Kölbig and B. Schorr, A program package for the Landau distribution, 0744 <A HREF="http://dx.doi.org/10.1016/0010-4655(84)90085-7">Computer Phys. Comm. 31 (1984) 97-111</A> 0745 <A HREF="http://dx.doi.org/10.1016/j.cpc.2008.03.002">[Erratum-ibid. 178 (2008) 972]</A>. 0746 The same algorithms as in 0747 <A HREF="https://cern-tex.web.cern.ch/cern-tex/shortwrupsdir/g110/top.html"> 0748 CERNLIB</A> (XM1LAN) is used 0749 0750 @param x The argument \f$x\f$ 0751 @param xi The width parameter \f$\xi\f$ 0752 @param x0 The location parameter \f$x_0\f$ 0753 0754 @ingroup TruncFunc 0755 0756 */ 0757 0758 double landau_xm1(double x, double xi = 1, double x0 = 0); 0759 0760 0761 0762 /** 0763 0764 Second moment of the truncated Landau distribution. 0765 \f[ \frac{1}{D (x)} \int_{-\infty}^{x} t^2\, p(t) d t \f] 0766 where \f$p(x)\f$ is the Landau distribution 0767 and \f$D(x)\f$ its cumulative distribution function. 0768 0769 For detailed description see 0770 K.S. Kölbig and B. Schorr, A program package for the Landau distribution, 0771 <A HREF="http://dx.doi.org/10.1016/0010-4655(84)90085-7">Computer Phys. Comm. 31 (1984) 97-111</A> 0772 <A HREF="http://dx.doi.org/10.1016/j.cpc.2008.03.002">[Erratum-ibid. 178 (2008) 972]</A>. 0773 The same algorithms as in 0774 <A HREF="https://cern-tex.web.cern.ch/cern-tex/shortwrupsdir/g110/top.html"> 0775 CERNLIB</A> (XM1LAN) is used 0776 0777 @param x The argument \f$x\f$ 0778 @param xi The width parameter \f$\xi\f$ 0779 @param x0 The location parameter \f$x_0\f$ 0780 0781 @ingroup TruncFunc 0782 0783 */ 0784 0785 double landau_xm2(double x, double xi = 1, double x0 = 0); 0786 0787 0788 0789 } // namespace Math 0790 } // namespace ROOT 0791 0792 0793 #endif // ROOT_Math_ProbFuncMathCore
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |