Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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.

Functions

double ROOT::Math::noncentral_chisquared_pdf (double x, double r, double lambda)
 Probability density function of the non central \(\chi^2\) distribution with \(r\) degrees of freedom and the noon-central parameter \(\lambda\).
 
double ROOT::Math::vavilov_accurate_pdf (double x, double kappa, double beta2)
 The Vavilov probability density function.
 
double ROOT::Math::vavilov_fast_pdf (double x, double kappa, double beta2)
 The Vavilov probability density function.
 

Probability Density Functions from MathCore

Additional PDF's are provided in the MathMore library (see PDF functions from MathMore)

double ROOT::Math::beta_pdf (double x, double a, double b)
 Probability density function of the beta distribution.
 
double ROOT::Math::binomial_pdf (unsigned int k, double p, unsigned int n)
 Probability density function of the binomial distribution.
 
double ROOT::Math::negative_binomial_pdf (unsigned int k, double p, double n)
 Probability density function of the negative 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::crystalball_function (double x, double alpha, double n, double sigma, double mean=0)
 Crystal ball function.
 
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=1, double x0=0)
 Probability density function of the normal (Gaussian) distribution.
 
double ROOT::Math::bigaussian_pdf (double x, double y, double sigmax=1, double sigmay=1, double rho=0, double x0=0, double y0=0)
 Probability density function of the bi-dimensional (Gaussian) distribution.
 
double ROOT::Math::landau_pdf (double x, double xi=1, double x0=0)
 Probability density function of the Landau distribution:
 
double ROOT::Math::lognormal_pdf (double x, double m, double s, double x0=0)
 Probability density function of the lognormal distribution.
 
double ROOT::Math::normal_pdf (double x, double sigma=1, 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.
 
double ROOT::Math::crystalball_pdf (double x, double alpha, double n, double sigma, double mean=0)
 pdf definition of the crystal_ball which is defined only for n > 1 otherwise integral is diverging
 

Function Documentation

◆ beta_pdf()

double ROOT::Math::beta_pdf ( double  x,
double  a,
double  b 
)
inline

Probability density function of the beta distribution.

\[ p(x) = \frac{\Gamma (a + b) } {\Gamma(a)\Gamma(b) } x ^{a-1} (1 - x)^{b-1} \]

for \(0 \leq x \leq 1 \). For detailed description see Mathworld.

Definition at line 82 of file PdfFuncMathCore.h.

◆ bigaussian_pdf()

double ROOT::Math::bigaussian_pdf ( double  x,
double  y,
double  sigmax = 1,
double  sigmay = 1,
double  rho = 0,
double  x0 = 0,
double  y0 = 0 
)
inline

Probability density function of the bi-dimensional (Gaussian) distribution.

\[ p(x) = {1 \over 2 \pi \sigma_x \sigma_y \sqrt{1-\rho^2}} \exp (-((x-x0)^2/\sigma_x^2 + (y-y0)^2/\sigma_y^2 - 2 \rho x y/(\sigma_x\sigma_y))/2(1-\rho^2)) \]

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

Parameters
xx variable
yy variable
sigmaxthe stdev in x
sigmaythe stdev in y
rhocorrelation, must be between -1,1
x0the offset in x
y0the offset in y

Definition at line 431 of file PdfFuncMathCore.h.

◆ binomial_pdf()

double ROOT::Math::binomial_pdf ( unsigned int  k,
double  p,
unsigned int  n 
)
inline

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 118 of file PdfFuncMathCore.h.

◆ breitwigner_pdf()

double ROOT::Math::breitwigner_pdf ( double  x,
double  gamma,
double  x0 = 0 
)
inline

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 175 of file PdfFuncMathCore.h.

◆ cauchy_pdf()

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

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 201 of file PdfFuncMathCore.h.

◆ chisquared_pdf()

double ROOT::Math::chisquared_pdf ( double  x,
double  r,
double  x0 = 0 
)
inline

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 225 of file PdfFuncMathCore.h.

◆ crystalball_function()

double ROOT::Math::crystalball_function ( double  x,
double  alpha,
double  n,
double  sigma,
double  mean = 0 
)
inline

Crystal ball function.

See the definition at Wikipedia.

It is not really a pdf since it is not normalized

Definition at line 254 of file PdfFuncMathCore.h.

◆ crystalball_pdf()

double ROOT::Math::crystalball_pdf ( double  x,
double  alpha,
double  n,
double  sigma,
double  mean = 0 
)
inline

pdf definition of the crystal_ball which is defined only for n > 1 otherwise integral is diverging

Definition at line 278 of file PdfFuncMathCore.h.

◆ exponential_pdf()

double ROOT::Math::exponential_pdf ( double  x,
double  lambda,
double  x0 = 0 
)
inline

Probability density function of the exponential distribution.

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

for x>0. For detailed description see Mathworld.

Definition at line 306 of file PdfFuncMathCore.h.

◆ fdistribution_pdf()

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

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 332 of file PdfFuncMathCore.h.

◆ gamma_pdf()

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

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 363 of file PdfFuncMathCore.h.

◆ gaussian_pdf()

double ROOT::Math::gaussian_pdf ( double  x,
double  sigma = 1,
double  x0 = 0 
)
inline

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 402 of file PdfFuncMathCore.h.

◆ landau_pdf()

double ROOT::Math::landau_pdf ( double  x,
double  xi = 1,
double  x0 = 0 
)

Probability density function of the Landau distribution:

\[ p(x) = \frac{1}{\xi} \phi (\lambda) \]

with

\[ \phi(\lambda) = \frac{1}{2 \pi i}\int_{c-i\infty}^{c+i\infty} e^{\lambda s + s \log{s}} ds\]

where \(\lambda = (x-x_0)/\xi\). For a detailed description see K.S. Kölbig and B. Schorr, A program package for the Landau distribution, Computer Phys. Comm. 31 (1984) 97-111 [Erratum-ibid. 178 (2008) 972]. The same algorithms as in CERNLIB (DENLAN) is used

Parameters
xThe argument \(x\)
xiThe width parameter \(\xi\)
x0The location parameter \(x_0\)

Definition at line 21 of file PdfFuncMathCore.cxx.

◆ lognormal_pdf()

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

Probability density function of the lognormal distribution.

\[ 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.

Parameters
xx variable
mM = 0 for lognormal
sscale parameter (not the sigma of the distribution which is not even defined)
x0location parameter, corresponds approximately to the most probable value. For x0 = 0, sigma = 1, the x_mpv = -0.22278

Definition at line 483 of file PdfFuncMathCore.h.

◆ negative_binomial_pdf()

double ROOT::Math::negative_binomial_pdf ( unsigned int  k,
double  p,
double  n 
)
inline

Probability density function of the negative binomial distribution.

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

For detailed description see Mathworld (where \(k \to x\) and \(n \to r\)). The distribution in Wikipedia is defined with a \(p\) corresponding to \(1-p\) in this case.

Definition at line 146 of file PdfFuncMathCore.h.

◆ noncentral_chisquared_pdf()

double ROOT::Math::noncentral_chisquared_pdf ( double  x,
double  r,
double  lambda 
)

Probability density function of the non central \(\chi^2\) distribution with \(r\) degrees of freedom and the noon-central parameter \(\lambda\).

\[ 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 22 of file PdfFuncMathMore.cxx.

◆ normal_pdf()

double ROOT::Math::normal_pdf ( double  x,
double  sigma = 1,
double  x0 = 0 
)
inline

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 509 of file PdfFuncMathCore.h.

◆ poisson_pdf()

double ROOT::Math::poisson_pdf ( unsigned int  n,
double  mu 
)
inline

Probability density function of the Poisson distribution.

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

For detailed description see Mathworld.

Definition at line 532 of file PdfFuncMathCore.h.

◆ tdistribution_pdf()

double ROOT::Math::tdistribution_pdf ( double  x,
double  r,
double  x0 = 0 
)
inline

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 563 of file PdfFuncMathCore.h.

◆ uniform_pdf()

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

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 588 of file PdfFuncMathCore.h.

◆ vavilov_accurate_pdf()

double ROOT::Math::vavilov_accurate_pdf ( double  x,
double  kappa,
double  beta2 
)

The Vavilov probability density function.

Parameters
xThe Landau parameter \(x = \lambda_L\)
kappaThe parameter \(\kappa\), which must be in the range \(\kappa \ge 0.001 \)
beta2The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \)

Definition at line 461 of file VavilovAccurate.cxx.

◆ vavilov_fast_pdf()

double ROOT::Math::vavilov_fast_pdf ( double  x,
double  kappa,
double  beta2 
)

The Vavilov probability density function.

Parameters
xThe Landau parameter \(x = \lambda_L\)
kappaThe parameter \(\kappa\), which must be in the range \(0.01 \le \kappa \le 12 \)
beta2The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \)

Definition at line 577 of file VavilovFast.cxx.