Distributions

This section collects various additional functions and methods for statistical distributions.

Empirical Distributions

ECDF(x[, side])

Return the Empirical CDF of an array as a step function.

StepFunction(x, y[, ival, sorted, side])

A basic step function.

monotone_fn_inverter(fn, x[, vectorized])

Given a monotone function fn (no checking is done to verify monotonicity) and a set of x values, return an linearly interpolated approximation to its inverse from its values on x.

Count Distributions

The discrete module contains classes for count distributions that are based on discretizing a continuous distribution, and specific count distributions that are not available in scipy.distributions like generalized poisson and zero-inflated count models.

The latter are mainly in support of the corresponding models in statsmodels.discrete. Some methods are not specifically implemented and will use potentially slow inherited generic methods.

DiscretizedCount(*args, **kwds)

Count distribution based on discretized distribution

DiscretizedModel(endog[, exog, distr])

experimental model to fit discretized distribution

genpoisson_p

Generalized Poisson distribution

zigenpoisson

Zero Inflated Generalized Poisson distribution

zinegbin

Zero Inflated Generalized Negative Binomial distribution

zipoisson

Zero Inflated Poisson distribution

Copula

The copula sub-module provides classes to model the dependence between parameters. Copulae are used to construct a multivariate joint distribution and provide a set of functions like sampling, PDF, CDF.

CopulaDistribution(copula, marginals[, cop_args])

Multivariate copula distribution

ArchimedeanCopula(transform[, args, k_dim])

Base class for Archimedean copulas

FrankCopula([theta, k_dim])

Frank copula.

ClaytonCopula([theta, k_dim])

Clayton copula.

GumbelCopula([theta, k_dim])

Gumbel copula.

GaussianCopula([corr, k_dim])

Gaussian copula.

StudentTCopula([corr, df, k_dim])

Student t copula.

ExtremeValueCopula(transform[, args, k_dim])

Extreme value copula constructed from Pickand's dependence function.

IndependenceCopula([k_dim])

Independence copula.

Distribution Extras

Skew Distributions

SkewNorm_gen()

univariate Skew-Normal distribution of Azzalini

SkewNorm2_gen([momtype, a, b, xtol, ...])

univariate Skew-Normal distribution of Azzalini

ACSkewT_gen()

univariate Skew-T distribution of Azzalini

skewnorm2

univariate Skew-Normal distribution of Azzalini

Distributions based on Gram-Charlier expansion

pdf_moments_st(cnt)

Return the Gaussian expanded pdf function given the list of central moments (first one is mean).

pdf_mvsk(mvsk)

Return the Gaussian expanded pdf function given the list of 1st, 2nd moment and skew and Fisher (excess) kurtosis.

pdf_moments(cnt)

Return the Gaussian expanded pdf function given the list of central moments (first one is mean).

NormExpan_gen(args, **kwds)

Gram-Charlier Expansion of Normal distribution

cdf of multivariate normal wrapper for scipy.stats

mvstdnormcdf(lower, upper, corrcoef, **kwds)

standardized multivariate normal cumulative distribution function

mvnormcdf(upper, mu, cov[, lower])

multivariate normal cumulative distribution function

Univariate Distributions by non-linear Transformations

Univariate distributions can be generated from a non-linear transformation of an existing univariate distribution. Transf_gen is a class that can generate a new distribution from a monotonic transformation, TransfTwo_gen can use hump-shaped or u-shaped transformation, such as abs or square. The remaining objects are special cases.

TransfTwo_gen(kls, func, funcinvplus, ...)

Distribution based on a non-monotonic (u- or hump-shaped transformation)

Transf_gen(kls, func, funcinv, *args, **kwargs)

a class for non-linear monotonic transformation of a continuous random variable

ExpTransf_gen(kls, *args, **kwargs)

Distribution based on log/exp transformation

LogTransf_gen(kls, *args, **kwargs)

Distribution based on log/exp transformation

SquareFunc()

class to hold quadratic function with inverse function and derivative

absnormalg

Distribution based on a non-monotonic (u- or hump-shaped transformation)

invdnormalg

a class for non-linear monotonic transformation of a continuous random variable

loggammaexpg

univariate distribution of a non-linear monotonic transformation of a random variable

lognormalg

a class for non-linear monotonic transformation of a continuous random variable

negsquarenormalg

Distribution based on a non-monotonic (u- or hump-shaped transformation)

squarenormalg

Distribution based on a non-monotonic (u- or hump-shaped transformation)

squaretg

Distribution based on a non-monotonic (u- or hump-shaped transformation)

Helper Functions

check_random_state([seed])

Turn seed into a random number generator.