GumbelDistribution

class GumbelDistribution(val mu: Double = 0.0, val beta: Double = 1.0) : ContinuousDistribution(source)

The Gumbel distribution (extreme value type I, right-skewed), defined by its location mu and scale beta parameters.

The Gumbel distribution models the distribution of the maximum of a number of samples of various distributions. It is widely used in hydrology (flood analysis), meteorology (extreme weather events), and reliability engineering (failure analysis). Unlike symmetric distributions, the Gumbel has a longer right tail, reflecting the tendency for extreme maxima to be farther from the center than extreme minima.

This implementation corresponds to scipy.stats.gumbel_r (right-skewed Gumbel).

Example:

val dist = GumbelDistribution(mu = 0.0, beta = 1.0)
dist.pdf(0.0) // 0.3679... (peak density at the mode)
dist.cdf(0.0) // 0.3679...
dist.quantile(0.5) // 0.3665... (median)
dist.mean // 0.5772... (Euler-Mascheroni constant)

Constructors

Link copied to clipboard
constructor(mu: Double = 0.0, beta: Double = 1.0)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

the scale parameter (spread) of the distribution. Must be positive. Defaults to 1.0.

Link copied to clipboard
open override val entropy: Double

The Shannon entropy of this distribution in nats, equal to ln(beta) + 1 + gamma.

Link copied to clipboard
open override val kurtosis: Double

The excess kurtosis of this distribution, always 12/5 = 2.4.

Link copied to clipboard
open override val mean: Double

The mean of this distribution, equal to mu + beta * gamma (Euler-Mascheroni constant).

Link copied to clipboard
val mu: Double

the location parameter (mode) of the distribution. Defaults to 0.0.

Link copied to clipboard
open override val skewness: Double

The skewness of this distribution, equal to 12 * sqrt(6) * zeta(3) / pi^3, approximately 1.1395.

Link copied to clipboard
open override val standardDeviation: Double

The standard deviation of this distribution, equal to pi * beta / sqrt(6).

Link copied to clipboard
open override val variance: Double

The variance of this distribution, equal to (pi * beta)^2 / 6.

Functions

Link copied to clipboard
open override fun cdf(x: Double): Double

Returns the cumulative distribution function value at x for this Gumbel distribution.

Link copied to clipboard
open override fun logPdf(x: Double): Double

Returns the natural logarithm of the probability density at x for this Gumbel distribution.

Link copied to clipboard
open override fun pdf(x: Double): Double

Returns the probability density at x for this Gumbel distribution.

Link copied to clipboard
open override fun quantile(p: Double): Double

Returns the quantile (inverse CDF) for the given probability p.

Link copied to clipboard
open override fun sample(random: Random): Double

Draws a single random value from this Gumbel distribution using inverse CDF sampling.

Link copied to clipboard
open override fun sf(x: Double): Double

Returns the survival function value at x for this Gumbel distribution.