Gumbel probability distribution (for minima)¶
This is the same distribution as:
scipy.stats.gumbel_l;
Wolfram Alpha’s GumbelDistribution;
the distribution implemented by the MATLAB functions evpdf, evcdf, evrnd, etc.
- mpsci.distributions.gumbel_min.cdf(x, loc, scale)¶
Cumulative distribution function for the Gumbel distribution.
- mpsci.distributions.gumbel_min.invcdf(p, loc, scale)¶
Inverse of the CDF for the Gumbel distribution.
- mpsci.distributions.gumbel_min.invsf(p, loc, scale)¶
Inverse of the survival function for the Gumbel distribution.
- mpsci.distributions.gumbel_min.logpdf(x, loc, scale)¶
Log of the PDF of the Gumbel distribution.
- mpsci.distributions.gumbel_min.mean(loc, scale)¶
Mean of the Gumbel distribution.
- mpsci.distributions.gumbel_min.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_min
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_min.mle(x) (mpf('12.708439639698245696235'), mpf('2.878444823276260896075'))
If we know the scale is 2, we can add the argument scale=2:
>>> gumbel_min.mle(x, scale=2) (mpf('13.18226169025112165358'), mpf('2.0'))
- mpsci.distributions.gumbel_min.mom(x)¶
Method of moments parameter estimation for the Gumbel-min distribution.
x must be a sequence of real numbers.
Returns (loc, scale).
- mpsci.distributions.gumbel_min.nll(x, loc, scale)¶
Negative log-likelihood function for the Gumbel distribution.
- mpsci.distributions.gumbel_min.pdf(x, loc, scale)¶
Probability density function for the Gumbel distribution (for minima).
- mpsci.distributions.gumbel_min.sf(x, loc, scale)¶
Survival function for the Gumbel distribution.
- mpsci.distributions.gumbel_min.support(loc, scale)¶
Support of the Gumbel distribution.
- mpsci.distributions.gumbel_min.var(loc, scale)¶
Variance of the Gumbel distribution.