Fréchet (Maximum/Minimum-Type-II or Inverse Weibull) distribution#
- class ctx.dist_frechet(a, b=1)#
The Fréchet distribution is a continuous probability distribution with shape parameters \(a\) and \(b\), and the support interval \((0,+\infty)\). If \(b = 1\) this is the classical Fréchet distribution. For \(b \ne 1\) this is also called reciprocal Weibull distribution or the generalized inverse Weibull distribution ([DeGusmao2011`).
See also: Wikipedia [1296], De Gusmao et al. [212], Kleiber and Kotz [415],
TODO: remove m and s from these formulas, use formulas from De Gusmao et al. [212].
Note: \(\alpha\) in Wikipedia corresponds to \(-\beta\) in De Gusmao et al. [212].
- dist_frechet.pdf(x)#
Returns \(\text{pdf}_X(x)\), the probability density function (pdf) of a random variable \(X\), following an Fréchet distribution:
\[\text{pdf}_X(x) = \frac{\alpha}{s} \; \left(\frac{x-m}{s}\right)^{-1-\alpha} \; e^{-(\frac{x-m}{s})^{-\alpha}}\]>>> from mpdistrib import * >>> mp.dps = 30 >>> mu = 0; sigma = 1; x = 3; >>> print ("pdf: ", dist_frechet(mu, sigma).pdf(x)) 6.3563523462564525615615615614561356E-20
- dist_frechet.cdf(x)#
Returns \(\text{cdf}_X(x)\), the cumulative distribution function (cdf) of a random variable \(X\), following an Fréchet distribution:
\[\text{cdf}_X(x) = e^{-(\frac{x-m}{s})^{-\alpha}}\]>>> from mpdistrib import * >>> mp.dps = 30 >>> mu = 0; sigma = 1; x = 3; >>> print ("cdf: ", dist_frechet(mu, sigma).pdf(x)) 6.3563523462564525615615615614561356E-20
- dist_frechet.sf(x)#
Returns \(\text{sf}_X(x)\), the survival function function (sf) of a random variable \(X\), following an Fréchet distribution:
\[\text{sf}_X(x) = 1 - e^{-(\frac{x-m}{s})^{-\alpha}}\]>>> from mpdistrib import * >>> mp.dps = 30 >>> mu = 0; sigma = 1; x = 3; >>> print (" sf: ", dist_frechet(mu, sigma).pdf(x)) sf: 6.3563523462564525615615615614561356E-20
- dist_frechet.qtf(q)#
Returns \(\text{qtf}_X(x)\), the quantile function function (qtf) of a random variable \(X\), following an Fréchet distribution:
\[\text{qtf}_X(q) = m + s \left(-\log(q) \right) ^{-1/a}\]>>> from mpdistrib import * >>> mp.dps = 30 >>> mu = 0; sigma = 1; q = 0.3; >>> print ("qtf: ", dist_frechet(mu, sigma).qtf(q)) qtf: 6.3563523462564525615615615614561356E+00
- dist_frechet.isf(q)#
Returns \(\text{isf}_X(q)\), the inverse survival function function (isf) of a random variable \(X\), following an Fréchet distribution:
\[\text{isf}_X(q) = m + s \left(-\log(1-q) \right) ^{-1/a}\]>>> from mpdistrib import * >>> mp.dps = 30 >>> mu = 0; sigma = 1; q = 0.3; >>> print ("isf: ", dist_frechet(mu, sigma).isf(q)) 6.3563523462564525615615615614561356E+00
- dist_frechet.c_x(t)#
Returns \(C_X(t)\), the characteristic function of a random variable \(X\), following an Fréchet distribution:
\[C_X(t) = \int_{0}^{\infty} e^{i tx} \text{pdf}_X(x) \mathrm{d} x\]>>> from mpdistrib import * >>> mp.dps = 30 >>> mu = 0; sigma = 1; t = 0.3; >>> print ("c_x: ", dist_frechet(mu, sigma).c_x(t)) 6.3563523462564525615615615614561356E+00
- dist_frechet.m_x(t)#
Returns None, since the moment generating function does not exist.
- dist_frechet.k_x(t, k=0)#
Returns None, since the cumulant generating function does not exist.
- dist_frechet.moments(k)#
Returns the first \(j\) central moments, \(\mu_j, j = 1 \ldots k\), of a random variable \(X\), following an Fréchet distribution. Moments exist only for \(a > k\).
\[\mu_k = a^k \Gamma(1-k b^{-1})\]>>> from mpdistrib import * >>> mp.dps = 30 >>> mu = 0; sigma = 1; k = 6; >>> print ("saddlepoint: ", dist_frechet(mu, sigma).moments(k)) 6.3563523462564525615615615614561356E+00
- dist_frechet.cumulants(k)#
Returns the first \(j\) cumulants, \(\kappa_j, j = 1 \ldots k\), of a random variable \(X\), following an Fréchet distribution. The cumulants are calculated from the moments.
>>> from mpdistrib import * >>> mp.dps = 30 >>> mu = 0; sigma = 1; k = 6; >>> print ("saddlepoint: ", dist_frechet(mu, sigma).cumulants(k)) 6.3563523462564525615615615614561356E+00