Gumbel probability distribution (for maxima)

This is the same distribution as:

  • scipy.stats.gumbel_r;

  • NumPy’s numpy.random.Generator.gumbel;

  • the Gumbel distribution discussed in the wikipedia article “Gumbel distribtion” (https://en.wikipedia.org/wiki/Gumbel_distribution);

  • the Type I extreme value distribution used in the text “An Introduction to Statistical Modeling of Extreme Values” by Stuart Coles (Springer, 2001);

  • the Gumbel distribution given in the text “Modelling Extremal Events” by Embrechts, Klüppelberg and Mikosch (Springer, 1997);

  • the Gumbel distribution in the text “Statistical Distribution” (fourth ed.) by Forbes, Evans, Hastings and Peacock (Wiley, 2011);

  • the extreme_value_distribution class implemented in the Boost/math C++ library;

  • the Gumbel distribution in the Rust rand_distr crate.

mpsci.distributions.gumbel_max.cdf(x, loc, scale)

Cumulative distribution function for the Gumbel distribution.

mpsci.distributions.gumbel_max.invcdf(p, loc, scale)

Inverse of the CDF for the Gumbel distribution.

mpsci.distributions.gumbel_max.invsf(p, loc, scale)

Inverse of the survival function for the Gumbel distribution.

mpsci.distributions.gumbel_max.logpdf(x, loc, scale)

Log of the PDF of the Gumbel distribution.

mpsci.distributions.gumbel_max.mean(loc, scale)

Mean of the Gumbel distribution.

mpsci.distributions.gumbel_max.mle(x, *, loc=None, scale=None)

Maximum likelihood estimates for the Gumbel distribution.

x must be a sequence of numbers–it is the data to which the Gumbel distribution is to be fit.

If either loc or scale is not None, the parameter is fixed at the given value, and only the other parameter will be fit.

Returns maximum likelihood estimates of the loc and scale parameters.

Examples

Imports and mpmath configuration:

>>> from mpmath import mp
>>> mp.dps = 20
>>> from mpsci.distributions import gumbel_max

The data to be fit:

>>> x = [6.86, 14.8 , 15.65,  8.72,  8.11,  8.15, 13.01, 13.36]

Unconstrained MLE:

>>> gumbel_max.mle(x)
(mpf('9.4879877926148360358863'), mpf('2.727868138859403832702'))

If we know the scale is 2, we can add the argument scale=2:

>>> gumbel_max.mle(x, scale=2)
(mpf('9.1305625326153555632872'), mpf('2.0'))
mpsci.distributions.gumbel_max.mom(x)

Method of moments parameter estimation for the Gumbel-max distribution.

x must be a sequence of real numbers.

Returns (loc, scale).

mpsci.distributions.gumbel_max.nll(x, loc, scale)

Negative log-likelihood function for the Gumbel distribution.

mpsci.distributions.gumbel_max.pdf(x, loc, scale)

Probability density function for the Gumbel distribution (for maxima).

mpsci.distributions.gumbel_max.sf(x, loc, scale)

Survival function for the Gumbel distribution.

mpsci.distributions.gumbel_max.support(loc, scale)

Support of the Gumbel distribution.

mpsci.distributions.gumbel_max.var(loc, scale)

Variance of the Gumbel distribution.