Statistical functions

Probability density functions, cumulative distribution functions and their inverses for various statistical distributions (continuous and discrete). More...

Probability Density Functions (PDF)

Probability density functions of various statistical distributions (continuous and discrete). The probability density function returns the probability that the variate has the value x. In statistics the PDF is also called the frequency function.

Additional PDF's are provided in the MathMore library.

double ROOT::Math::binomial_pdf (unsigned int k, double p, unsigned int n)
 Probability density function of the binomial distribution.
double ROOT::Math::breitwigner_pdf (double x, double gamma, double x0=0)
 Probability density function of Breit-Wigner distribution, which is similar, just a different definition of the parameters, to the Cauchy distribution (see cauchy_pdf ).
double ROOT::Math::cauchy_pdf (double x, double b=1, double x0=0)
 Probability density function of the Cauchy distribution which is also called Lorentzian distribution.
double ROOT::Math::chisquared_pdf (double x, double r, double x0=0)
 Probability density function of the $\chi^2$ distribution with $r$ degrees of freedom.
double ROOT::Math::exponential_pdf (double x, double lambda, double x0=0)
 Probability density function of the exponential distribution.
double ROOT::Math::fdistribution_pdf (double x, double n, double m, double x0=0)
 Probability density function of the F-distribution.
double ROOT::Math::gamma_pdf (double x, double alpha, double theta, double x0=0)
 Probability density function of the gamma distribution.
double ROOT::Math::gaussian_pdf (double x, double sigma, double x0=0)
 Probability density function of the normal (Gaussian) distribution.
double ROOT::Math::lognormal_pdf (double x, double m, double s, double x0=0)
 double landau_pdf(double x) {
double ROOT::Math::normal_pdf (double x, double sigma, double x0=0)
 Probability density function of the normal (Gaussian) distribution.
double ROOT::Math::poisson_pdf (unsigned int n, double mu)
 Probability density function of the Poisson distribution.
double ROOT::Math::tdistribution_pdf (double x, double r, double x0=0)
 Probability density function of Student's t-distribution.
double ROOT::Math::uniform_pdf (double x, double a, double b, double x0=0)
 Probability density function of the uniform (flat) distribution.

Cumulative Distribution Functions (CDF)

Cumulative distribution functions of various distributions. The functions with the extension _cdf calculate the lower tail integral of the probability density function

\[ D(x) = \int_{-\infty}^{x} p(x') dx' \]

while those with the _cdf_c extension calculate the complement of cumulative distribution function, called in statistics the survival function. It corresponds to the upper tail integral of the probability density function

\[ D(x) = \int_{x}^{+\infty} p(x') dx' \]

NOTE: In the old releases (< 5.14) the _cdf functions were called _quant and the _cdf_c functions were called _prob. These names are currently kept for backward compatibility, but their usage is deprecated.

Additional CDF's are provided in the MathMore library.

double ROOT::Math::breitwigner_cdf_c (double x, double gamma, double x0=0)
 Complement of the cumulative distribution function (upper tail) of the Breit_Wigner distribution and it is similar (just a different parameter definition) to the Cauchy distribution (see cauchy_cdf_c ).
double ROOT::Math::breitwigner_cdf (double x, double gamma, double x0=0)
 Cumulative distribution function (lower tail) of the Breit_Wigner distribution and it is similar (just a different parameter definition) to the Cauchy distribution (see cauchy_cdf ).
double ROOT::Math::cauchy_cdf_c (double x, double b, double x0=0)
 Complement of the cumulative distribution function (upper tail) of the Cauchy distribution which is also Lorentzian distribution.
double ROOT::Math::cauchy_cdf (double x, double b, double x0=0)
 Cumulative distribution function (lower tail) of the Cauchy distribution which is also Lorentzian distribution.
double ROOT::Math::exponential_cdf_c (double x, double lambda, double x0=0)
 double chisquared_cdf_c(double x, double r) {
double ROOT::Math::exponential_cdf (double x, double lambda, double x0=0)
 Cumulative distribution function of the exponential distribution (lower tail).
double ROOT::Math::gaussian_cdf_c (double x, double sigma, double x0=0)
 double fdistribution_cdf_c(double x, double n, double m) {
double ROOT::Math::gaussian_cdf (double x, double sigma, double x0=0)
 Cumulative distribution function of the normal (Gaussian) distribution (lower tail).
double ROOT::Math::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 ROOT::Math::lognormal_cdf (double x, double m, double s, double x0=0)
 Cumulative distribution function of the lognormal distribution (lower tail).
double ROOT::Math::normal_cdf_c (double x, double sigma, double x0=0)
 Complement of the cumulative distribution function of the normal (Gaussian) distribution (upper tail).
double ROOT::Math::normal_cdf (double x, double sigma, double x0=0)
 Cumulative distribution function of the normal (Gaussian) distribution (lower tail).
double ROOT::Math::uniform_cdf_c (double x, double a, double b, double x0=0)
 double tdistribution_cdf_c(double x, double r) {
double ROOT::Math::uniform_cdf (double x, double a, double b, double x0=0)
 Cumulative distribution function of the uniform (flat) distribution (lower tail).

Detailed Description

Probability density functions, cumulative distribution functions and their inverses for various statistical distributions (continuous and discrete).

Whenever possible the conventions followed are those of the CRC Concise Encyclopedia of Mathematics, Second Edition (or Mathworld). By convention the distributions are centered around 0, so for example in the case of a Gaussian there is no parameter mu. The user must calculate the shift himself if he wishes.

MathCore provides the majority of the probability density funcitons and a sub-set of the cumulative distributions. Additional distributions and all the inverses cumulative distributions (quantiles) are provided by MathMore library.

Author:
Created by Andras Zsenei on Wed Nov 17 2004

Function Documentation

double ROOT::Math::binomial_pdf unsigned int  k,
double  p,
unsigned int  n
 

Probability density function of the binomial distribution.

\[ p(k) = \frac{n!}{k! (n-k)!} p^k (1-p)^{n-k} \]

for $ 0 \leq k \leq n $. For detailed description see Mathworld.

Definition at line 27 of file PdfFuncMathCore.cxx.

References ROOT::Math::lgamma().

double ROOT::Math::breitwigner_cdf double  x,
double  gamma,
double  x0 = 0
 

Cumulative distribution function (lower tail) of the Breit_Wigner distribution and it is similar (just a different parameter definition) to the Cauchy distribution (see cauchy_cdf ).

\[ D(x) = \int_{-\infty}^{x} \frac{1}{\pi} \frac{b}{x'^2 + (\frac{1}{2} \Gamma)^2} dx' \]

Definition at line 28 of file ProbFuncMathCore.cxx.

References M_PI.

Referenced by ROOT::Math::breitwigner_quant().

double ROOT::Math::breitwigner_cdf_c double  x,
double  gamma,
double  x0 = 0
 

Complement of the cumulative distribution function (upper tail) of the Breit_Wigner distribution and it is similar (just a different parameter definition) to the Cauchy distribution (see cauchy_cdf_c ).

\[ D(x) = \int_{x}^{+\infty} \frac{1}{\pi} \frac{\frac{1}{2} \Gamma}{x'^2 + (\frac{1}{2} \Gamma)^2} dx' \]

Definition at line 20 of file ProbFuncMathCore.cxx.

References M_PI.

Referenced by ROOT::Math::breitwigner_prob().

double ROOT::Math::breitwigner_pdf double  x,
double  gamma,
double  x0 = 0
 

Probability density function of Breit-Wigner distribution, which is similar, just a different definition of the parameters, to the Cauchy distribution (see cauchy_pdf ).

\[ p(x) = \frac{1}{\pi} \frac{\frac{1}{2} \Gamma}{x^2 + (\frac{1}{2} \Gamma)^2} \]

Definition at line 39 of file PdfFuncMathCore.cxx.

References M_PI.

double ROOT::Math::cauchy_cdf double  x,
double  b,
double  x0 = 0
 

Cumulative distribution function (lower tail) of the Cauchy distribution which is also Lorentzian distribution.

It is similar (just a different parameter definition) to the Breit_Wigner distribution (see breitwigner_cdf )

\[ D(x) = \int_{-\infty}^{x} \frac{1}{\pi} \frac{ b }{ (x'-m)^2 + b^2} dx' \]

For detailed description see Mathworld.

Definition at line 44 of file ProbFuncMathCore.cxx.

References M_PI.

Referenced by ROOT::Math::cauchy_quant().

double ROOT::Math::cauchy_cdf_c double  x,
double  b,
double  x0 = 0
 

Complement of the cumulative distribution function (upper tail) of the Cauchy distribution which is also Lorentzian distribution.

It is similar (just a different parameter definition) to the Breit_Wigner distribution (see breitwigner_cdf_c )

\[ D(x) = \int_{x}^{+\infty} \frac{1}{\pi} \frac{ b }{ (x'-m)^2 + b^2} dx' \]

For detailed description see Mathworld.

Definition at line 36 of file ProbFuncMathCore.cxx.

References M_PI.

Referenced by ROOT::Math::cauchy_prob().

double ROOT::Math::cauchy_pdf double  x,
double  b = 1,
double  x0 = 0
 

Probability density function of the Cauchy distribution which is also called Lorentzian distribution.

\[ p(x) = \frac{1}{\pi} \frac{ b }{ (x-m)^2 + b^2} \]

For detailed description see Mathworld. It is also related to the breitwigner_pdf which will call the same implementation.

Definition at line 49 of file PdfFuncMathCore.cxx.

References M_PI.

double ROOT::Math::chisquared_pdf double  x,
double  r,
double  x0 = 0
 

Probability density function of the $\chi^2$ distribution with $r$ degrees of freedom.

\[ p_r(x) = \frac{1}{\Gamma(r/2) 2^{r/2}} x^{r/2-1} e^{-x/2} \]

for $x \geq 0$. For detailed description see Mathworld.

Definition at line 57 of file PdfFuncMathCore.cxx.

References ROOT::Math::lgamma().

double ROOT::Math::exponential_cdf double  x,
double  lambda,
double  x0 = 0
 

Cumulative distribution function of the exponential distribution (lower tail).

\[ D(x) = \int_{-\infty}^{x} \lambda e^{-\lambda x'} dx' \]

For detailed description see Mathworld.

Definition at line 84 of file ProbFuncMathCore.cxx.

Referenced by ROOT::Math::exponential_quant().

double ROOT::Math::exponential_cdf_c double  x,
double  lambda,
double  x0 = 0
 

double chisquared_cdf_c(double x, double r) {

\[ D(x) = \int_{x}^{+\infty} \lambda e^{-\lambda x'} dx' \]

For detailed description see Mathworld.

Definition at line 68 of file ProbFuncMathCore.cxx.

Referenced by ROOT::Math::exponential_prob().

double ROOT::Math::exponential_pdf double  x,
double  lambda,
double  x0 = 0
 

Probability density function of the exponential distribution.

\[ p(x) = \lambda e^{-\lambda x} \]

for x>0. For detailed description see Mathworld.

Definition at line 69 of file PdfFuncMathCore.cxx.

double ROOT::Math::fdistribution_pdf double  x,
double  n,
double  m,
double  x0 = 0
 

Probability density function of the F-distribution.

\[ p_{n,m}(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} \]

for x>=0. For detailed description see Mathworld.

Definition at line 81 of file PdfFuncMathCore.cxx.

References ROOT::Math::lgamma().

double ROOT::Math::gamma_pdf double  x,
double  alpha,
double  theta,
double  x0 = 0
 

Probability density function of the gamma distribution.

\[ p(x) = {1 \over \Gamma(\alpha) \theta^{\alpha}} x^{\alpha-1} e^{-x/\theta} \]

for x>0. For detailed description see Mathworld.

Definition at line 96 of file PdfFuncMathCore.cxx.

References ROOT::Math::lgamma().

double ROOT::Math::gaussian_cdf double  x,
double  sigma,
double  x0 = 0
 

Cumulative distribution function of the normal (Gaussian) distribution (lower tail).

\[ D(x) = \int_{-\infty}^{x} {1 \over \sqrt{2 \pi \sigma^2}} e^{-x'^2 / 2\sigma^2} dx' \]

For detailed description see Mathworld. It can also be evaluated using normal_quant which will call the same implementation.

Definition at line 141 of file ProbFuncMathCore.cxx.

References ROOT::Math::erf().

Referenced by ROOT::Math::gaussian_quant().

double ROOT::Math::gaussian_cdf_c double  x,
double  sigma,
double  x0 = 0
 

double fdistribution_cdf_c(double x, double n, double m) {

\[ D(x) = \int_{x}^{+\infty} {1 \over \sqrt{2 \pi \sigma^2}} e^{-x'^2 / 2\sigma^2} dx' \]

For detailed description see Mathworld. It can also be evaluated using normal_cdf_c which will call the same implementation.

Definition at line 133 of file ProbFuncMathCore.cxx.

References ROOT::Math::erf().

Referenced by ROOT::Math::gaussian_prob().

double ROOT::Math::gaussian_pdf double  x,
double  sigma,
double  x0 = 0
 

Probability density function of the normal (Gaussian) distribution.

\[ p(x) = {1 \over \sqrt{2 \pi \sigma^2}} e^{-x^2 / 2\sigma^2} \]

For detailed description see Mathworld. It can also be evaluated using normal_pdf which will call the same implementation.

Definition at line 118 of file PdfFuncMathCore.cxx.

References M_PI.

double ROOT::Math::lognormal_cdf double  x,
double  m,
double  s,
double  x0 = 0
 

Cumulative distribution function of the lognormal distribution (lower tail).

\[ D(x) = \int_{-\infty}^{x} {1 \over x' \sqrt{2 \pi s^2} } e^{-(\ln{x'} - m)^2/2 s^2} dx' \]

For detailed description see Mathworld.

Definition at line 157 of file ProbFuncMathCore.cxx.

References ROOT::Math::erf().

Referenced by ROOT::Math::lognormal_quant().

double ROOT::Math::lognormal_cdf_c double  x,
double  m,
double  s,
double  x0 = 0
 

Complement of the cumulative distribution function of the lognormal distribution (upper tail).

\[ D(x) = \int_{x}^{+\infty} {1 \over x' \sqrt{2 \pi s^2} } e^{-(\ln{x'} - m)^2/2 s^2} dx' \]

For detailed description see Mathworld.

Definition at line 149 of file ProbFuncMathCore.cxx.

References ROOT::Math::erf().

Referenced by ROOT::Math::lognormal_prob().

double ROOT::Math::lognormal_pdf double  x,
double  m,
double  s,
double  x0 = 0
 

double landau_pdf(double x) {

\[ p(x) = {1 \over x \sqrt{2 \pi s^2} } e^{-(\ln{x} - m)^2/2 s^2} \]

for x>0. For detailed description see Mathworld.

Definition at line 134 of file PdfFuncMathCore.cxx.

References M_PI.

double ROOT::Math::normal_cdf double  x,
double  sigma,
double  x0 = 0
 

Cumulative distribution function of the normal (Gaussian) distribution (lower tail).

\[ D(x) = \int_{-\infty}^{x} {1 \over \sqrt{2 \pi \sigma^2}} e^{-x'^2 / 2\sigma^2} dx' \]

For detailed description see Mathworld. It can also be evaluated using gaussian_quant which will call the same implementation.

Definition at line 173 of file ProbFuncMathCore.cxx.

References ROOT::Math::erf().

Referenced by ROOT::Math::normal_quant().

double ROOT::Math::normal_cdf_c double  x,
double  sigma,
double  x0 = 0
 

Complement of the cumulative distribution function of the normal (Gaussian) distribution (upper tail).

\[ D(x) = \int_{x}^{+\infty} {1 \over \sqrt{2 \pi \sigma^2}} e^{-x'^2 / 2\sigma^2} dx' \]

For detailed description see Mathworld. It can also be evaluated using gaussian_prob which will call the same implementation.

Definition at line 165 of file ProbFuncMathCore.cxx.

References ROOT::Math::erf().

Referenced by ROOT::Math::normal_prob().

double ROOT::Math::normal_pdf double  x,
double  sigma,
double  x0 = 0
 

Probability density function of the normal (Gaussian) distribution.

\[ p(x) = {1 \over \sqrt{2 \pi \sigma^2}} e^{-x^2 / 2\sigma^2} \]

For detailed description see Mathworld. It can also be evaluated using gaussian_pdf which will call the same implementation.

Definition at line 147 of file PdfFuncMathCore.cxx.

References M_PI.

double ROOT::Math::poisson_pdf unsigned int  n,
double  mu
 

Probability density function of the Poisson distribution.

\[ p(n) = \frac{\mu^n}{n!} e^{- \mu} \]

For detailed description see Mathworld.

Definition at line 156 of file PdfFuncMathCore.cxx.

References ROOT::Math::lgamma().

double ROOT::Math::tdistribution_pdf double  x,
double  r,
double  x0 = 0
 

Probability density function of Student's t-distribution.

\[ p_{r}(x) = \frac{\Gamma(\frac{r+1}{2})}{\sqrt{r \pi}\Gamma(\frac{r}{2})} \left( 1+\frac{x^2}{r}\right)^{-(r+1)/2} \]

for $k \geq 0$. For detailed description see Mathworld.

Definition at line 164 of file PdfFuncMathCore.cxx.

References ROOT::Math::lgamma(), and M_PI.

double ROOT::Math::uniform_cdf double  x,
double  a,
double  b,
double  x0 = 0
 

Cumulative distribution function of the uniform (flat) distribution (lower tail).

\[ D(x) = \int_{-\infty}^{x} {1 \over (b-a)} dx' \]

For detailed description see Mathworld.

Definition at line 210 of file ProbFuncMathCore.cxx.

Referenced by ROOT::Math::uniform_quant().

double ROOT::Math::uniform_cdf_c double  x,
double  a,
double  b,
double  x0 = 0
 

double tdistribution_cdf_c(double x, double r) {

\[ D(x) = \int_{x}^{+\infty} {1 \over (b-a)} dx' \]

For detailed description see Mathworld.

Definition at line 197 of file ProbFuncMathCore.cxx.

Referenced by ROOT::Math::uniform_prob().

double ROOT::Math::uniform_pdf double  x,
double  a,
double  b,
double  x0 = 0
 

Probability density function of the uniform (flat) distribution.

\[ p(x) = {1 \over (b-a)} \]

if $a \leq x<b$ and 0 otherwise. For detailed description see Mathworld.

Definition at line 173 of file PdfFuncMathCore.cxx.


Generated on Fri Jun 29 11:29:34 2007 for MathCore by  doxygen 1.4.6