Engee documentation

Univariate Distributions

Univariate distributions are the distributions whose variate forms are Univariate (i.e each sample is a scalar). Abstract types for univariate distributions:

const UnivariateDistribution{S<:ValueSupport} = Distribution{Univariate,S}

const DiscreteUnivariateDistribution   = Distribution{Univariate, Discrete}
const ContinuousUnivariateDistribution = Distribution{Univariate, Continuous}

Common Interface

A series of methods is implemented for each univariate distribution, which provides useful functionalities such as moment computation, pdf evaluation, and sampling (i.e. random number generation).

Parameter Retrieval

params are defined for all univariate distributions, while other parameter retrieval methods are only defined for those distributions for which these parameters make sense. See below for details.
params(d::UnivariateDistribution)

Return a tuple of parameters. Let d be a distribution of type D, then D(params(d)...) will construct exactly the same distribution as .

scale(d::UnivariateDistribution)

Get the scale parameter.

location(d::UnivariateDistribution)

Get the location parameter.

shape(d::UnivariateDistribution)

Get the shape parameter.

rate(d::UnivariateDistribution)

Get the rate parameter.

ncategories(d::UnivariateDistribution)

Get the number of categories.

ntrials(d::UnivariateDistribution)

Get the number of trials.

dof(d::UnivariateDistribution)

Get the degrees of freedom.

For distributions for which success and failure have a meaning, the following methods are defined:

succprob(d::DiscreteUnivariateDistribution)

Get the probability of success.

failprob(d::DiscreteUnivariateDistribution)

Get the probability of failure.

Computation of statistics

maximum(d::Distribution)

Return the maximum of the support of d.

minimum(d::Distribution)

Return the minimum of the support of d.

extrema(d::Distribution)

Return the minimum and maximum of the support of d as a 2-tuple.

mean(d::UnivariateDistribution)

Compute the expectation.

var(d::UnivariateDistribution)

Compute the variance. (A generic std is provided as std(d) = sqrt(var(d)))

std(d::UnivariateDistribution)

Return the standard deviation of distribution d, i.e. sqrt(var(d)).

median(d::UnivariateDistribution)

Return the median value of distribution d. The median is the smallest x such that cdf(d, x) ≥ 1/2. Corresponding to this definition as 1/2-quantile, a fallback is provided calling the quantile function.

modes(d::UnivariateDistribution)

Get all modes (if this makes sense).

mode(d::UnivariateDistribution)

Returns the first mode.

skewness(d::UnivariateDistribution)

Compute the skewness.

kurtosis(d::UnivariateDistribution)

Compute the excessive kurtosis.

kurtosis(d::Distribution, correction::Bool)

Computes excess kurtosis by default. Proper kurtosis can be returned with correction=false

isplatykurtic(d)

Return whether d is platykurtic (i.e kurtosis(d) < 0).

isleptokurtic(d)

Return whether d is leptokurtic (i.e kurtosis(d) > 0).

ismesokurtic(d)

Return whether d is mesokurtic (i.e kurtosis(d) == 0).

entropy(d::UnivariateDistribution)

Compute the entropy value of distribution d.

entropy(d::UnivariateDistribution, b::Real)

Compute the entropy value of distribution d, w.r.t. a given base.

entropy(d::UnivariateDistribution, b::Real)

Compute the entropy value of distribution d, w.r.t. a given base.

mgf(d::UnivariateDistribution, t)

Evaluate the moment-generating function of distribution d at t.

See also cgf

cgf(d::UnivariateDistribution, t)

Evaluate the cumulant-generating function of distribution d at t.

The cumulant-generating-function is the logarithm of the moment-generating function: cgf = log ∘ mgf. In practice, however, the right hand side may have overflow issues.

See also mgf

cf(d::UnivariateDistribution, t)

Evaluate the characteristic function of distribution d.

pdfsquaredL2norm(d::Distribution)

Return the square of the L2 norm of the probability density function of the distribution d:

where is the support of .

Probability Evaluation

insupport(d::UnivariateDistribution, x::Any)

When x is a scalar, it returns whether x is within the support of d (e.g., insupport(d, x) = minimum(d) <= x <= maximum(d)). When x is an array, it returns whether every element in x is within the support of d.

Generic fallback methods are provided, but it is often the case that insupport can be done more efficiently, and a specialized insupport is thus desirable. You should also override this function if the support is composed of multiple disjoint intervals.

pdf(d::UnivariateDistribution, x::Real)

Evaluate the probability density (mass) at x.

See also: logpdf.

logpdf(d::UnivariateDistribution, x::Real)

Evaluate the logarithm of probability density (mass) at x.

See also: pdf.

cdf(d::UnivariateDistribution, x::Real)

Evaluate the cumulative probability at x.

See also ccdf, logcdf, and logccdf.

logcdf(d::UnivariateDistribution, x::Real)

The logarithm of the cumulative function value(s) evaluated at x, i.e. log(cdf(x)).

logdiffcdf(d::UnivariateDistribution, x::Real, y::Real)

The natural logarithm of the difference between the cumulative density function at x and y, i.e. log(cdf(x) - cdf(y)).

ccdf(d::UnivariateDistribution, x::Real)

The complementary cumulative function evaluated at x, i.e. 1 - cdf(d, x).

logccdf(d::UnivariateDistribution, x::Real)

The logarithm of the complementary cumulative function values evaluated at x, i.e. log(ccdf(x)).

quantile(d::UnivariateDistribution, q::Real)

Evaluate the inverse cumulative distribution function at q.

See also: cquantile, invlogcdf, and invlogccdf.

cquantile(d::UnivariateDistribution, q::Real)

The complementary quantile value, i.e. quantile(d, 1-q).

invlogcdf(d::UnivariateDistribution, lp::Real)

The inverse function of logcdf.

invlogccdf(d::UnivariateDistribution, lp::Real)

The inverse function of logccdf.

Sampling (Random number generation)

rand(rng::AbstractRNG, d::UnivariateDistribution)

Generate a scalar sample from d. The general fallback is quantile(d, rand()).

rand!(::AbstractRNG, ::Sampleable, ::AbstractArray)

Samples in-place from the sampler and stores the result in the provided array.

Continuous Distributions

Arcsine(a,b)

The Arcsine distribution has probability density function

Arcsine()        # Arcsine distribution with support [0, 1]
Arcsine(b)       # Arcsine distribution with support [0, b]
Arcsine(a, b)    # Arcsine distribution with support [a, b]

params(d)        # Get the parameters, i.e. (a, b)
minimum(d)       # Get the lower bound, i.e. a
maximum(d)       # Get the upper bound, i.e. b
location(d)      # Get the left bound, i.e. a
scale(d)         # Get the span of the support, i.e. b - a

External links

Use Arcsine(a, b, check_args=false) to bypass argument checks.

0 2 4 6 8 10 0 0.2 0.4 0.6 0.8 1.0 Arcsine(0, 1) x density

Beta(α, β)

The Beta distribution has probability density function

The Beta distribution is related to the Gamma distribution via the property that if and independently, then .

Beta()        # equivalent to Beta(1, 1)
Beta(α)       # equivalent to Beta(α, α)
Beta(α, β)    # Beta distribution with shape parameters α and β

params(d)     # Get the parameters, i.e. (α, β)

External links

0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 0 0.2 0.4 0.6 0.8 1.0 Beta(2, 2) x density

BetaPrime(α, β)

The Beta prime distribution has probability density function

The Beta prime distribution is related to the Beta distribution via the relationship that if then

BetaPrime()        # equivalent to BetaPrime(1, 1)
BetaPrime(α)       # equivalent to BetaPrime(α, α)
BetaPrime(α, β)    # Beta prime distribution with shape parameters α and β

params(d)          # Get the parameters, i.e. (α, β)

External links

0.5 1.0 1.5 2.0 0 0.2 0.4 0.6 0.8 1.0 BetaPrime(1, 2) x density

Biweight(μ, σ)

0 0.1 0.2 0.3 0.4 0.5 - 1 0 1 2 3 Biweight(1, 2) x density

Cauchy(μ, σ)

The Cauchy distribution with location μ and scale σ has probability density function

Cauchy()         # Standard Cauchy distribution, i.e. Cauchy(0, 1)
Cauchy(μ)        # Cauchy distribution with location μ and unit scale, i.e. Cauchy(μ, 1)
Cauchy(μ, σ)     # Cauchy distribution with location μ and scale σ

params(d)        # Get the parameters, i.e. (μ, σ)
location(d)      # Get the location parameter, i.e. μ
scale(d)         # Get the scale parameter, i.e. σ

External links

0 0.05 0.10 0.15 0.20 0.25 0.30 - 10 - 5 0 5 Cauchy(-2, 1) x density

Chernoff()

The Chernoff distribution is the distribution of the random variable

where is standard two-sided Brownian motion.

The distribution arises as the limit distribution of various cube-root-n consistent estimators, including the isotonic regression estimator of Brunk, the isotonic density estimator of Grenander, the least median of squares estimator of Rousseeuw, and the maximum score estimator of Manski.

For theoretical results, see e.g. Kim and Pollard, Annals of Statistics, 1990. The code for the computation of pdf and cdf is based on the algorithm described in Groeneboom and Wellner, Journal of Computational and Graphical Statistics, 2001.

cdf(Chernoff(),-x)              # For tail probabilities, use this instead of 1-cdf(Chernoff(),x)

0 0.2 0.4 0.6 0.8 - 3 - 2 - 1 0 1 2 3 Chernoff() x density

Chi(ν)

The Chi distribution ν degrees of freedom has probability density function

It is the distribution of the square-root of a Chisq variate.

Chi(ν)       # Chi distribution with ν degrees of freedom

params(d)    # Get the parameters, i.e. (ν,)
dof(d)       # Get the degrees of freedom, i.e. ν

External links

0 0.2 0.4 0.6 0.8 0 0.5 1.0 1.5 2.0 2.5 3.0 Chi(1) x density

Chisq(ν)

The Chi squared distribution (typically written χ²) with ν degrees of freedom has the probability density function

If ν is an integer, then it is the distribution of the sum of squares of ν independent standard Normal variates.

Chisq(ν)     # Chi-squared distribution with ν degrees of freedom

params(d)    # Get the parameters, i.e. (ν,)
dof(d)       # Get the degrees of freedom, i.e. ν

External links

0 0.05 0.10 0.15 0.20 0.25 0 2 4 6 8 Chisq(3) x density

Cosine(μ, σ)

A raised Cosine distribution.

External link:

0 0.2 0.4 0.6 0.8 1.0 - 1.0 - 0.5 0 0.5 1.0 Cosine(0, 1) x density

Epanechnikov(μ, σ)

0 0.2 0.4 0.6 0.8 - 1.0 - 0.5 0 0.5 1.0 Epanechnikov(0, 1) x density

Erlang(α,θ)

The Erlang distribution is a special case of a Gamma distribution with integer shape parameter.

Erlang()       # Erlang distribution with unit shape and unit scale, i.e. Erlang(1, 1)
Erlang(a)      # Erlang distribution with shape parameter a and unit scale, i.e. Erlang(a, 1)
Erlang(a, s)   # Erlang distribution with shape parameter a and scale s

External links

0 0.1 0.2 0.3 0.4 0 2 4 6 8 Erlang(7, 0.5) x density

Exponential(θ)

The Exponential distribution with scale parameter θ has probability density function

Exponential()      # Exponential distribution with unit scale, i.e. Exponential(1)
Exponential(θ)     # Exponential distribution with scale θ

params(d)          # Get the parameters, i.e. (θ,)
scale(d)           # Get the scale parameter, i.e. θ
rate(d)            # Get the rate parameter, i.e. 1 / θ

External links

0 0.5 1.0 1.5 2.0 0 1 2 3 4 Exponential(0.5) x density

FDist(ν1, ν2)

The F distribution has probability density function

It is related to the Chisq distribution via the property that if and , then .

FDist(ν1, ν2)     # F-Distribution with parameters ν1 and ν2

params(d)         # Get the parameters, i.e. (ν1, ν2)

External links

0 0.1 0.2 0.3 0.4 0.5 0 2 4 6 8 10 FDist(10, 1) x density

Frechet(α,θ)

The Fréchet distribution with shape α and scale θ has probability density function

Frechet()        # Fréchet distribution with unit shape and unit scale, i.e. Frechet(1, 1)
Frechet(α)       # Fréchet distribution with shape α and unit scale, i.e. Frechet(α, 1)
Frechet(α, θ)    # Fréchet distribution with shape α and scale θ

params(d)        # Get the parameters, i.e. (α, θ)
shape(d)         # Get the shape parameter, i.e. α
scale(d)         # Get the scale parameter, i.e. θ

External links

0 0.1 0.2 0.3 0.4 0.5 0.6 0 5 10 15 20 Frechet(1, 1) x density

Gamma(α,θ)

The Gamma distribution with shape parameter α and scale θ has probability density function

Gamma()          # Gamma distribution with unit shape and unit scale, i.e. Gamma(1, 1)
Gamma(α)         # Gamma distribution with shape α and unit scale, i.e. Gamma(α, 1)
Gamma(α, θ)      # Gamma distribution with shape α and scale θ

params(d)        # Get the parameters, i.e. (α, θ)
shape(d)         # Get the shape parameter, i.e. α
scale(d)         # Get the scale parameter, i.e. θ

External links

0 0.05 0.10 0.15 0 5 10 15 Gamma(7.5, 1) x density

GeneralizedExtremeValue(μ, σ, ξ)

The Generalized extreme value distribution with shape parameter ξ, scale σ and location μ has probability density function

for

GeneralizedExtremeValue(μ, σ, ξ)      # Generalized Pareto distribution with shape ξ, scale σ and location μ.

params(d)       # Get the parameters, i.e. (μ, σ, ξ)
location(d)     # Get the location parameter, i.e. μ
scale(d)        # Get the scale parameter, i.e. σ
shape(d)        # Get the shape parameter, i.e. ξ (sometimes called c)

External links

0 0.1 0.2 0.3 0.4 0 5 10 15 20 25 30 GeneralizedExtremeValue(0, 1, 1) x density

GeneralizedPareto(μ, σ, ξ)

The Generalized Pareto distribution (GPD) with shape parameter ξ, scale σ and location μ has probability density function

GeneralizedPareto()             # GPD with unit shape and unit scale, i.e. GeneralizedPareto(0, 1, 1)
GeneralizedPareto(ξ)            # GPD with shape ξ and unit scale, i.e. GeneralizedPareto(0, 1, ξ)
GeneralizedPareto(σ, ξ)         # GPD with shape ξ and scale σ, i.e. GeneralizedPareto(0, σ, ξ)
GeneralizedPareto(μ, σ, ξ)      # GPD with shape ξ, scale σ and location μ.

params(d)       # Get the parameters, i.e. (μ, σ, ξ)
location(d)     # Get the location parameter, i.e. μ
scale(d)        # Get the scale parameter, i.e. σ
shape(d)        # Get the shape parameter, i.e. ξ

External links

0 0.2 0.4 0.6 0.8 1.0 0 5 10 15 20 GeneralizedPareto(0, 1, 1) x density

Gumbel(μ, θ)

The Gumbel (maxima) distribution with location μ and scale θ has probability density function

Gumbel()            # Gumbel distribution with zero location and unit scale, i.e. Gumbel(0, 1)
Gumbel(μ)           # Gumbel distribution with location μ and unit scale, i.e. Gumbel(μ, 1)
Gumbel(μ, θ)        # Gumbel distribution with location μ and scale θ

params(d)        # Get the parameters, i.e. (μ, θ)
location(d)      # Get the location parameter, i.e. μ
scale(d)         # Get the scale parameter, i.e. θ

External links

0 0.1 0.2 0.3 0.4 - 2 - 1 0 1 2 3 4 5 Gumbel(0, 1) x density

InverseGamma(α, θ)

The inverse Gamma distribution with shape parameter α and scale θ has probability density function

It is related to the Gamma distribution: if , then .

InverseGamma()        # Inverse Gamma distribution with unit shape and unit scale, i.e. InverseGamma(1, 1)
InverseGamma(α)       # Inverse Gamma distribution with shape α and unit scale, i.e. InverseGamma(α, 1)
InverseGamma(α, θ)    # Inverse Gamma distribution with shape α and scale θ

params(d)        # Get the parameters, i.e. (α, θ)
shape(d)         # Get the shape parameter, i.e. α
scale(d)         # Get the scale parameter, i.e. θ

External links

0 1 2 3 4 5 0 0.2 0.4 0.6 0.8 1.0 InverseGamma(3, 0.5) x density

InverseGaussian(μ,λ)

The inverse Gaussian distribution with mean μ and shape λ has probability density function

InverseGaussian()              # Inverse Gaussian distribution with unit mean and unit shape, i.e. InverseGaussian(1, 1)
InverseGaussian(μ),            # Inverse Gaussian distribution with mean μ and unit shape, i.e. InverseGaussian(μ, 1)
InverseGaussian(μ, λ)          # Inverse Gaussian distribution with mean μ and shape λ

params(d)           # Get the parameters, i.e. (μ, λ)
mean(d)             # Get the mean parameter, i.e. μ
shape(d)            # Get the shape parameter, i.e. λ

External links

0 0.2 0.4 0.6 0.8 1.0 0 1 2 3 4 5 InverseGaussian(1, 1) x density

JohnsonSU(ξ, λ, γ, δ)

The Johnson’s -distribution with parameters ξ, λ, γ and δ is a transformation of the normal distribution:

If

where , then .

JohnsonSU()           # Equivalent to JohnsonSU(0, 1, 0, 1)
JohnsonSU(ξ, λ, γ, δ) # JohnsonSU's S_U-distribution with parameters ξ, λ, γ and δ

params(d)           # Get the parameters, i.e. (ξ, λ, γ, δ)
shape(d)            # Get the shape parameter, i.e. ξ
scale(d)            # Get the scale parameter, i.e. λ

External links

0 0.1 0.2 0.3 0.4 - 20 - 10 0 10 20 JohnsonSU(0.0, 1.0, 0.0, 1.0) x density

Kolmogorov()

Kolmogorov distribution defined as

where is a Brownian bridge used in the Kolmogorov—​Smirnov test for large n.

0 0.5 1.0 1.5 0 0.5 1.0 1.5 2.0 Kolmogorov() x density

KSDist(n)

Distribution of the (two-sided) Kolmogorov-Smirnoff statistic

converges a.s. to the Kolmogorov distribution.

KSOneSided(n)

Distribution of the one-sided Kolmogorov-Smirnov test statistic:

Kumaraswamy(a, b)

The Kumaraswamy distribution with shape parameters a > 0 and b > 0 has probability density function

It is related to the link:@ref Beta[Beta distribution] by the following identity: if then . In particular, if then .

External links

References

  • Kumaraswamy, P. (1980). A generalized probability density function for double-bounded random processes. Journal of Hydrology. 46(1-2), 79-88.

0 0.5 1.0 1.5 2.0 0 0.2 0.4 0.6 0.8 1.0 Kumaraswamy(2, 5) x density

Laplace(μ,θ)

The Laplace distribution with location μ and scale θ has probability density function

Laplace()       # Laplace distribution with zero location and unit scale, i.e. Laplace(0, 1)
Laplace(μ)      # Laplace distribution with location μ and unit scale, i.e. Laplace(μ, 1)
Laplace(μ, θ)   # Laplace distribution with location μ and scale θ

params(d)       # Get the parameters, i.e., (μ, θ)
location(d)     # Get the location parameter, i.e. μ
scale(d)        # Get the scale parameter, i.e. θ

External links

0 0.02 0.04 0.06 0.08 0.10 0.12 - 20 - 10 0 10 20 Laplace(0, 4) x density

Levy(μ, σ)

The Lévy distribution with location μ and scale σ has probability density function

Levy()         # Levy distribution with zero location and unit scale, i.e. Levy(0, 1)
Levy(μ)        # Levy distribution with location μ and unit scale, i.e. Levy(μ, 1)
Levy(μ, σ)     # Levy distribution with location μ and scale σ

params(d)      # Get the parameters, i.e. (μ, σ)
location(d)    # Get the location parameter, i.e. μ

External links

0 0.1 0.2 0.3 0.4 0.5 0 5 10 15 20 Levy(0, 1) x density

Lindley(θ)

The one-parameter Lindley distribution with shape θ > 0 has probability density function

It was first described by Lindley[1] and was studied in greater detail by Ghitany et al.[2] Note that Lindley(θ) is a mixture of an Exponential(θ) and a Gamma(2, θ) with respective mixing weights p = θ/(1 + θ) and 1 - p.

0 0.2 0.4 0.6 0.8 0 5 10 15 20 Lindley(1.5) x density

Logistic(μ,θ)

The Logistic distribution with location μ and scale θ has probability density function

Logistic()       # Logistic distribution with zero location and unit scale, i.e. Logistic(0, 1)
Logistic(μ)      # Logistic distribution with location μ and unit scale, i.e. Logistic(μ, 1)
Logistic(μ, θ)   # Logistic distribution with location μ and scale θ

params(d)       # Get the parameters, i.e. (μ, θ)
location(d)     # Get the location parameter, i.e. μ
scale(d)        # Get the scale parameter, i.e. θ

External links

0 0.05 0.10 0.15 0.20 0.25 - 4 - 2 0 2 4 6 8 Logistic(2, 1) x density

LogitNormal(μ,σ)

The logit normal distribution is the distribution of of a random variable whose logit has a Normal distribution. Or inversely, when applying the logistic function to a Normal random variable then the resulting random variable follows a logit normal distribution.

If then .

The probability density function is

where the logit-Function is

LogitNormal()        # Logit-normal distribution with zero logit-mean and unit scale
LogitNormal(μ)       # Logit-normal distribution with logit-mean μ and unit scale
LogitNormal(μ, σ)    # Logit-normal distribution with logit-mean μ and scale σ

params(d)            # Get the parameters, i.e. (μ, σ)
median(d)            # Get the median, i.e. logistic(μ)

The following properties have no analytical solution but numerical approximations. In order to avoid package dependencies for numerical optimization, they are currently not implemented.

mean(d)
var(d)
std(d)
mode(d)

Similarly, skewness, kurtosis, and entropy are not implemented.

External links

0 0.5 1.0 1.5 0 0.2 0.4 0.6 0.8 1.0 LogitNormal(0, 1) x density

LogNormal(μ,σ)

The log normal distribution is the distribution of the exponential of a Normal variate: if then . The probability density function is

LogNormal()          # Log-normal distribution with zero log-mean and unit scale
LogNormal(μ)         # Log-normal distribution with log-mean mu and unit scale
LogNormal(μ, σ)      # Log-normal distribution with log-mean mu and scale sig

params(d)            # Get the parameters, i.e. (μ, σ)
meanlogx(d)          # Get the mean of log(X), i.e. μ
varlogx(d)           # Get the variance of log(X), i.e. σ^2
stdlogx(d)           # Get the standard deviation of log(X), i.e. σ

External links

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0 1 2 3 4 5 LogNormal(0, 1) x density

LogUniform(a,b)

A positive random variable X is log-uniformly with parameters a and b if the logarithm of X is Uniform(log(a), log(b)). The log uniform distribution is also known as reciprocal distribution.

LogUniform(1,10)

External links

0 0.1 0.2 0.3 0.4 0.5 0 2 4 6 8 10 LogUniform(1, 10) x density

NoncentralBeta(α, β, λ)

Noncentral Beta distribution with shape parameters α > 0 and β > 0 and noncentrality parameter λ >= 0.

0 0.5 1.0 1.5 0 0.2 0.4 0.6 0.8 1.0 NoncentralBeta(2, 3, 1) x density

NoncentralChisq(ν, λ)

The noncentral chi-squared distribution with ν degrees of freedom and noncentrality parameter λ has the probability density function

It is the distribution of the sum of squares of ν independent Normal variates with individual means and

NoncentralChisq(ν, λ)     # Noncentral chi-squared distribution with ν degrees of freedom and noncentrality parameter λ

params(d)    # Get the parameters, i.e. (ν, λ)

External links

0 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0 5 10 15 20 NoncentralChisq(2, 3) x density

NoncentralF(ν1, ν2, λ)

Noncentral F-distribution with ν1 > 0 and ν2 > 0 degrees of freedom and noncentrality parameter λ >= 0.

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0 2 4 6 8 10 NoncentralF(2, 3, 1) x density

NoncentralT(ν, λ)

Noncentral Student’s t-distribution with v > 0 degrees of freedom and noncentrality parameter λ.

0 0.05 0.10 0.15 0.20 0 5 10 15 20 NoncentralT(2, 3) x density

Normal(μ,σ)

The Normal distribution with mean μ and standard deviation σ≥0 has probability density function

Note that if σ == 0, then the distribution is a point mass concentrated at μ. Though not technically a continuous distribution, it is allowed so as to account for cases where σ may have underflowed, and the functions are defined by taking the pointwise limit as .

Normal()          # standard Normal distribution with zero mean and unit variance
Normal(μ)         # Normal distribution with mean μ and unit variance
Normal(μ, σ)      # Normal distribution with mean μ and variance σ^2

params(d)         # Get the parameters, i.e. (μ, σ)
mean(d)           # Get the mean, i.e. μ
std(d)            # Get the standard deviation, i.e. σ

External links

0 0.1 0.2 0.3 0.4 - 4 - 2 0 2 4 Normal(0, 1) x density

NormalCanon(η, λ)

Canonical parametrisation of the Normal distribution with canonical parameters η and λ.

The two canonical parameters of a normal distribution with mean and standard deviation are and .

0 0.1 0.2 0.3 0.4 - 4 - 2 0 2 4 NormalCanon(0, 1) x density

NormalInverseGaussian(μ,α,β,δ)

The Normal-inverse Gaussian distribution with location μ, tail heaviness α, asymmetry parameter β and scale δ has probability density function

where denotes a modified Bessel function of the third kind.

External links

0 1 2 3 4 - 2 - 1 0 1 2 NormalInverseGaussian(0, 0.5, 0.2, 0.1) x density

Pareto(α,θ)

The Pareto distribution with shape α and scale θ has probability density function

Pareto()            # Pareto distribution with unit shape and unit scale, i.e. Pareto(1, 1)
Pareto(α)           # Pareto distribution with shape α and unit scale, i.e. Pareto(α, 1)
Pareto(α, θ)        # Pareto distribution with shape α and scale θ

params(d)        # Get the parameters, i.e. (α, θ)
shape(d)         # Get the shape parameter, i.e. α
scale(d)         # Get the scale parameter, i.e. θ

External links

0 0.2 0.4 0.6 0.8 1.0 1 2 3 4 5 6 7 8 Pareto(1, 1) x density

PGeneralizedGaussian(μ, α, p)

The p-Generalized Gaussian distribution, more commonly known as the exponential power or the generalized normal distribution, with scale α, location μ, and shape p has the probability density function

The p-Generalized Gaussian (GGD) is a parametric distribution that incorporates the normal (p = 2) and Laplacian (p = 1) distributions as special cases. As p → ∞, the distribution approaches the Uniform distribution on [μ - α, μ + α].

PGeneralizedGaussian()           # GGD with location 0, scale √2, and shape 2 (the normal distribution)
PGeneralizedGaussian(μ, α, p)    # GGD with location μ, scale α, and shape p

params(d)                        # Get the parameters, i.e. (μ, α, p)
location(d)                      # Get the location parameter, μ
scale(d)                         # Get the scale parameter, α
shape(d)                         # Get the shape parameter, p

External Links


0 0.001 0.002 0.003 0.004 0.005 0 5 10 15 20 PGeneralizedGaussian(0.2) x density

Rayleigh(σ)

The Rayleigh distribution with scale σ has probability density function

It is related to the Normal distribution via the property that if , independently, then .

Rayleigh()       # Rayleigh distribution with unit scale, i.e. Rayleigh(1)
Rayleigh(σ)      # Rayleigh distribution with scale σ

params(d)        # Get the parameters, i.e. (σ,)
scale(d)         # Get the scale parameter, i.e. σ

External links

0 0.2 0.4 0.6 0.8 1.0 1.2 0 0.5 1.0 1.5 2.0 Rayleigh(0.5) x density

Rician(ν, σ)

The Rician distribution with parameters ν and σ has probability density function:

If shape and scale parameters K and Ω are given instead, ν and σ may be computed from them:

Rician()         # Rician distribution with parameters ν=0 and σ=1
Rician(ν, σ)     # Rician distribution with parameters ν and σ

params(d)        # Get the parameters, i.e. (ν, σ)
shape(d)         # Get the shape parameter K = ν²/2σ²
scale(d)         # Get the scale parameter Ω = ν² + 2σ²

External links:

0 0.1 0.2 0.3 0.4 0.5 0.6 0 1 2 3 4 5 Rician(0.5, 1) x density

Semicircle(r)

The Wigner semicircle distribution with radius parameter r has probability density function

Semicircle(r)   # Wigner semicircle distribution with radius r

params(d)       # Get the radius parameter, i.e. (r,)

External links

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 - 1.0 - 0.5 0 0.5 1.0 Semicircle(1) x density

SkewedExponentialPower(μ, σ, p, α)

The Skewed exponential power distribution, with location μ, scale σ, shape p, and skewness α, has the probability density function [1]

The Skewed exponential power distribution (SEPD) incorporates the Laplace ( ), normal ( ), uniform ( ), asymmetric Laplace ( ), skew normal ( ), and exponential power distribution ( ) as special cases.

[1] Zhy, D. and V. Zinde-Walsh (2009). Properties and estimation of asymmetric exponential power distribution. Journal of econometrics, 148(1):86-96, 2009.

SkewedExponentialPower()            # SEPD with shape 2, scale 1, location 0, and skewness 0.5 (the standard normal distribution)
SkewedExponentialPower(μ, σ, p, α)  # SEPD with location μ, scale σ, shape p, and skewness α
SkewedExponentialPower(μ, σ, p)     # SEPD with location μ, scale σ, shape p, and skewness 0.5 (the exponential power distribution)
SkewedExponentialPower(μ, σ)        # SEPD with location μ, scale σ, shape 2, and skewness 0.5 (the normal distribution)
SkewedExponentialPower(μ)           # SEPD with location μ, scale 1, shape 2, and skewness 0.5 (the normal distribution)

params(d)       # Get the parameters, i.e. (μ, σ, p, α)
shape(d)        # Get the shape parameter, i.e. p
location(d)     # Get the location parameter, i.e. μ
scale(d)        # Get the scale parameter, i.e. σ

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 - 8 - 6 - 4 - 2 0 2 4 SkewedExponentialPower(0, 1, 0.7, 0.7) x density

SkewNormal(ξ, ω, α)

The skew normal distribution is a continuous probability distribution that generalises the normal distribution to allow for non-zero skewness. Given a location ξ, scale ω, and shape α, it has the probability density function

External links

0 0.1 0.2 0.3 0.4 0.5 - 4 - 2 0 2 4 SkewNormal(0, 1, -1) x density

StudentizedRange(ν, k)

The studentized range distribution has probability density function:

where

StudentizedRange(ν, k)     # Studentized Range Distribution with parameters ν and k

params(d)        # Get the parameters, i.e. (ν, k)

External links

SymTriangularDist(μ, σ)

The Symmetric triangular distribution with location μ and scale σ has probability density function

SymTriangularDist()         # Symmetric triangular distribution with zero location and unit scale
SymTriangularDist(μ)        # Symmetric triangular distribution with location μ and unit scale
SymTriangularDist(μ, s)     # Symmetric triangular distribution with location μ and scale σ

params(d)       # Get the parameters, i.e. (μ, σ)
location(d)     # Get the location parameter, i.e. μ
scale(d)        # Get the scale parameter, i.e. σ

0 0.2 0.4 0.6 0.8 1.0 - 2 - 1 0 1 2 SymTriangularDist(0, 1) x density

TDist(ν)

The Students T distribution with ν degrees of freedom has probability density function

TDist(d)      # t-distribution with ν degrees of freedom

params(d)     # Get the parameters, i.e. (ν,)
dof(d)        # Get the degrees of freedom, i.e. ν

External links

0 0.1 0.2 0.3 0.4 - 4 - 2 0 2 4 TDist(5) x density

TriangularDist(a,b,c)

The triangular distribution with lower limit a, upper limit b and mode c has probability density function

TriangularDist(a, b)        # Triangular distribution with lower limit a, upper limit b, and mode (a+b)/2
TriangularDist(a, b, c)     # Triangular distribution with lower limit a, upper limit b, and mode c

params(d)       # Get the parameters, i.e. (a, b, c)
minimum(d)      # Get the lower bound, i.e. a
maximum(d)      # Get the upper bound, i.e. b
mode(d)         # Get the mode, i.e. c

External links

0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 - 0.5 0 0.5 1.0 1.5 2.0 TriangularDist(0, 1.5, 0.5) x density

Triweight(μ, σ)

0 0.2 0.4 0.6 0.8 1.0 0 0.5 1.0 1.5 2.0 Triweight(1, 1) x density

Uniform(a,b)

The continuous uniform distribution over an interval ] has probability density function

Uniform()        # Uniform distribution over [0, 1]
Uniform(a, b)    # Uniform distribution over [a, b]

params(d)        # Get the parameters, i.e. (a, b)
minimum(d)       # Get the lower bound, i.e. a
maximum(d)       # Get the upper bound, i.e. b
location(d)      # Get the location parameter, i.e. a
scale(d)         # Get the scale parameter, i.e. b - a

External links

0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 - 0.5 0 0.5 1.0 1.5 Uniform(0, 1) x density

VonMises(μ, κ)

The von Mises distribution with mean μ and concentration κ has probability density function

VonMises()       # von Mises distribution with zero mean and unit concentration
VonMises(κ)      # von Mises distribution with zero mean and concentration κ
VonMises(μ, κ)   # von Mises distribution with mean μ and concentration κ

External links

0.1 0.15 0.2 0.25 - π 0 π VonMises(0.5) x density

Weibull(α,θ)

The Weibull distribution with shape α and scale θ has probability density function

Weibull()        # Weibull distribution with unit shape and unit scale, i.e. Weibull(1, 1)
Weibull(α)       # Weibull distribution with shape α and unit scale, i.e. Weibull(α, 1)
Weibull(α, θ)    # Weibull distribution with shape α and scale θ

params(d)        # Get the parameters, i.e. (α, θ)
shape(d)         # Get the shape parameter, i.e. α
scale(d)         # Get the scale parameter, i.e. θ

External links

0 5 10 15 0 0.5 1.0 1.5 2.0 2.5 3.0 Weibull(0.5, 1) x density

Discrete Distributions

Bernoulli(p)

A Bernoulli distribution is parameterized by a success rate p, which takes value 1 with probability p and 0 with probability 1-p.

Bernoulli()    # Bernoulli distribution with p = 0.5
Bernoulli(p)   # Bernoulli distribution with success rate p

params(d)      # Get the parameters, i.e. (p,)
succprob(d)    # Get the success rate, i.e. p
failprob(d)    # Get the failure rate, i.e. 1 - p

External links:

BernoulliLogit(logitp=0.0)

A Bernoulli distribution that is parameterized by the logit logitp = logit(p) = log(p/(1-p)) of its success rate p.

External links:

See also Bernoulli

BetaBinomial(n,α,β)

A Beta-binomial distribution is the compound distribution of the Binomial distribution where the probability of success p is distributed according to the Beta. It has three parameters: n, the number of trials and two shape parameters α, β

BetaBinomial(n, α, β)      # BetaBinomial distribution with n trials and shape parameters α, β

params(d)       # Get the parameters, i.e. (n, α, β)
ntrials(d)      # Get the number of trials, i.e. n

External links:

Binomial(n,p)

A Binomial distribution characterizes the number of successes in a sequence of independent trials. It has two parameters: n, the number of trials, and p, the probability of success in an individual trial, with the distribution:

Binomial()      # Binomial distribution with n = 1 and p = 0.5
Binomial(n)     # Binomial distribution for n trials with success rate p = 0.5
Binomial(n, p)  # Binomial distribution for n trials with success rate p

params(d)       # Get the parameters, i.e. (n, p)
ntrials(d)      # Get the number of trials, i.e. n
succprob(d)     # Get the success rate, i.e. p
failprob(d)     # Get the failure rate, i.e. 1 - p

External links:

Categorical(p)

A Categorical distribution is parameterized by a probability vector p (of length K).

Categorical(p)   # Categorical distribution with probability vector p
params(d)        # Get the parameters, i.e. (p,)
probs(d)         # Get the probability vector, i.e. p
ncategories(d)   # Get the number of categories, i.e. K

Here, p must be a real vector, of which all components are nonnegative and sum to one.

The input vector p is directly used as a field of the constructed distribution, without being copied.

Categorical is simply a type alias describing a special case of a DiscreteNonParametric distribution, so non-specialized methods defined for DiscreteNonParametric apply to Categorical as well.

External links:

Dirac(x)

A Dirac distribution is parameterized by its only value x, and takes its value with probability 1.

Dirac(2.5)   # Dirac distribution with value x = 2.5

External links:

DiscreteUniform(a,b)

A Discrete uniform distribution is a uniform distribution over a consecutive sequence of integers between a and b, inclusive.

DiscreteUniform(a, b)   # a uniform distribution over {a, a+1, ..., b}

params(d)       # Get the parameters, i.e. (a, b)
span(d)         # Get the span of the support, i.e. (b - a + 1)
probval(d)      # Get the probability value, i.e. 1 / (b - a + 1)
minimum(d)      # Return a
maximum(d)      # Return b

External links

DiscreteNonParametric(xs, ps)

A Discrete nonparametric distribution explicitly defines an arbitrary probability mass function in terms of a list of real support values and their corresponding probabilities

d = DiscreteNonParametric(xs, ps)

params(d)  # Get the parameters, i.e. (xs, ps)
support(d) # Get a sorted AbstractVector describing the support (xs) of the distribution
probs(d)   # Get a Vector of the probabilities (ps) associated with the support

External links

Geometric(p)

A Geometric distribution characterizes the number of failures before the first success in a sequence of independent Bernoulli trials with success rate p.

Geometric()    # Geometric distribution with success rate 0.5
Geometric(p)   # Geometric distribution with success rate p

params(d)      # Get the parameters, i.e. (p,)
succprob(d)    # Get the success rate, i.e. p
failprob(d)    # Get the failure rate, i.e. 1 - p

External links

Hypergeometric(s, f, n)

A Hypergeometric distribution describes the number of successes in n draws without replacement from a finite population containing s successes and f failures.

Hypergeometric(s, f, n)  # Hypergeometric distribution for a population with
                         # s successes and f failures, and a sequence of n trials.

params(d)       # Get the parameters, i.e. (s, f, n)

External links

NegativeBinomial(r,p)

A Negative binomial distribution describes the number of failures before the rth success in a sequence of independent Bernoulli trials. It is parameterized by r, the number of successes, and p, the probability of success in an individual trial.

The distribution remains well-defined for any positive r, in which case

NegativeBinomial()        # Negative binomial distribution with r = 1 and p = 0.5
NegativeBinomial(r, p)    # Negative binomial distribution with r successes and success rate p

params(d)       # Get the parameters, i.e. (r, p)
succprob(d)     # Get the success rate, i.e. p
failprob(d)     # Get the failure rate, i.e. 1 - p

External links:

The definition of the negative binomial distribution in Wolfram is different from the Wikipedia definition. In Wikipedia, r is the number of failures and k is the number of successes.
Poisson(λ)

A Poisson distribution describes the number of independent events occurring within a unit time interval, given the average rate of occurrence λ.

Poisson()        # Poisson distribution with rate parameter 1
Poisson(lambda)       # Poisson distribution with rate parameter lambda

params(d)        # Get the parameters, i.e. (λ,)
mean(d)          # Get the mean arrival rate, i.e. λ

External links:

PoissonBinomial(p)

A Poisson-binomial distribution describes the number of successes in a sequence of independent trials, wherein each trial has a different success rate. It is parameterized by a vector p (of length ), where is the total number of trials and p[i] corresponds to the probability of success of the ith trial.

where is the set of all subsets of integers that can be selected from .

PoissonBinomial(p)   # Poisson Binomial distribution with success rate vector p

params(d)            # Get the parameters, i.e. (p,)
succprob(d)          # Get the vector of success rates, i.e. p
failprob(d)          # Get the vector of failure rates, i.e. 1-p

External links:

Skellam(μ1, μ2)

A Skellam distribution describes the difference between two independent Poisson variables, respectively with rate μ1 and μ2.

where is the modified Bessel function of the first kind.

Skellam(μ1, μ2)     # Skellam distribution for the difference between two Poisson variables,
                    # respectively with expected values μ1 and μ2.

params(d)           # Get the parameters, i.e. (μ1, μ2)

External links:

Soliton(K::Integer, M::Integer, δ::Real, atol::Real=0) <: Distribution{Univariate, Discrete}

The Robust Soliton distribution of length K, mode M (i.e., the location of the robust component spike), peeling process failure probability δ, and minimum non-zero probability mass atol. More specifically, degrees i for which pdf(Ω, i)<atol are set to 0. Letting atol=0 yields the regular robust Soliton distribution.

Soliton(K, M, δ)        # Robust Soliton distribution (with atol=0)
Soliton(K, M, δ, atol)  # Robust Soliton distribution with minimum non-zero probability mass atol

params(Ω)               # Get the parameters ,i.e., (K, M, δ, atol)
degrees(Ω)              # Return a vector composed of the degrees with non-zero probability mass
pdf(Ω, i)               # Evaluate the pdf at i
cdf(Ω, i)               # Evaluate the pdf at i
rand(Ω)                 # Sample from Ω
rand(Ω, n)              # Draw n samples from Ω

External links:

Vectorized evaluation

Vectorized computation and in-place vectorized computation have been deprecated.

Index


1. Lindley, D. V. (1958). Fiducial Distributions and Bayes' Theorem. Journal of the Royal Statistical Society: Series B (Methodological), 20(1), 102—​107.
2. Ghitany, M. E., Atieh, B., & Nadarajah, S. (2008). Lindley distribution and its application. Mathematics and Computers in Simulation, 78(4), 493—​506.