[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |

## 25.6 Distributions

Octave has functions for computing the Probability Density Function (PDF), the Cumulative Distribution function (CDF), and the quantile (the inverse of the CDF) of a large number of distributions.

The following table summarizes the supported distributions (in alphabetical order).

| | | |

Beta Distribution | | | |

Binomial Distribution | | | |

Cauchy Distribution | | | |

Chi-Square Distribution | | | |

Univariate Discrete Distribution | | | |

Empirical Distribution | | | |

Exponential Distribution | | | |

F Distribution | | | |

Gamma Distribution | | | |

Geometric Distribution | | | |

Hypergeometric Distribution | | | |

Kolmogorov Smirnov Distribution | | | |

Laplace Distribution | | | |

Logistic Distribution | | | |

Log-Normal Distribution | | | |

Pascal Distribution | | | |

Univariate Normal Distribution | | | |

Poisson Distribution | | | |

t (Student) Distribution | | | |

Univariate Discrete Distribution | | | |

Uniform Distribution | | | |

Weibull Distribution | | | |

__Function File:__**betacdf***(*`x`,`a`,`b`)For each element of

`x`, returns the CDF at`x`of the beta distribution with parameters`a`and`b`, i.e., PROB (beta (`a`,`b`) <=`x`).

__Function File:__**betainv***(*`x`,`a`,`b`)For each component of

`x`, compute the quantile (the inverse of the CDF) at`x`of the Beta distribution with parameters`a`and`b`.

__Function File:__**betapdf***(*`x`,`a`,`b`)For each element of

`x`, returns the PDF at`x`of the beta distribution with parameters`a`and`b`.

__Function File:__**binocdf***(*`x`,`n`,`p`)For each element of

`x`, compute the CDF at`x`of the binomial distribution with parameters`n`and`p`.

__Function File:__**binoinv***(*`x`,`n`,`p`)For each element of

`x`, compute the quantile at`x`of the binomial distribution with parameters`n`and`p`.

__Function File:__**binopdf***(*`x`,`n`,`p`)For each element of

`x`, compute the probability density function (PDF) at`x`of the binomial distribution with parameters`n`and`p`.

__Function File:__**cauchy_cdf***(*`x`,`lambda`,`sigma`)For each element of

`x`, compute the cumulative distribution function (CDF) at`x`of the Cauchy distribution with location parameter`lambda`and scale parameter`sigma`. Default values are`lambda`= 0,`sigma`= 1.

__Function File:__**cauchy_inv***(*`x`,`lambda`,`sigma`)For each element of

`x`, compute the quantile (the inverse of the CDF) at`x`of the Cauchy distribution with location parameter`lambda`and scale parameter`sigma`. Default values are`lambda`= 0,`sigma`= 1.

__Function File:__**cauchy_pdf***(*`x`,`lambda`,`sigma`)For each element of

`x`, compute the probability density function (PDF) at`x`of the Cauchy distribution with location parameter`lambda`and scale parameter`sigma`> 0. Default values are`lambda`= 0,`sigma`= 1.

__Function File:__**chi2cdf***(*`x`,`n`)For each element of

`x`, compute the cumulative distribution function (CDF) at`x`of the chisquare distribution with`n`degrees of freedom.

__Function File:__**chi2inv***(*`x`,`n`)For each element of

`x`, compute the quantile (the inverse of the CDF) at`x`of the chisquare distribution with`n`degrees of freedom.

__Function File:__**chisquare_pdf***(*`x`,`n`)For each element of

`x`, compute the probability density function (PDF) at`x`of the chisquare distribution with`n`degrees of freedom.

__Function File:__**discrete_cdf***(*`x`,`v`,`p`)For each element of

`x`, compute the cumulative distribution function (CDF) at`x`of a univariate discrete distribution which assumes the values in`v`with probabilities`p`.

__Function File:__**discrete_inv***(*`x`,`v`,`p`)For each component of

`x`, compute the quantile (the inverse of the CDF) at`x`of the univariate distribution which assumes the values in`v`with probabilities`p`.

__Function File:__**discrete_pdf***(*`x`,`v`,`p`)For each element of

`x`, compute the probability density function (PDF) at`x`of a univariate discrete distribution which assumes the values in`v`with probabilities`p`.

__Function File:__**empirical_cdf***(*`x`,`data`)For each element of

`x`, compute the cumulative distribution function (CDF) at`x`of the empirical distribution obtained from the univariate sample`data`.

__Function File:__**empirical_inv***(*`x`,`data`)For each element of

`x`, compute the quantile (the inverse of the CDF) at`x`of the empirical distribution obtained from the univariate sample`data`.

__Function File:__**empirical_pdf***(*`x`,`data`)For each element of

`x`, compute the probability density function (PDF) at`x`of the empirical distribution obtained from the univariate sample`data`.

__Function File:__**expcdf***(*`x`,`lambda`)For each element of

`x`, compute the cumulative distribution function (CDF) at`x`of the exponential distribution with mean`lambda`.The arguments can be of common size or scalar.

__Function File:__**expinv***(*`x`,`lambda`)For each element of

`x`, compute the quantile (the inverse of the CDF) at`x`of the exponential distribution with mean`lambda`.

__Function File:__**exppdf***(*`x`,`lambda`)For each element of

`x`, compute the probability density function (PDF) of the exponential distribution with mean`lambda`.

__Function File:__**fcdf***(*`x`,`m`,`n`)For each element of

`x`, compute the CDF at`x`of the F distribution with`m`and`n`degrees of freedom, i.e., PROB (F (`m`,`n`) <=`x`).

__Function File:__**finv***(*`x`,`m`,`n`)For each component of

`x`, compute the quantile (the inverse of the CDF) at`x`of the F distribution with parameters`m`and`n`.

__Function File:__**fpdf***(*`x`,`m`,`n`)For each element of

`x`, compute the probability density function (PDF) at`x`of the F distribution with`m`and`n`degrees of freedom.

__Function File:__**gamcdf***(*`x`,`a`,`b`)For each element of

`x`, compute the cumulative distribution function (CDF) at`x`of the Gamma distribution with parameters`a`and`b`.

__Function File:__**gaminv***(*`x`,`a`,`b`)For each component of

`x`, compute the quantile (the inverse of the CDF) at`x`of the Gamma distribution with parameters`a`and`b`.

__Function File:__**gampdf***(*`x`,`a`,`b`)For each element of

`x`, return the probability density function (PDF) at`x`of the Gamma distribution with parameters`a`and`b`.

__Function File:__**geocdf***(*`x`,`p`)For each element of

`x`, compute the CDF at`x`of the geometric distribution with parameter`p`.

__Function File:__**geoinv***(*`x`,`p`)For each element of

`x`, compute the quantile at`x`of the geometric distribution with parameter`p`.

__Function File:__**geopdf***(*`x`,`p`)For each element of

`x`, compute the probability density function (PDF) at`x`of the geometric distribution with parameter`p`.

__Function File:__**hygecdf***(*`x`,`t`,`m`,`n`)Compute the cumulative distribution function (CDF) at

`x`of the hypergeometric distribution with parameters`t`,`m`, and`n`. This is the probability of obtaining not more than`x`marked items when randomly drawing a sample of size`n`without replacement from a population of total size`t`containing`m`marked items.The parameters

`t`,`m`, and`n`must positive integers with`m`and`n`not greater than`t`.

__Function File:__**hygeinv***(*`x`,`t`,`m`,`n`)For each element of

`x`, compute the quantile at`x`of the hypergeometric distribution with parameters`t`,`m`, and`n`.The parameters

`t`,`m`, and`n`must positive integers with`m`and`n`not greater than`t`.

__Function File:__**hygepdf***(*`x`,`t`,`m`,`n`)Compute the probability density function (PDF) at

`x`of the hypergeometric distribution with parameters`t`,`m`, and`n`. This is the probability of obtaining`x`marked items when randomly drawing a sample of size`n`without replacement from a population of total size`t`containing`m`marked items.The arguments must be of common size or scalar.

__Function File:__**kolmogorov_smirnov_cdf***(*`x`,`tol`)Return the CDF at

`x`of the Kolmogorov-Smirnov distribution,Inf Q(x) = SUM (-1)^k exp(-2 k^2 x^2) k = -Inf

for

`x`> 0.The optional parameter

`tol`specifies the precision up to which the series should be evaluated; the default is`tol`=`eps`

.

__Function File:__**laplace_cdf***(*`x`)For each element of

`x`, compute the cumulative distribution function (CDF) at`x`of the Laplace distribution.

__Function File:__**laplace_inv***(*`x`)For each element of

`x`, compute the quantile (the inverse of the CDF) at`x`of the Laplace distribution.

__Function File:__**laplace_pdf***(*`x`)For each element of

`x`, compute the probability density function (PDF) at`x`of the Laplace distribution.

__Function File:__**logistic_cdf***(*`x`)For each component of

`x`, compute the CDF at`x`of the logistic distribution.

__Function File:__**logistic_inv***(*`x`)For each component of

`x`, compute the quantile (the inverse of the CDF) at`x`of the logistic distribution.

__Function File:__**logistic_pdf***(*`x`)For each component of

`x`, compute the PDF at`x`of the logistic distribution.

__Function File:__**logncdf***(*`x`,`mu`,`sigma`)For each element of

`x`, compute the cumulative distribution function (CDF) at`x`of the lognormal distribution with parameters`mu`and`sigma`. If a random variable follows this distribution, its logarithm is normally distributed with mean`mu`and standard deviation`sigma`.Default values are

`mu`= 1,`sigma`= 1.

__Function File:__**logninv***(*`x`,`mu`,`sigma`)For each element of

`x`, compute the quantile (the inverse of the CDF) at`x`of the lognormal distribution with parameters`mu`and`sigma`. If a random variable follows this distribution, its logarithm is normally distributed with mean`log (`

and variance`mu`)`sigma`.Default values are

`mu`= 1,`sigma`= 1.

__Function File:__**lognpdf***(*`x`,`mu`,`sigma`)For each element of

`x`, compute the probability density function (PDF) at`x`of the lognormal distribution with parameters`mu`and`sigma`. If a random variable follows this distribution, its logarithm is normally distributed with mean`mu`and standard deviation`sigma`.Default values are

`mu`= 1,`sigma`= 1.

__Function File:__**nbincdf***(*`x`,`n`,`p`)For each element of

`x`, compute the CDF at x of the Pascal (negative binomial) distribution with parameters`n`and`p`.The number of failures in a Bernoulli experiment with success probability

`p`before the`n`-th success follows this distribution.

__Function File:__**nbininv***(*`x`,`n`,`p`)For each element of

`x`, compute the quantile at`x`of the Pascal (negative binomial) distribution with parameters`n`and`p`.The number of failures in a Bernoulli experiment with success probability

`p`before the`n`-th success follows this distribution.

__Function File:__**nbinpdf***(*`x`,`n`,`p`)For each element of

`x`, compute the probability density function (PDF) at`x`of the Pascal (negative binomial) distribution with parameters`n`and`p`.The number of failures in a Bernoulli experiment with success probability

`p`before the`n`-th success follows this distribution.

__Function File:__**normcdf***(*`x`,`m`,`s`)For each element of

`x`, compute the cumulative distribution function (CDF) at`x`of the normal distribution with mean`m`and standard deviation`s`.Default values are

`m`= 0,`s`= 1.

__Function File:__**norminv***(*`x`,`m`,`s`)For each element of

`x`, compute the quantile (the inverse of the CDF) at`x`of the normal distribution with mean`m`and standard deviation`s`.Default values are

`m`= 0,`s`= 1.

__Function File:__**normpdf***(*`x`,`m`,`s`)For each element of

`x`, compute the probability density function (PDF) at`x`of the normal distribution with mean`m`and standard deviation`s`.Default values are

`m`= 0,`s`= 1.

__Function File:__**poisscdf***(*`x`,`lambda`)For each element of

`x`, compute the cumulative distribution function (CDF) at`x`of the Poisson distribution with parameter lambda.

__Function File:__**poissinv***(*`x`,`lambda`)For each component of

`x`, compute the quantile (the inverse of the CDF) at`x`of the Poisson distribution with parameter`lambda`.

__Function File:__**poisspdf***(*`x`,`lambda`)For each element of

`x`, compute the probability density function (PDF) at`x`of the poisson distribution with parameter`lambda`.

__Function File:__**tcdf***(*`x`,`n`)For each element of

`x`, compute the cumulative distribution function (CDF) at`x`of the t (Student) distribution with`n`degrees of freedom, i.e., PROB (t(`n`) <=`x`).

__Function File:__**tinv***(*`x`,`n`)For each probability value

`x`, compute the inverse of the cumulative distribution function (CDF) of the t (Student) distribution with degrees of freedom`n`. This function is analogous to looking in a table for the t-value of a single-tailed distribution.

__Function File:__**tpdf***(*`x`,`n`)For each element of

`x`, compute the probability density function (PDF) at`x`of the`t`(Student) distribution with`n`degrees of freedom.

__Function File:__**unidcdf***(*`x`,`v`)For each element of

`x`, compute the cumulative distribution function (CDF) at`x`of a univariate discrete distribution which assumes the values in`v`with equal probability.

__Function File:__**unidinv***(*`x`,`v`)For each component of

`x`, compute the quantile (the inverse of the CDF) at`x`of the univariate discrete distribution which assumes the values in`v`with equal probability

__Function File:__**unidpdf***(*`x`,`v`)For each element of

`x`, compute the probability density function (PDF) at`x`of a univariate discrete distribution which assumes the values in`v`with equal probability.

__Function File:__**unifcdf***(*`x`,`a`,`b`)Return the CDF at

`x`of the uniform distribution on [`a`,`b`], i.e., PROB (uniform (`a`,`b`) <= x).Default values are

`a`= 0,`b`= 1.

__Function File:__**unifinv***(*`x`,`a`,`b`)For each element of

`x`, compute the quantile (the inverse of the CDF) at`x`of the uniform distribution on [`a`,`b`].Default values are

`a`= 0,`b`= 1.

__Function File:__**unifpdf***(*`x`,`a`,`b`)For each element of

`x`, compute the PDF at`x`of the uniform distribution on [`a`,`b`].Default values are

`a`= 0,`b`= 1.

__Function File:__**wblcdf***(*`x`,`scale`,`shape`)Compute the cumulative distribution function (CDF) at

`x`of the Weibull distribution with shape parameter`scale`and scale parameter`shape`, which is1 - exp(-(x/shape)^scale)

for

`x`>= 0.

__Function File:__**wblinv***(*`x`,`scale`,`shape`)Compute the quantile (the inverse of the CDF) at

`x`of the Weibull distribution with shape parameter`scale`and scale parameter`shape`.

__Function File:__**wblpdf***(*`x`,`scale`,`shape`)Compute the probability density function (PDF) at

`x`of the Weibull distribution with shape parameter`scale`and scale parameter`shape`which is given byscale * shape^(-scale) * x^(scale-1) * exp(-(x/shape)^scale)

for

`x`> 0.

[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |