Gauss-Kuzmin distribution

The Gauss–Kuzmin distribution is a discrete probability distribution that arises as the limit probability distribution of the coefficients in the continued fraction expansion of a random variable uniformly distributed in (0, 1).

See https://en.wikipedia.org/wiki/Gauss%E2%80%93Kuzmin_distribution

mpsci.distributions.gauss_kuzmin.cdf(k)

CDF of the Gauss-Kuzmin distribution.

k is expected be an integer; the code does not check this.

mpsci.distributions.gauss_kuzmin.invcdf(p)

Inverse of the CDF of the Gauss-Kuzmin distribution.

The distribution is discrete, but mpmath.mpf values are returned, to allow for returning inf when p is 1.

mpsci.distributions.gauss_kuzmin.invsf(p)

Inverse of the survival function of the Gauss-Kuzmin distribution.

The distribution is discrete, but mpmath.mpf values are returned, to allow for returning inf when p is 0.

mpsci.distributions.gauss_kuzmin.logpmf(k)

Logarithm of the PMF of the Gauss-Kuzmin distribution.

k is expected be an integer; the code does not check this.

mpsci.distributions.gauss_kuzmin.mean()

Mean of the Gauss-Kuzmin distribution.

mpsci.distributions.gauss_kuzmin.median()

Median of the Gauss-Kuzmin distribution.

mpsci.distributions.gauss_kuzmin.mode()

Mode of the Gauss-Kuzmin distribution.

mpsci.distributions.gauss_kuzmin.pmf(k)

Probability mass function (PMF) of the Gauss-Kuzmin distribution.

k is expected be an integer; the code does not check this.

mpsci.distributions.gauss_kuzmin.sf(k)

Survival function of the Gauss-Kuzmin distribution.

k is expected be an integer; the code does not check this.

mpsci.distributions.gauss_kuzmin.support()

Support of the Gauss-Kuzmin distribution.

The support is the integers 1, 2, 3, …, so the support is returned as an instance of itertools.count(start=1).

Examples

>>> from mpsci.distributions import gauss_kuzmin
>>> sup = gauss_kuzmin.support()
>>> next(sup)
1
>>> next(sup)
2
mpsci.distributions.gauss_kuzmin.var()

Variance of the Gauss-Kuzmin distribution.