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.
|
#
StatsAPI.params
— Method
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 .
#
Distributions.scale
— Method
scale(d::UnivariateDistribution)
Get the scale parameter.
#
Distributions.location
— Method
location(d::UnivariateDistribution)
Get the location parameter.
#
Distributions.shape
— Method
shape(d::UnivariateDistribution)
Get the shape parameter.
#
Distributions.rate
— Method
rate(d::UnivariateDistribution)
Get the rate parameter.
#
Distributions.ncategories
— Method
ncategories(d::UnivariateDistribution)
Get the number of categories.
#
Distributions.ntrials
— Method
ntrials(d::UnivariateDistribution)
Get the number of trials.
#
StatsAPI.dof
— Method
dof(d::UnivariateDistribution)
Get the degrees of freedom.
For distributions for which success and failure have a meaning, the following methods are defined:
#
Distributions.succprob
— Method
succprob(d::DiscreteUnivariateDistribution)
Get the probability of success.
#
Distributions.failprob
— Method
failprob(d::DiscreteUnivariateDistribution)
Get the probability of failure.
Computation of statistics
#
Base.maximum
— Method
maximum(d::Distribution)
Return the maximum of the support of d
.
#
Base.minimum
— Method
minimum(d::Distribution)
Return the minimum of the support of d
.
#
Base.extrema
— Method
extrema(d::Distribution)
Return the minimum and maximum of the support of d
as a 2-tuple.
#
Statistics.mean
— Method
mean(d::UnivariateDistribution)
Compute the expectation.
#
Statistics.var
— Method
var(d::UnivariateDistribution)
Compute the variance. (A generic std is provided as std(d) = sqrt(var(d))
)
#
Statistics.std
— Method
std(d::UnivariateDistribution)
Return the standard deviation of distribution d
, i.e. sqrt(var(d))
.
#
Statistics.median
— Method
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.
#
StatsBase.modes
— Method
modes(d::UnivariateDistribution)
Get all modes (if this makes sense).
#
StatsBase.mode
— Method
mode(d::UnivariateDistribution)
Returns the first mode.
#
StatsBase.skewness
— Method
skewness(d::UnivariateDistribution)
Compute the skewness.
#
StatsBase.kurtosis
— Method
kurtosis(d::UnivariateDistribution)
Compute the excessive kurtosis.
#
StatsBase.kurtosis
— Method
kurtosis(d::Distribution, correction::Bool)
Computes excess kurtosis by default. Proper kurtosis can be returned with correction=false
#
Distributions.isplatykurtic
— Method
isplatykurtic(d)
Return whether d
is platykurtic (i.e kurtosis(d) < 0
).
#
Distributions.isleptokurtic
— Method
isleptokurtic(d)
Return whether d
is leptokurtic (i.e kurtosis(d) > 0
).
#
Distributions.ismesokurtic
— Method
ismesokurtic(d)
Return whether d
is mesokurtic (i.e kurtosis(d) == 0
).
#
StatsBase.entropy
— Method
entropy(d::UnivariateDistribution)
Compute the entropy value of distribution d
.
#
StatsBase.entropy
— Method
entropy(d::UnivariateDistribution, b::Real)
Compute the entropy value of distribution d
, w.r.t. a given base.
#
StatsBase.entropy
— Method
entropy(d::UnivariateDistribution, b::Real)
Compute the entropy value of distribution d
, w.r.t. a given base.
#
Distributions.mgf
— Method
mgf(d::UnivariateDistribution, t)
Evaluate the moment-generating function of distribution d
at t
.
See also cgf
#
Distributions.cgf
— Method
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
#
Distributions.cf
— Method
cf(d::UnivariateDistribution, t)
Evaluate the characteristic function of distribution d
.
#
Distributions.pdfsquaredL2norm
— Function
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
#
Distributions.insupport
— Method
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.
#
Distributions.pdf
— Method
pdf(d::UnivariateDistribution, x::Real)
Evaluate the probability density (mass) at x
.
See also: logpdf
.
#
Distributions.logpdf
— Method
logpdf(d::UnivariateDistribution, x::Real)
Evaluate the logarithm of probability density (mass) at x
.
See also: pdf
.
#
Distributions.cdf
— Method
cdf(d::UnivariateDistribution, x::Real)
Evaluate the cumulative probability at x
.
#
Distributions.logcdf
— Method
logcdf(d::UnivariateDistribution, x::Real)
The logarithm of the cumulative function value(s) evaluated at x
, i.e. log(cdf(x))
.
#
Distributions.logdiffcdf
— Method
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))
.
#
Distributions.ccdf
— Method
ccdf(d::UnivariateDistribution, x::Real)
The complementary cumulative function evaluated at x
, i.e. 1 - cdf(d, x)
.
#
Distributions.logccdf
— Method
logccdf(d::UnivariateDistribution, x::Real)
The logarithm of the complementary cumulative function values evaluated at x, i.e. log(ccdf(x))
.
#
Statistics.quantile
— Method
quantile(d::UnivariateDistribution, q::Real)
Evaluate the inverse cumulative distribution function at q
.
See also: cquantile
, invlogcdf
, and invlogccdf
.
#
Distributions.cquantile
— Method
cquantile(d::UnivariateDistribution, q::Real)
The complementary quantile value, i.e. quantile(d, 1-q)
.
#
Distributions.invlogcdf
— Method
invlogcdf(d::UnivariateDistribution, lp::Real)
The inverse function of logcdf.
#
Distributions.invlogccdf
— Method
invlogccdf(d::UnivariateDistribution, lp::Real)
The inverse function of logccdf.
Sampling (Random number generation)
#
Base.rand
— Method
rand(rng::AbstractRNG, d::UnivariateDistribution)
Generate a scalar sample from d
. The general fallback is quantile(d, rand())
.
#
Random.rand!
— Method
rand!(::AbstractRNG, ::Sampleable, ::AbstractArray)
Samples in-place from the sampler and stores the result in the provided array.
Continuous Distributions
#
Distributions.Arcsine
— Type
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.
#
Distributions.Beta
— Type
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
#
Distributions.BetaPrime
— Type
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
#
Distributions.Biweight
— Type
Biweight(μ, σ)
#
Distributions.Cauchy
— Type
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
#
Distributions.Chernoff
— Type
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)
#
Distributions.Chi
— Type
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
#
Distributions.Chisq
— Type
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
#
Distributions.Cosine
— Type
Cosine(μ, σ)
A raised Cosine distribution.
External link:
#
Distributions.Epanechnikov
— Type
Epanechnikov(μ, σ)
#
Distributions.Erlang
— Type
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
#
Distributions.Exponential
— Type
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
#
Distributions.FDist
— Type
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
#
Distributions.Frechet
— Type
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
#
Distributions.Gamma
— Type
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
#
Distributions.GeneralizedExtremeValue
— Type
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
#
Distributions.GeneralizedPareto
— Type
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
#
Distributions.Gumbel
— Type
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
#
Distributions.InverseGamma
— Type
InverseGamma(α, θ)
The inverse Gamma distribution with shape parameter α
and scale θ
has probability density function
It is related to the Gamma
distribution: if
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
#
Distributions.InverseGaussian
— Type
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
#
Distributions.JohnsonSU
— Type
JohnsonSU(ξ, λ, γ, δ)
The Johnson’s
If
where
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
#
Distributions.Kolmogorov
— Type
Kolmogorov()
Kolmogorov distribution defined as
where
#
Distributions.KSDist
— Type
KSDist(n)
Distribution of the (two-sided) Kolmogorov-Smirnoff statistic
#
Distributions.KSOneSided
— Type
KSOneSided(n)
Distribution of the one-sided Kolmogorov-Smirnov test statistic:
#
Distributions.Kumaraswamy
— Type
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
External links
References
-
Kumaraswamy, P. (1980). A generalized probability density function for double-bounded random processes. Journal of Hydrology. 46(1-2), 79-88.
#
Distributions.Laplace
— Type
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
#
Distributions.Levy
— Type
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
#
Distributions.Lindley
— Type
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
.
#
Distributions.Logistic
— Type
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
#
Distributions.LogitNormal
— Type
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
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
#
Distributions.LogNormal
— Type
LogNormal(μ,σ)
The log normal distribution is the distribution of the exponential of a Normal
variate: if
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
#
Distributions.LogUniform
— Type
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
#
Distributions.NoncentralBeta
— Type
NoncentralBeta(α, β, λ)
Noncentral Beta distribution with shape parameters α > 0
and β > 0
and noncentrality parameter λ >= 0
.
#
Distributions.NoncentralChisq
— Type
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
NoncentralChisq(ν, λ) # Noncentral chi-squared distribution with ν degrees of freedom and noncentrality parameter λ
params(d) # Get the parameters, i.e. (ν, λ)
External links
#
Distributions.NoncentralF
— Type
NoncentralF(ν1, ν2, λ)
Noncentral F-distribution with ν1 > 0
and ν2 > 0
degrees of freedom and noncentrality parameter λ >= 0
.
#
Distributions.NoncentralT
— Type
NoncentralT(ν, λ)
Noncentral Student’s t-distribution with v > 0
degrees of freedom and noncentrality parameter λ
.
#
Distributions.Normal
— Type
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
#
Distributions.NormalCanon
— Type
NormalCanon(η, λ)
Canonical parametrisation of the Normal distribution with canonical parameters η
and λ
.
The two canonical parameters of a normal distribution
#
Distributions.NormalInverseGaussian
— Type
NormalInverseGaussian(μ,α,β,δ)
The Normal-inverse Gaussian distribution with location μ
, tail heaviness α
, asymmetry parameter β
and scale δ
has probability density function
where
External links
#
Distributions.Pareto
— Type
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
#
Distributions.PGeneralizedGaussian
— Type
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
#
Distributions.Rayleigh
— Type
Rayleigh(σ)
The Rayleigh distribution with scale σ
has probability density function
It is related to the Normal
distribution via the property that if
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
#
Distributions.Rician
— Type
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:
#
Distributions.Semicircle
— Type
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
#
Distributions.SkewedExponentialPower
— Type
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 (
[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. σ
#
Distributions.SkewNormal
— Type
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
#
Distributions.StudentizedRange
— Type
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
#
Distributions.SymTriangularDist
— Type
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. σ
#
Distributions.TDist
— Type
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
#
Distributions.TriangularDist
— Type
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
#
Distributions.Triweight
— Type
Triweight(μ, σ)
#
Distributions.Uniform
— Type
Uniform(a,b)
The continuous uniform distribution over an interval
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
#
Distributions.VonMises
— Type
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
#
Distributions.Weibull
— Type
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
Discrete Distributions
#
Distributions.Bernoulli
— Type
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:
#
Distributions.BernoulliLogit
— Type
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
#
Distributions.BetaBinomial
— Type
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:
#
Distributions.Binomial
— Type
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:
#
Distributions.Categorical
— Type
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:
#
Distributions.Dirac
— Type
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:
#
Distributions.DiscreteUniform
— Type
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
#
Distributions.DiscreteNonParametric
— Type
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
#
Distributions.Geometric
— Type
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
#
Distributions.Hypergeometric
— Type
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
#
Distributions.NegativeBinomial
— Type
NegativeBinomial(r,p)
A Negative binomial distribution describes the number of failures before the r
th 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.
|
#
Distributions.Poisson
— Type
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:
#
Distributions.PoissonBinomial
— Type
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 p[i]
corresponds to the probability of success of the i
th trial.
where
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:
#
Distributions.Skellam
— Type
Skellam(μ1, μ2)
A Skellam distribution describes the difference between two independent Poisson
variables, respectively with rate μ1
and μ2
.
where
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:
#
Distributions.Soliton
— Type
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: