stats._continuous_distns

Module Contents

Classes

ksone_gen() General Kolmogorov-Smirnov one-sided test.
kstwobign_gen() Kolmogorov-Smirnov two-sided test for large N.
norm_gen() rA normal continuous random variable.
alpha_gen() rAn alpha continuous random variable.
anglit_gen() rAn anglit continuous random variable.
arcsine_gen() rAn arcsine continuous random variable.
FitDataError(self,distr,lower,upper)
FitSolverError(self,mesg)
beta_gen() rA beta continuous random variable.
betaprime_gen() rA beta prime continuous random variable.
bradford_gen() rA Bradford continuous random variable.
burr_gen() rA Burr (Type III) continuous random variable.
burr12_gen() rA Burr (Type XII) continuous random variable.
fisk_gen() rA Fisk continuous random variable.
cauchy_gen() rA Cauchy continuous random variable.
chi_gen() rA chi continuous random variable.
chi2_gen() rA chi-squared continuous random variable.
cosine_gen() rA cosine continuous random variable.
dgamma_gen() rA double gamma continuous random variable.
dweibull_gen() rA double Weibull continuous random variable.
expon_gen() rAn exponential continuous random variable.
exponnorm_gen() rAn exponentially modified Normal continuous random variable.
exponweib_gen() rAn exponentiated Weibull continuous random variable.
exponpow_gen() rAn exponential power continuous random variable.
fatiguelife_gen() rA fatigue-life (Birnbaum-Saunders) continuous random variable.
foldcauchy_gen() rA folded Cauchy continuous random variable.
f_gen() rAn F continuous random variable.
foldnorm_gen() rA folded normal continuous random variable.
weibull_min_gen() rWeibull minimum continuous random variable.
weibull_max_gen() rWeibull maximum continuous random variable.
frechet_r_gen()
frechet_l_gen()
genlogistic_gen() rA generalized logistic continuous random variable.
genpareto_gen() rA generalized Pareto continuous random variable.
genexpon_gen() rA generalized exponential continuous random variable.
genextreme_gen() rA generalized extreme value continuous random variable.
gamma_gen() rA gamma continuous random variable.
erlang_gen() An Erlang continuous random variable.
gengamma_gen() rA generalized gamma continuous random variable.
genhalflogistic_gen() rA generalized half-logistic continuous random variable.
gompertz_gen() rA Gompertz (or truncated Gumbel) continuous random variable.
gumbel_r_gen() rA right-skewed Gumbel continuous random variable.
gumbel_l_gen() rA left-skewed Gumbel continuous random variable.
halfcauchy_gen() rA Half-Cauchy continuous random variable.
halflogistic_gen() rA half-logistic continuous random variable.
halfnorm_gen() rA half-normal continuous random variable.
hypsecant_gen() rA hyperbolic secant continuous random variable.
gausshyper_gen() rA Gauss hypergeometric continuous random variable.
invgamma_gen() rAn inverted gamma continuous random variable.
invgauss_gen() rAn inverse Gaussian continuous random variable.
invweibull_gen() rAn inverted Weibull continuous random variable.
johnsonsb_gen() rA Johnson SB continuous random variable.
johnsonsu_gen() rA Johnson SU continuous random variable.
laplace_gen() rA Laplace continuous random variable.
levy_gen() rA Levy continuous random variable.
levy_l_gen() rA left-skewed Levy continuous random variable.
levy_stable_gen() rA Levy-stable continuous random variable.
logistic_gen() rA logistic (or Sech-squared) continuous random variable.
loggamma_gen() rA log gamma continuous random variable.
loglaplace_gen() rA log-Laplace continuous random variable.
lognorm_gen() rA lognormal continuous random variable.
gilbrat_gen() rA Gilbrat continuous random variable.
maxwell_gen() rA Maxwell continuous random variable.
mielke_gen() rA Mielke’s Beta-Kappa continuous random variable.
kappa4_gen() rKappa 4 parameter distribution.
kappa3_gen() rKappa 3 parameter distribution.
nakagami_gen() rA Nakagami continuous random variable.
ncx2_gen() rA non-central chi-squared continuous random variable.
ncf_gen() rA non-central F distribution continuous random variable.
t_gen() rA Student’s T continuous random variable.
nct_gen() rA non-central Student’s T continuous random variable.
pareto_gen() rA Pareto continuous random variable.
lomax_gen() rA Lomax (Pareto of the second kind) continuous random variable.
pearson3_gen() rA pearson type III continuous random variable.
powerlaw_gen() rA power-function continuous random variable.
powerlognorm_gen() rA power log-normal continuous random variable.
powernorm_gen() rA power normal continuous random variable.
rdist_gen() rAn R-distributed continuous random variable.
rayleigh_gen() rA Rayleigh continuous random variable.
reciprocal_gen() rA reciprocal continuous random variable.
rice_gen() rA Rice continuous random variable.
recipinvgauss_gen() rA reciprocal inverse Gaussian continuous random variable.
semicircular_gen() rA semicircular continuous random variable.
skew_norm_gen() rA skew-normal random variable.
trapz_gen() rA trapezoidal continuous random variable.
triang_gen() rA triangular continuous random variable.
truncexpon_gen() rA truncated exponential continuous random variable.
truncnorm_gen() rA truncated normal continuous random variable.
tukeylambda_gen() rA Tukey-Lamdba continuous random variable.
uniform_gen() rA uniform continuous random variable.
vonmises_gen() rA Von Mises continuous random variable.
wald_gen() rA Wald continuous random variable.
wrapcauchy_gen() rA wrapped Cauchy continuous random variable.
gennorm_gen() rA generalized normal continuous random variable.
halfgennorm_gen() rThe upper half of a generalized normal continuous random variable.
crystalball_gen() r
argus_gen() r
rv_histogram(self,histogram,*args,**kwargs) Generates a distribution given by a histogram.

Functions

_norm_pdf(x)
_norm_logpdf(x)
_norm_cdf(x)
_norm_logcdf(x)
_norm_ppf(q)
_norm_sf(x)
_norm_logsf(x)
_norm_isf(q)
_beta_mle_a(a,b,n,s1)
_beta_mle_ab(theta,n,s1,s2)
_digammainv(y)
_lognorm_logpdf(x,s)
_argus_phi(chi) Utility function for the argus distribution
class ksone_gen

General Kolmogorov-Smirnov one-sided test.

%(default)s

_cdf(x, n)
_ppf(q, n)
class kstwobign_gen

Kolmogorov-Smirnov two-sided test for large N.

%(default)s

_cdf(x)
_sf(x)
_ppf(q)
_norm_pdf(x)
_norm_logpdf(x)
_norm_cdf(x)
_norm_logcdf(x)
_norm_ppf(q)
_norm_sf(x)
_norm_logsf(x)
_norm_isf(q)
class norm_gen

rA normal continuous random variable.

The location (loc) keyword specifies the mean. The scale (scale) keyword specifies the standard deviation.

%(before_notes)s

The probability density function for norm is:

The survival function, norm.sf, is also referred to as the Q-function in some contexts (see, e.g., Wikipedia’s definition).

%(after_notes)s

%(example)s

_rvs()
_pdf(x)
_logpdf(x)
_cdf(x)
_logcdf(x)
_sf(x)
_logsf(x)
_ppf(q)
_isf(q)
_stats()
_entropy()
fit(data, **kwds)

%(super)s This function (norm_gen.fit) uses explicit formulas for the maximum likelihood estimation of the parameters, so the optimizer argument is ignored.

class alpha_gen

rAn alpha continuous random variable.

%(before_notes)s

The probability density function for alpha is:

where Phi(alpha) is the normal CDF, x > 0, and a > 0.

alpha takes a as a shape parameter.

%(after_notes)s

%(example)s

_pdf(x, a)
_logpdf(x, a)
_cdf(x, a)
_ppf(q, a)
_stats(a)
class anglit_gen

rAn anglit continuous random variable.

%(before_notes)s

The probability density function for anglit is:

for .

%(after_notes)s

%(example)s

_pdf(x)
_cdf(x)
_ppf(q)
_stats()
_entropy()
class arcsine_gen

rAn arcsine continuous random variable.

%(before_notes)s

The probability density function for arcsine is:

for .

%(after_notes)s

%(example)s

_pdf(x)
_cdf(x)
_ppf(q)
_stats()
_entropy()
class FitDataError(distr, lower, upper)
__init__(distr, lower, upper)
class FitSolverError(mesg)
__init__(mesg)
_beta_mle_a(a, b, n, s1)
_beta_mle_ab(theta, n, s1, s2)
class beta_gen

rA beta continuous random variable.

%(before_notes)s

The probability density function for beta is:

for , , , where is the gamma function (scipy.special.gamma).

beta takes and as shape parameters.

%(after_notes)s

%(example)s

_rvs(a, b)
_pdf(x, a, b)
_logpdf(x, a, b)
_cdf(x, a, b)
_ppf(q, a, b)
_stats(a, b)
_fitstart(data)
fit(data, *args, **kwds)

%(super)s In the special case where both floc and fscale are given, a ValueError is raised if any value x in data does not satisfy floc < x < floc + fscale.

class betaprime_gen

rA beta prime continuous random variable.

%(before_notes)s

The probability density function for betaprime is:

for x > 0, a > 0, b > 0, where beta(a, b) is the beta function (see scipy.special.beta).

betaprime takes a and b as shape parameters.

%(after_notes)s

%(example)s

_rvs(a, b)
_pdf(x, a, b)
_logpdf(x, a, b)
_cdf(x, a, b)
_munp(n, a, b)
class bradford_gen

rA Bradford continuous random variable.

%(before_notes)s

The probability density function for bradford is:

for , and .

bradford takes as a shape parameter.

%(after_notes)s

%(example)s

_pdf(x, c)
_cdf(x, c)
_ppf(q, c)
_stats(c, moments="mv")
_entropy(c)
class burr_gen

rA Burr (Type III) continuous random variable.

%(before_notes)s

fisk : a special case of either burr or burr12 with d = 1 burr12 : Burr Type XII distribution

The probability density function for burr is:

for .

burr takes and as shape parameters.

This is the PDF corresponding to the third CDF given in Burr’s list; specifically, it is equation (11) in Burr’s paper [1]_.

%(after_notes)s

[1]Burr, I. W. “Cumulative frequency functions”, Annals of Mathematical Statistics, 13(2), pp 215-232 (1942).

%(example)s

_pdf(x, c, d)
_cdf(x, c, d)
_ppf(q, c, d)
_munp(n, c, d)
class burr12_gen

rA Burr (Type XII) continuous random variable.

%(before_notes)s

fisk : a special case of either burr or burr12 with d = 1 burr : Burr Type III distribution

The probability density function for burr is:

for .

burr12 takes and as shape parameters.

This is the PDF corresponding to the twelfth CDF given in Burr’s list; specifically, it is equation (20) in Burr’s paper [1]_.

%(after_notes)s

The Burr type 12 distribution is also sometimes referred to as the Singh-Maddala distribution from NIST [2].

[1]Burr, I. W. “Cumulative frequency functions”, Annals of Mathematical Statistics, 13(2), pp 215-232 (1942).
[2]http://www.itl.nist.gov/div898/software/dataplot/refman2/auxillar/b12pdf.htm

%(example)s

_pdf(x, c, d)
_logpdf(x, c, d)
_cdf(x, c, d)
_logcdf(x, c, d)
_sf(x, c, d)
_logsf(x, c, d)
_ppf(q, c, d)
_munp(n, c, d)
class fisk_gen

rA Fisk continuous random variable.

The Fisk distribution is also known as the log-logistic distribution, and equals the Burr distribution with d == 1.

fisk takes as a shape parameter.

%(before_notes)s

The probability density function for fisk is:

for .

fisk takes as a shape parameters.

%(after_notes)s

burr

%(example)s

_pdf(x, c)
_cdf(x, c)
_ppf(x, c)
_munp(n, c)
_entropy(c)
class cauchy_gen

rA Cauchy continuous random variable.

%(before_notes)s

The probability density function for cauchy is:

%(after_notes)s

%(example)s

_pdf(x)
_cdf(x)
_ppf(q)
_sf(x)
_isf(q)
_stats()
_entropy()
_fitstart(data, args=None)
class chi_gen

rA chi continuous random variable.

%(before_notes)s

The probability density function for chi is:

for .

Special cases of chi are:

  • chi(1, loc, scale) is equivalent to halfnorm
  • chi(2, 0, scale) is equivalent to rayleigh
  • chi(3, 0, scale) is equivalent to maxwell

chi takes df as a shape parameter.

%(after_notes)s

%(example)s

_rvs(df)
_pdf(x, df)
_logpdf(x, df)
_cdf(x, df)
_ppf(q, df)
_stats(df)
class chi2_gen

rA chi-squared continuous random variable.

%(before_notes)s

The probability density function for chi2 is:

chi2 takes df as a shape parameter.

%(after_notes)s

%(example)s

_rvs(df)
_pdf(x, df)
_logpdf(x, df)
_cdf(x, df)
_sf(x, df)
_isf(p, df)
_ppf(p, df)
_stats(df)
class cosine_gen

rA cosine continuous random variable.

%(before_notes)s

The cosine distribution is an approximation to the normal distribution. The probability density function for cosine is:

for .

%(after_notes)s

%(example)s

_pdf(x)
_cdf(x)
_stats()
_entropy()
class dgamma_gen

rA double gamma continuous random variable.

%(before_notes)s

The probability density function for dgamma is:

for .

dgamma takes as a shape parameter.

%(after_notes)s

%(example)s

_rvs(a)
_pdf(x, a)
_logpdf(x, a)
_cdf(x, a)
_sf(x, a)
_ppf(q, a)
_stats(a)
class dweibull_gen

rA double Weibull continuous random variable.

%(before_notes)s

The probability density function for dweibull is:

dweibull takes as a shape parameter.

%(after_notes)s

%(example)s

_rvs(c)
_pdf(x, c)
_logpdf(x, c)
_cdf(x, c)
_ppf(q, c)
_munp(n, c)
_stats(c)
class expon_gen

rAn exponential continuous random variable.

%(before_notes)s

The probability density function for expon is:

for .

%(after_notes)s

A common parameterization for expon is in terms of the rate parameter lambda, such that pdf = lambda * exp(-lambda * x). This parameterization corresponds to using scale = 1 / lambda.

%(example)s

_rvs()
_pdf(x)
_logpdf(x)
_cdf(x)
_ppf(q)
_sf(x)
_logsf(x)
_isf(q)
_stats()
_entropy()
class exponnorm_gen

rAn exponentially modified Normal continuous random variable.

%(before_notes)s

The probability density function for exponnorm is:

where the shape parameter .

It can be thought of as the sum of a normally distributed random value with mean loc and sigma scale and an exponentially distributed random number with a pdf proportional to exp(-lambda * x) where lambda = (K * scale)**(-1).

%(after_notes)s

An alternative parameterization of this distribution (for example, in Wikipedia) involves three parameters, , and . In the present parameterization this corresponds to having loc and scale equal to and , respectively, and shape parameter .

New in version 0.16.0.

%(example)s

_rvs(K)
_pdf(x, K)
_logpdf(x, K)
_cdf(x, K)
_sf(x, K)
_stats(K)
class exponweib_gen

rAn exponentiated Weibull continuous random variable.

%(before_notes)s

The probability density function for exponweib is:

for , , .

exponweib takes and as shape parameters.

%(after_notes)s

%(example)s

_pdf(x, a, c)
_logpdf(x, a, c)
_cdf(x, a, c)
_ppf(q, a, c)
class exponpow_gen

rAn exponential power continuous random variable.

%(before_notes)s

The probability density function for exponpow is:

for , . Note that this is a different distribution from the exponential power distribution that is also known under the names “generalized normal” or “generalized Gaussian”.

exponpow takes as a shape parameter.

%(after_notes)s

http://www.math.wm.edu/~leemis/chart/UDR/PDFs/Exponentialpower.pdf

%(example)s

_pdf(x, b)
_logpdf(x, b)
_cdf(x, b)
_sf(x, b)
_isf(x, b)
_ppf(q, b)
class fatiguelife_gen

rA fatigue-life (Birnbaum-Saunders) continuous random variable.

%(before_notes)s

The probability density function for fatiguelife is:

for .

fatiguelife takes as a shape parameter.

%(after_notes)s

[1]“Birnbaum-Saunders distribution”, http://en.wikipedia.org/wiki/Birnbaum-Saunders_distribution

%(example)s

_rvs(c)
_pdf(x, c)
_logpdf(x, c)
_cdf(x, c)
_ppf(q, c)
_stats(c)
class foldcauchy_gen

rA folded Cauchy continuous random variable.

%(before_notes)s

The probability density function for foldcauchy is:

for .

foldcauchy takes as a shape parameter.

%(example)s

_rvs(c)
_pdf(x, c)
_cdf(x, c)
_stats(c)
class f_gen

rAn F continuous random variable.

%(before_notes)s

The probability density function for f is:

for .

f takes dfn and dfd as shape parameters.

%(after_notes)s

%(example)s

_rvs(dfn, dfd)
_pdf(x, dfn, dfd)
_logpdf(x, dfn, dfd)
_cdf(x, dfn, dfd)
_sf(x, dfn, dfd)
_ppf(q, dfn, dfd)
_stats(dfn, dfd)
class foldnorm_gen

rA folded normal continuous random variable.

%(before_notes)s

The probability density function for foldnorm is:

for .

foldnorm takes as a shape parameter.

%(after_notes)s

%(example)s

_argcheck(c)
_rvs(c)
_pdf(x, c)
_cdf(x, c)
_stats(c)
class weibull_min_gen

rWeibull minimum continuous random variable.

%(before_notes)s

weibull_max

The probability density function for weibull_min is:

for , .

weibull_min takes c as a shape parameter.

%(after_notes)s

%(example)s

_pdf(x, c)
_logpdf(x, c)
_cdf(x, c)
_sf(x, c)
_logsf(x, c)
_ppf(q, c)
_munp(n, c)
_entropy(c)
class weibull_max_gen

rWeibull maximum continuous random variable.

%(before_notes)s

weibull_min

The probability density function for weibull_max is:

for , .

weibull_max takes c as a shape parameter.

%(after_notes)s

%(example)s

_pdf(x, c)
_logpdf(x, c)
_cdf(x, c)
_logcdf(x, c)
_sf(x, c)
_ppf(q, c)
_munp(n, c)
_entropy(c)
class frechet_r_gen
__call__(*args, **kwargs)
cdf(*args, **kwargs)
entropy(*args, **kwargs)
expect(*args, **kwargs)
fit(*args, **kwargs)
fit_loc_scale(*args, **kwargs)
freeze(*args, **kwargs)
interval(*args, **kwargs)
isf(*args, **kwargs)
logcdf(*args, **kwargs)
logpdf(*args, **kwargs)
logsf(*args, **kwargs)
mean(*args, **kwargs)
median(*args, **kwargs)
moment(*args, **kwargs)
nnlf(*args, **kwargs)
pdf(*args, **kwargs)
ppf(*args, **kwargs)
rvs(*args, **kwargs)
sf(*args, **kwargs)
stats(*args, **kwargs)
std(*args, **kwargs)
var(*args, **kwargs)
class frechet_l_gen
__call__(*args, **kwargs)
cdf(*args, **kwargs)
entropy(*args, **kwargs)
expect(*args, **kwargs)
fit(*args, **kwargs)
fit_loc_scale(*args, **kwargs)
freeze(*args, **kwargs)
interval(*args, **kwargs)
isf(*args, **kwargs)
logcdf(*args, **kwargs)
logpdf(*args, **kwargs)
logsf(*args, **kwargs)
mean(*args, **kwargs)
median(*args, **kwargs)
moment(*args, **kwargs)
nnlf(*args, **kwargs)
pdf(*args, **kwargs)
ppf(*args, **kwargs)
rvs(*args, **kwargs)
sf(*args, **kwargs)
stats(*args, **kwargs)
std(*args, **kwargs)
var(*args, **kwargs)
class genlogistic_gen

rA generalized logistic continuous random variable.

%(before_notes)s

The probability density function for genlogistic is:

for , .

genlogistic takes as a shape parameter.

%(after_notes)s

%(example)s

_pdf(x, c)
_logpdf(x, c)
_cdf(x, c)
_ppf(q, c)
_stats(c)
class genpareto_gen

rA generalized Pareto continuous random variable.

%(before_notes)s

The probability density function for genpareto is:

defined for if , and for if .

genpareto takes as a shape parameter.

For c == 0, genpareto reduces to the exponential distribution, expon:

For c == -1, genpareto is uniform on [0, 1]:

%(after_notes)s

%(example)s

_argcheck(c)
_pdf(x, c)
_logpdf(x, c)
_cdf(x, c)
_sf(x, c)
_logsf(x, c)
_ppf(q, c)
_isf(q, c)
_munp(n, c)
_entropy(c)
class genexpon_gen

rA generalized exponential continuous random variable.

%(before_notes)s

The probability density function for genexpon is:

for , .

genexpon takes , and as shape parameters.

%(after_notes)s

H.K. Ryu, “An Extension of Marshall and Olkin’s Bivariate Exponential Distribution”, Journal of the American Statistical Association, 1993.

N. Balakrishnan, “The Exponential Distribution: Theory, Methods and Applications”, Asit P. Basu.

%(example)s

_pdf(x, a, b, c)
_cdf(x, a, b, c)
_logpdf(x, a, b, c)
class genextreme_gen

rA generalized extreme value continuous random variable.

%(before_notes)s

gumbel_r

For , genextreme is equal to gumbel_r. The probability density function for genextreme is:

Note that several sources and software packages use the opposite convention for the sign of the shape parameter .

genextreme takes as a shape parameter.

%(after_notes)s

%(example)s

_argcheck(c)
_loglogcdf(x, c)
_pdf(x, c)
_logpdf(x, c)
_logcdf(x, c)
_cdf(x, c)
_sf(x, c)
_ppf(q, c)
_isf(q, c)
_stats(c)
_fitstart(data)
_munp(n, c)
_entropy(c)
_digammainv(y)
class gamma_gen

rA gamma continuous random variable.

%(before_notes)s

erlang, expon

The probability density function for gamma is:

for , . Here refers to the gamma function.

gamma has a shape parameter a which needs to be set explicitly.

When is an integer, reduces to the Erlang distribution, and when to the exponential distribution.

%(after_notes)s

%(example)s

_rvs(a)
_pdf(x, a)
_logpdf(x, a)
_cdf(x, a)
_sf(x, a)
_ppf(q, a)
_stats(a)
_entropy(a)
_fitstart(data)
fit(data, *args, **kwds)
class erlang_gen

An Erlang continuous random variable.

%(before_notes)s

gamma

The Erlang distribution is a special case of the Gamma distribution, with the shape parameter a an integer. Note that this restriction is not enforced by erlang. It will, however, generate a warning the first time a non-integer value is used for the shape parameter.

Refer to gamma for examples.

_argcheck(a)
_fitstart(data)
fit(data, *args, **kwds)
class gengamma_gen

rA generalized gamma continuous random variable.

%(before_notes)s

The probability density function for gengamma is:

for , , and .

gengamma takes and as shape parameters.

%(after_notes)s

%(example)s

_argcheck(a, c)
_pdf(x, a, c)
_logpdf(x, a, c)
_cdf(x, a, c)
_sf(x, a, c)
_ppf(q, a, c)
_isf(q, a, c)
_munp(n, a, c)
_entropy(a, c)
class genhalflogistic_gen

rA generalized half-logistic continuous random variable.

%(before_notes)s

The probability density function for genhalflogistic is:

for , and .

genhalflogistic takes as a shape parameter.

%(after_notes)s

%(example)s

_argcheck(c)
_pdf(x, c)
_cdf(x, c)
_ppf(q, c)
_entropy(c)
class gompertz_gen

rA Gompertz (or truncated Gumbel) continuous random variable.

%(before_notes)s

The probability density function for gompertz is:

for , .

gompertz takes as a shape parameter.

%(after_notes)s

%(example)s

_pdf(x, c)
_logpdf(x, c)
_cdf(x, c)
_ppf(q, c)
_entropy(c)
class gumbel_r_gen

rA right-skewed Gumbel continuous random variable.

%(before_notes)s

gumbel_l, gompertz, genextreme

The probability density function for gumbel_r is:

The Gumbel distribution is sometimes referred to as a type I Fisher-Tippett distribution. It is also related to the extreme value distribution, log-Weibull and Gompertz distributions.

%(after_notes)s

%(example)s

_pdf(x)
_logpdf(x)
_cdf(x)
_logcdf(x)
_ppf(q)
_stats()
_entropy()
class gumbel_l_gen

rA left-skewed Gumbel continuous random variable.

%(before_notes)s

gumbel_r, gompertz, genextreme

The probability density function for gumbel_l is:

The Gumbel distribution is sometimes referred to as a type I Fisher-Tippett distribution. It is also related to the extreme value distribution, log-Weibull and Gompertz distributions.

%(after_notes)s

%(example)s

_pdf(x)
_logpdf(x)
_cdf(x)
_ppf(q)
_logsf(x)
_sf(x)
_isf(x)
_stats()
_entropy()
class halfcauchy_gen

rA Half-Cauchy continuous random variable.

%(before_notes)s

The probability density function for halfcauchy is:

for .

%(after_notes)s

%(example)s

_pdf(x)
_logpdf(x)
_cdf(x)
_ppf(q)
_stats()
_entropy()
class halflogistic_gen

rA half-logistic continuous random variable.

%(before_notes)s

The probability density function for halflogistic is:

for .

%(after_notes)s

%(example)s

_pdf(x)
_logpdf(x)
_cdf(x)
_ppf(q)
_munp(n)
_entropy()
class halfnorm_gen

rA half-normal continuous random variable.

%(before_notes)s

The probability density function for halfnorm is:

for .

halfnorm is a special case of :math`chi` with df == 1.

%(after_notes)s

%(example)s

_rvs()
_pdf(x)
_logpdf(x)
_cdf(x)
_ppf(q)
_stats()
_entropy()
class hypsecant_gen

rA hyperbolic secant continuous random variable.

%(before_notes)s

The probability density function for hypsecant is:

%(after_notes)s

%(example)s

_pdf(x)
_cdf(x)
_ppf(q)
_stats()
_entropy()
class gausshyper_gen

rA Gauss hypergeometric continuous random variable.

%(before_notes)s

The probability density function for gausshyper is:

for , , , and

gausshyper takes , , and as shape parameters.

%(after_notes)s

%(example)s

_argcheck(a, b, c, z)
_pdf(x, a, b, c, z)
_munp(n, a, b, c, z)
class invgamma_gen

rAn inverted gamma continuous random variable.

%(before_notes)s

The probability density function for invgamma is:

for , .

invgamma takes as a shape parameter.

invgamma is a special case of gengamma with c == -1.

%(after_notes)s

%(example)s

_pdf(x, a)
_logpdf(x, a)
_cdf(x, a)
_ppf(q, a)
_sf(x, a)
_isf(q, a)
_stats(a, moments="mvsk")
_entropy(a)
class invgauss_gen

rAn inverse Gaussian continuous random variable.

%(before_notes)s

The probability density function for invgauss is:

for .

invgauss takes as a shape parameter.

%(after_notes)s

When is too small, evaluating the cumulative distribution function will be inaccurate due to cdf(mu -> 0) = inf * 0. NaNs are returned for .

%(example)s

_rvs(mu)
_pdf(x, mu)
_logpdf(x, mu)
_cdf(x, mu)
_stats(mu)
class invweibull_gen

rAn inverted Weibull continuous random variable.

%(before_notes)s

The probability density function for invweibull is:

for , .

invweibull takes as a shape parameter.

%(after_notes)s

F.R.S. de Gusmao, E.M.M Ortega and G.M. Cordeiro, “The generalized inverse Weibull distribution”, Stat. Papers, vol. 52, pp. 591-619, 2011.

%(example)s

_pdf(x, c)
_cdf(x, c)
_ppf(q, c)
_munp(n, c)
_entropy(c)
class johnsonsb_gen

rA Johnson SB continuous random variable.

%(before_notes)s

johnsonsu

The probability density function for johnsonsb is:

for and , and is the normal pdf.

johnsonsb takes and as shape parameters.

%(after_notes)s

%(example)s

_argcheck(a, b)
_pdf(x, a, b)
_cdf(x, a, b)
_ppf(q, a, b)
class johnsonsu_gen

rA Johnson SU continuous random variable.

%(before_notes)s

johnsonsb

The probability density function for johnsonsu is:

for all , and is the normal pdf.

johnsonsu takes and as shape parameters.

%(after_notes)s

%(example)s

_argcheck(a, b)
_pdf(x, a, b)
_cdf(x, a, b)
_ppf(q, a, b)
class laplace_gen

rA Laplace continuous random variable.

%(before_notes)s

The probability density function for laplace is:

%(after_notes)s

%(example)s

_rvs()
_pdf(x)
_cdf(x)
_ppf(q)
_stats()
_entropy()
class levy_gen

rA Levy continuous random variable.

%(before_notes)s

levy_stable, levy_l

The probability density function for levy is:

for .

This is the same as the Levy-stable distribution with and .

%(after_notes)s

%(example)s

_pdf(x)
_cdf(x)
_ppf(q)
_stats()
class levy_l_gen

rA left-skewed Levy continuous random variable.

%(before_notes)s

levy, levy_stable

The probability density function for levy_l is:

for .

This is the same as the Levy-stable distribution with and .

%(after_notes)s

%(example)s

_pdf(x)
_cdf(x)
_ppf(q)
_stats()
class levy_stable_gen

rA Levy-stable continuous random variable.

%(before_notes)s

levy, levy_l

Levy-stable distribution (only random variates available – ignore other docs)

_rvs(alpha, beta)
_argcheck(alpha, beta)
_pdf(x, alpha, beta)
class logistic_gen

rA logistic (or Sech-squared) continuous random variable.

%(before_notes)s

The probability density function for logistic is:

logistic is a special case of genlogistic with c == 1.

%(after_notes)s

%(example)s

_rvs()
_pdf(x)
_logpdf(x)
_cdf(x)
_ppf(q)
_sf(x)
_isf(q)
_stats()
_entropy()
class loggamma_gen

rA log gamma continuous random variable.

%(before_notes)s

The probability density function for loggamma is:

for all .

loggamma takes as a shape parameter.

%(after_notes)s

%(example)s

_rvs(c)
_pdf(x, c)
_cdf(x, c)
_ppf(q, c)
_stats(c)
class loglaplace_gen

rA log-Laplace continuous random variable.

%(before_notes)s

The probability density function for loglaplace is:

for c > 0.

loglaplace takes c as a shape parameter.

%(after_notes)s

T.J. Kozubowski and K. Podgorski, “A log-Laplace growth rate model”, The Mathematical Scientist, vol. 28, pp. 49-60, 2003.

%(example)s

_pdf(x, c)
_cdf(x, c)
_ppf(q, c)
_munp(n, c)
_entropy(c)
_lognorm_logpdf(x, s)
class lognorm_gen

rA lognormal continuous random variable.

%(before_notes)s

The probability density function for lognorm is:

for x > 0, s > 0.

lognorm takes s as a shape parameter.

%(after_notes)s

A common parametrization for a lognormal random variable Y is in terms of the mean, mu, and standard deviation, sigma, of the unique normally distributed random variable X such that exp(X) = Y. This parametrization corresponds to setting s = sigma and scale = exp(mu).

%(example)s

_rvs(s)
_pdf(x, s)
_logpdf(x, s)
_cdf(x, s)
_logcdf(x, s)
_ppf(q, s)
_sf(x, s)
_logsf(x, s)
_stats(s)
_entropy(s)
class gilbrat_gen

rA Gilbrat continuous random variable.

%(before_notes)s

The probability density function for gilbrat is:

gilbrat is a special case of lognorm with s = 1.

%(after_notes)s

%(example)s

_rvs()
_pdf(x)
_logpdf(x)
_cdf(x)
_ppf(q)
_stats()
_entropy()
class maxwell_gen

rA Maxwell continuous random variable.

%(before_notes)s

A special case of a chi distribution, with df = 3, loc = 0.0, and given scale = a, where a is the parameter used in the Mathworld description [1]_.

The probability density function for maxwell is:

for x > 0.

%(after_notes)s

[1]http://mathworld.wolfram.com/MaxwellDistribution.html

%(example)s

_rvs()
_pdf(x)
_cdf(x)
_ppf(q)
_stats()
_entropy()
class mielke_gen

rA Mielke’s Beta-Kappa continuous random variable.

%(before_notes)s

The probability density function for mielke is:

for x > 0.

mielke takes k and s as shape parameters.

%(after_notes)s

%(example)s

_pdf(x, k, s)
_cdf(x, k, s)
_ppf(q, k, s)
class kappa4_gen

rKappa 4 parameter distribution.

%(before_notes)s

The probability density function for kappa4 is:

if and are not equal to 0.

If or are zero then the pdf can be simplified:

h = 0 and k != 0:

kappa4.pdf(x, h, k) = (1.0 - k*x)**(1.0/k - 1.0)*
                      exp(-(1.0 - k*x)**(1.0/k))

h != 0 and k = 0:

kappa4.pdf(x, h, k) = exp(-x)*(1.0 - h*exp(-x))**(1.0/h - 1.0)

h = 0 and k = 0:

kappa4.pdf(x, h, k) = exp(-x)*exp(-exp(-x))

kappa4 takes and as shape parameters.

The kappa4 distribution returns other distributions when certain and values are used.

h k=0.0 k=1.0 -inf<=k<=inf
-1.0

Logistic

logistic(x)

  Generalized Logistic(1)
0.0

Gumbel

gumbel_r(x)

Reverse Exponential(2)

Generalized Extreme Value

genextreme(x, k)

1.0

Exponential

expon(x)

Uniform

uniform(x)

Generalized Pareto

genpareto(x, -k)

  1. There are at least five generalized logistic distributions. Four are described here: https://en.wikipedia.org/wiki/Generalized_logistic_distribution The “fifth” one is the one kappa4 should match which currently isn’t implemented in scipy: https://en.wikipedia.org/wiki/Talk:Generalized_logistic_distribution http://www.mathwave.com/help/easyfit/html/analyses/distributions/gen_logistic.html
  2. This distribution is currently not in scipy.

J.C. Finney, “Optimization of a Skewed Logistic Distribution With Respect to the Kolmogorov-Smirnov Test”, A Dissertation Submitted to the Graduate Faculty of the Louisiana State University and Agricultural and Mechanical College, (August, 2004), http://digitalcommons.lsu.edu/cgi/viewcontent.cgi?article=4671&context=gradschool_dissertations

J.R.M. Hosking, “The four-parameter kappa distribution”. IBM J. Res. Develop. 38 (3), 25 1-258 (1994).

B. Kumphon, A. Kaew-Man, P. Seenoi, “A Rainfall Distribution for the Lampao Site in the Chi River Basin, Thailand”, Journal of Water Resource and Protection, vol. 4, 866-869, (2012). http://file.scirp.org/pdf/JWARP20121000009_14676002.pdf

C. Winchester, “On Estimation of the Four-Parameter Kappa Distribution”, A Thesis Submitted to Dalhousie University, Halifax, Nova Scotia, (March 2000). http://www.nlc-bnc.ca/obj/s4/f2/dsk2/ftp01/MQ57336.pdf

%(after_notes)s

%(example)s

_argcheck(h, k)
_pdf(x, h, k)
_logpdf(x, h, k)
_cdf(x, h, k)
_logcdf(x, h, k)
_ppf(q, h, k)
_stats(h, k)
class kappa3_gen

rKappa 3 parameter distribution.

%(before_notes)s

The probability density function for kappa is:

kappa3 takes as a shape parameter and .

P.W. Mielke and E.S. Johnson, “Three-Parameter Kappa Distribution Maximum Likelihood and Likelihood Ratio Tests”, Methods in Weather Research, 701-707, (September, 1973), http://docs.lib.noaa.gov/rescue/mwr/101/mwr-101-09-0701.pdf

B. Kumphon, “Maximum Entropy and Maximum Likelihood Estimation for the Three-Parameter Kappa Distribution”, Open Journal of Statistics, vol 2, 415-419 (2012) http://file.scirp.org/pdf/OJS20120400011_95789012.pdf

%(after_notes)s

%(example)s

_argcheck(a)
_pdf(x, a)
_cdf(x, a)
_ppf(q, a)
_stats(a)
class nakagami_gen

rA Nakagami continuous random variable.

%(before_notes)s

The probability density function for nakagami is:

for x > 0, nu > 0.

nakagami takes nu as a shape parameter.

%(after_notes)s

%(example)s

_pdf(x, nu)
_cdf(x, nu)
_ppf(q, nu)
_stats(nu)
class ncx2_gen

rA non-central chi-squared continuous random variable.

%(before_notes)s

The probability density function for ncx2 is:

for .

ncx2 takes df and nc as shape parameters.

%(after_notes)s

%(example)s

_rvs(df, nc)
_logpdf(x, df, nc)
_pdf(x, df, nc)
_cdf(x, df, nc)
_ppf(q, df, nc)
_stats(df, nc)
class ncf_gen

rA non-central F distribution continuous random variable.

%(before_notes)s

The probability density function for ncf is:

for , . Here is the degrees of freedom in the numerator, the degrees of freedom in the denominator, the non-centrality parameter, is the logarithm of the Gamma function, is a generalized Laguerre polynomial and is the beta function.

ncf takes df1, df2 and nc as shape parameters.

%(after_notes)s

%(example)s

_rvs(dfn, dfd, nc)
_pdf_skip(x, dfn, dfd, nc)
_cdf(x, dfn, dfd, nc)
_ppf(q, dfn, dfd, nc)
_munp(n, dfn, dfd, nc)
_stats(dfn, dfd, nc)
class t_gen

rA Student’s T continuous random variable.

%(before_notes)s

The probability density function for t is:

for df > 0.

t takes df as a shape parameter.

%(after_notes)s

%(example)s

_rvs(df)
_pdf(x, df)
_logpdf(x, df)
_cdf(x, df)
_sf(x, df)
_ppf(q, df)
_isf(q, df)
_stats(df)
class nct_gen

rA non-central Student’s T continuous random variable.

%(before_notes)s

The probability density function for nct is:

for df > 0.

nct takes df and nc as shape parameters.

%(after_notes)s

%(example)s

_argcheck(df, nc)
_rvs(df, nc)
_pdf(x, df, nc)
_cdf(x, df, nc)
_ppf(q, df, nc)
_stats(df, nc, moments="mv")
class pareto_gen

rA Pareto continuous random variable.

%(before_notes)s

The probability density function for pareto is:

for , .

pareto takes as a shape parameter.

%(after_notes)s

%(example)s

_pdf(x, b)
_cdf(x, b)
_ppf(q, b)
_sf(x, b)
_stats(b, moments="mv")
_entropy(c)
class lomax_gen

rA Lomax (Pareto of the second kind) continuous random variable.

%(before_notes)s

The Lomax distribution is a special case of the Pareto distribution, with (loc=-1.0).

The probability density function for lomax is:

for , c > 0.

lomax takes as a shape parameter.

%(after_notes)s

%(example)s

_pdf(x, c)
_logpdf(x, c)
_cdf(x, c)
_sf(x, c)
_logsf(x, c)
_ppf(q, c)
_stats(c)
_entropy(c)
class pearson3_gen

rA pearson type III continuous random variable.

%(before_notes)s

The probability density function for pearson3 is:

where:

pearson3 takes skew as a shape parameter.

%(after_notes)s

%(example)s

R.W. Vogel and D.E. McMartin, “Probability Plot Goodness-of-Fit and Skewness Estimation Procedures for the Pearson Type 3 Distribution”, Water Resources Research, Vol.27, 3149-3158 (1991).

L.R. Salvosa, “Tables of Pearson’s Type III Function”, Ann. Math. Statist., Vol.1, 191-198 (1930).

“Using Modern Computing Tools to Fit the Pearson Type III Distribution to Aviation Loads Data”, Office of Aviation Research (2003).

_preprocess(x, skew)
_argcheck(skew)
_stats(skew)
_pdf(x, skew)
_logpdf(x, skew)
_cdf(x, skew)
_rvs(skew)
_ppf(q, skew)
class powerlaw_gen

rA power-function continuous random variable.

%(before_notes)s

The probability density function for powerlaw is:

for , .

powerlaw takes as a shape parameter.

%(after_notes)s

powerlaw is a special case of beta with b == 1.

%(example)s

_pdf(x, a)
_logpdf(x, a)
_cdf(x, a)
_logcdf(x, a)
_ppf(q, a)
_stats(a)
_entropy(a)
class powerlognorm_gen

rA power log-normal continuous random variable.

%(before_notes)s

The probability density function for powerlognorm is:

where is the normal pdf, and is the normal cdf, and , .

powerlognorm takes and as shape parameters.

%(after_notes)s

%(example)s

_pdf(x, c, s)
_cdf(x, c, s)
_ppf(q, c, s)
class powernorm_gen

rA power normal continuous random variable.

%(before_notes)s

The probability density function for powernorm is:

where is the normal pdf, and is the normal cdf, and , .

powernorm takes as a shape parameter.

%(after_notes)s

%(example)s

_pdf(x, c)
_logpdf(x, c)
_cdf(x, c)
_ppf(q, c)
class rdist_gen

rAn R-distributed continuous random variable.

%(before_notes)s

The probability density function for rdist is:

for , .

rdist takes as a shape parameter.

This distribution includes the following distribution kernels as special cases:

c = 2:  uniform
c = 4:  Epanechnikov (parabolic)
c = 6:  quartic (biweight)
c = 8:  triweight

%(after_notes)s

%(example)s

_pdf(x, c)
_cdf(x, c)
_munp(n, c)
class rayleigh_gen

rA Rayleigh continuous random variable.

%(before_notes)s

The probability density function for rayleigh is:

for .

rayleigh is a special case of chi with df == 2.

%(after_notes)s

%(example)s

_rvs()
_pdf(r)
_logpdf(r)
_cdf(r)
_ppf(q)
_sf(r)
_logsf(r)
_isf(q)
_stats()
_entropy()
class reciprocal_gen

rA reciprocal continuous random variable.

%(before_notes)s

The probability density function for reciprocal is:

for , .

reciprocal takes and as shape parameters.

%(after_notes)s

%(example)s

_argcheck(a, b)
_pdf(x, a, b)
_logpdf(x, a, b)
_cdf(x, a, b)
_ppf(q, a, b)
_munp(n, a, b)
_entropy(a, b)
class rice_gen

rA Rice continuous random variable.

%(before_notes)s

The probability density function for rice is:

for , .

rice takes as a shape parameter.

%(after_notes)s

The Rice distribution describes the length, , of a 2-D vector with components , where are constant, are independent Gaussian random variables with standard deviation . Let . Then the pdf of is rice.pdf(x, R/s, scale=s).

%(example)s

_argcheck(b)
_rvs(b)
_cdf(x, b)
_ppf(q, b)
_pdf(x, b)
_munp(n, b)
class recipinvgauss_gen

rA reciprocal inverse Gaussian continuous random variable.

%(before_notes)s

The probability density function for recipinvgauss is:

for .

recipinvgauss takes as a shape parameter.

%(after_notes)s

%(example)s

_pdf(x, mu)
_logpdf(x, mu)
_cdf(x, mu)
_rvs(mu)
class semicircular_gen

rA semicircular continuous random variable.

%(before_notes)s

The probability density function for semicircular is:

for .

%(after_notes)s

%(example)s

_pdf(x)
_cdf(x)
_stats()
_entropy()
class skew_norm_gen

rA skew-normal random variable.

%(before_notes)s

The pdf is:

skewnorm.pdf(x, a) = 2 * norm.pdf(x) * norm.cdf(a*x)

skewnorm takes as a skewness parameter When a = 0 the distribution is identical to a normal distribution. rvs implements the method of [1]_.

%(after_notes)s

%(example)s

[1]A. Azzalini and A. Capitanio (1999). Statistical applications of the multivariate skew-normal distribution. J. Roy. Statist. Soc., B 61, 579-602. http://azzalini.stat.unipd.it/SN/faq-r.html
_argcheck(a)
_pdf(x, a)
_rvs(a)
_stats(a, moments="mvsk")
class trapz_gen

rA trapezoidal continuous random variable.

%(before_notes)s

The trapezoidal distribution can be represented with an up-sloping line from loc to (loc + c*scale), then constant to (loc + d*scale) and then downsloping from (loc + d*scale) to (loc+scale).

trapz takes and as shape parameters.

%(after_notes)s

The standard form is in the range [0, 1] with c the mode. The location parameter shifts the start to loc. The scale parameter changes the width from 1 to scale.

%(example)s

_argcheck(c, d)
_pdf(x, c, d)
_cdf(x, c, d)
_ppf(q, c, d)
class triang_gen

rA triangular continuous random variable.

%(before_notes)s

The triangular distribution can be represented with an up-sloping line from loc to (loc + c*scale) and then downsloping for (loc + c*scale) to (loc+scale).

triang takes as a shape parameter.

%(after_notes)s

The standard form is in the range [0, 1] with c the mode. The location parameter shifts the start to loc. The scale parameter changes the width from 1 to scale.

%(example)s

_rvs(c)
_argcheck(c)
_pdf(x, c)
_cdf(x, c)
_ppf(q, c)
_stats(c)
_entropy(c)
class truncexpon_gen

rA truncated exponential continuous random variable.

%(before_notes)s

The probability density function for truncexpon is:

for .

truncexpon takes as a shape parameter.

%(after_notes)s

%(example)s

_argcheck(b)
_pdf(x, b)
_logpdf(x, b)
_cdf(x, b)
_ppf(q, b)
_munp(n, b)
_entropy(b)
class truncnorm_gen

rA truncated normal continuous random variable.

%(before_notes)s

The standard form of this distribution is a standard normal truncated to the range [a, b] — notice that a and b are defined over the domain of the standard normal. To convert clip values for a specific mean and standard deviation, use:

a, b = (myclip_a - my_mean) / my_std, (myclip_b - my_mean) / my_std

truncnorm takes and as shape parameters.

%(after_notes)s

%(example)s

_argcheck(a, b)
_pdf(x, a, b)
_logpdf(x, a, b)
_cdf(x, a, b)
_ppf(q, a, b)
_stats(a, b)
class tukeylambda_gen

rA Tukey-Lamdba continuous random variable.

%(before_notes)s

A flexible distribution, able to represent and interpolate between the following distributions:

  • Cauchy (lam=-1)
  • logistic (lam=0.0)
  • approx Normal (lam=0.14)
  • u-shape (lam = 0.5)
  • uniform from -1 to 1 (lam = 1)

tukeylambda takes lam as a shape parameter.

%(after_notes)s

%(example)s

_argcheck(lam)
_pdf(x, lam)
_cdf(x, lam)
_ppf(q, lam)
_stats(lam)
_entropy(lam)
class uniform_gen

rA uniform continuous random variable.

This distribution is constant between loc and loc + scale.

%(before_notes)s

%(example)s

_rvs()
_pdf(x)
_cdf(x)
_ppf(q)
_stats()
_entropy()
class vonmises_gen

rA Von Mises continuous random variable.

%(before_notes)s

If x is not in range or loc is not in range it assumes they are angles and converts them to [-pi, pi] equivalents.

The probability density function for vonmises is:

for , .

vonmises takes as a shape parameter.

%(after_notes)s

vonmises_line : The same distribution, defined on a [-\pi, \pi] segment
of the real line.

%(example)s

_rvs(kappa)
_pdf(x, kappa)
_cdf(x, kappa)
_stats_skip(kappa)
_entropy(kappa)
class wald_gen

rA Wald continuous random variable.

%(before_notes)s

The probability density function for wald is:

for .

wald is a special case of invgauss with mu == 1.

%(after_notes)s

%(example)s

_rvs()
_pdf(x)
_logpdf(x)
_cdf(x)
_stats()
class wrapcauchy_gen

rA wrapped Cauchy continuous random variable.

%(before_notes)s

The probability density function for wrapcauchy is:

for , .

wrapcauchy takes as a shape parameter.

%(after_notes)s

%(example)s

_argcheck(c)
_pdf(x, c)
_cdf(x, c)
_ppf(q, c)
_entropy(c)
class gennorm_gen

rA generalized normal continuous random variable.

%(before_notes)s

The probability density function for gennorm is [1]_:

                             beta
gennorm.pdf(x, beta) =  ---------------  exp(-|x|**beta)
                        2 gamma(1/beta)

gennorm takes as a shape parameter. For , it is identical to a Laplace distribution. For \beta = 2, it is identical to a normal distribution (with ).

laplace : Laplace distribution norm : normal distribution

[1]“Generalized normal distribution, Version 1”, https://en.wikipedia.org/wiki/Generalized_normal_distribution#Version_1

%(example)s

_pdf(x, beta)
_logpdf(x, beta)
_cdf(x, beta)
_ppf(x, beta)
_sf(x, beta)
_isf(x, beta)
_stats(beta)
_entropy(beta)
class halfgennorm_gen

rThe upper half of a generalized normal continuous random variable.

%(before_notes)s

The probability density function for halfgennorm is:

gennorm takes as a shape parameter. For , it is identical to an exponential distribution. For , it is identical to a half normal distribution (with ).

gennorm : generalized normal distribution expon : exponential distribution halfnorm : half normal distribution

[1]“Generalized normal distribution, Version 1”, https://en.wikipedia.org/wiki/Generalized_normal_distribution#Version_1

%(example)s

_pdf(x, beta)
_logpdf(x, beta)
_cdf(x, beta)
_ppf(x, beta)
_sf(x, beta)
_isf(x, beta)
_entropy(beta)
class crystalball_gen

r Crystalball distribution

%(before_notes)s

The probability density function for crystalball is:

where , and is a normalisation constant.

crystalball takes and as shape parameters. defines the point where the pdf changes from a power-law to a gaussian distribution is power of the power-law tail.

[1]“Crystal Ball Function”, https://en.wikipedia.org/wiki/Crystal_Ball_function

%(after_notes)s

%(example)s

_pdf(x, beta, m)

Return PDF of the crystalball function.

exp(-x**2 / 2), for x > -beta
crystalball.pdf(x, beta, m) = N * |
A * (B - x)**(-m), for x <= -beta –
_cdf(x, beta, m)

Return CDF of the crystalball function

_munp(n, beta, m)

Returns the n-th non-central moment of the crystalball function.

_argcheck(beta, m)

In HEP crystal-ball is also defined for m = 1 (see plot on wikipedia) But the function doesn’t have a finite integral in this corner case, and isn’t a PDF anymore (but can still be used on a finite range). Here we restrict the function to m > 1. In addition we restrict beta to be positive

_argus_phi(chi)

Utility function for the argus distribution used in the CDF and norm of the Argus Funktion

class argus_gen

r Argus distribution

%(before_notes)s

The probability density function for argus is:

with and being the CDF and PDF of a standard normal distribution, respectively.

argus takes as shape a parameter.

[1]“ARGUS distribution”, https://en.wikipedia.org/wiki/ARGUS_distribution

%(after_notes)s

New in version 0.19.0.

%(example)s

_pdf(x, chi)

Return PDF of the argus function

argus.pdf(x, chi) = chi**3 / (sqrt(2*pi) * Psi(chi)) * x *
sqrt(1-x**2) * exp(- 0.5 * chi**2 * (1 - x**2))
_cdf(x, chi)

Return CDF of the argus function

_sf(x, chi)

Return survival function of the argus function

class rv_histogram(histogram, *args, **kwargs)

Generates a distribution given by a histogram. This is useful to generate a template distribution from a binned datasample.

As a subclass of the rv_continuous class, rv_histogram inherits from it a collection of generic methods (see rv_continuous for the full list), and implements them based on the properties of the provided binned datasample.

histogram : tuple of array_like
Tuple containing two array_like objects The first containing the content of n bins The second containing the (n+1) bin boundaries In particular the return value np.histogram is accepted

There are no additional shape parameters except for the loc and scale. The pdf is defined as a stepwise function from the provided histogram The cdf is a linear interpolation of the pdf.

New in version 0.19.0.

Create a scipy.stats distribution from a numpy histogram

>>> import scipy.stats
>>> import numpy as np
>>> data = scipy.stats.norm.rvs(size=100000, loc=0, scale=1.5, random_state=123)
>>> hist = np.histogram(data, bins=100)
>>> hist_dist = scipy.stats.rv_histogram(hist)

Behaves like an ordinary scipy rv_continuous distribution

>>> hist_dist.pdf(1.0)
0.20538577847618705
>>> hist_dist.cdf(2.0)
0.90818568543056499

PDF is zero above (below) the highest (lowest) bin of the histogram, defined by the max (min) of the original dataset

>>> hist_dist.pdf(np.max(data))
0.0
>>> hist_dist.cdf(np.max(data))
1.0
>>> hist_dist.pdf(np.min(data))
7.7591907244498314e-05
>>> hist_dist.cdf(np.min(data))
0.0

PDF and CDF follow the histogram

>>> import matplotlib.pyplot as plt
>>> X = np.linspace(-5.0, 5.0, 100)
>>> plt.title("PDF from Template")
>>> plt.hist(data, normed=True, bins=100)
>>> plt.plot(X, hist_dist.pdf(X), label='PDF')
>>> plt.plot(X, hist_dist.cdf(X), label='CDF')
>>> plt.show()
__init__(histogram, *args, **kwargs)

Create a new distribution using the given histogram

histogram : tuple of array_like
Tuple containing two array_like objects The first containing the content of n bins The second containing the (n+1) bin boundaries In particular the return value np.histogram is accepted
_pdf(x)

PDF of the histogram

_cdf(x)

CDF calculated from the histogram

_ppf(x)

Percentile function calculated from the histogram

_munp(n)

Compute the n-th non-central moment.

_entropy()

Compute entropy of distribution

_updated_ctor_param()

Set the histogram as additional constructor argument