dist_gev: The Generalized Extreme Value Distribution

View source: R/dist_gev.R

dist_gevR Documentation

The Generalized Extreme Value Distribution

Description

[Stable]

The GEV distribution is widely used in extreme value theory to model the distribution of maxima (or minima) of samples. The parametric form encompasses the Gumbel, Frechet, and reverse Weibull distributions.

Usage

dist_gev(location, scale, shape)

Arguments

location

the location parameter \mu of the GEV distribution.

scale

the scale parameter \sigma of the GEV distribution. Must be strictly positive.

shape

the shape parameter \xi of the GEV distribution. Determines the tail behavior: \xi = 0 gives Gumbel, \xi > 0 gives Frechet, \xi < 0 gives reverse Weibull.

Details

We recommend reading this documentation on pkgdown which renders math nicely. https://pkg.mitchelloharawild.com/distributional/reference/dist_gev.html

In the following, let X be a GEV random variable with parameters location = \mu, scale = \sigma, and shape = \xi.

Support:

  • x \in \mathbb{R} (all real numbers) if \xi = 0

  • x \geq \mu - \sigma/\xi if \xi > 0

  • x \leq \mu - \sigma/\xi if \xi < 0

Mean:

E(X) = \begin{cases} \mu + \sigma \gamma & \text{if } \xi = 0 \\ \mu + \sigma \frac{\Gamma(1-\xi) - 1}{\xi} & \text{if } \xi < 1 \\ \infty & \text{if } \xi \geq 1 \end{cases}

where \gamma \approx 0.5772 is the Euler-Mascheroni constant and \Gamma(\cdot) is the gamma function.

Median:

\text{Median}(X) = \begin{cases} \mu - \sigma \log(\log 2) & \text{if } \xi = 0 \\ \mu + \sigma \frac{(\log 2)^{-\xi} - 1}{\xi} & \text{if } \xi \neq 0 \end{cases}

Variance:

\text{Var}(X) = \begin{cases} \frac{\pi^2 \sigma^2}{6} & \text{if } \xi = 0 \\ \frac{\sigma^2}{\xi^2} [\Gamma(1-2\xi) - \Gamma(1-\xi)^2] & \text{if } \xi < 0.5 \\ \infty & \text{if } \xi \geq 0.5 \end{cases}

Probability density function (p.d.f):

For \xi = 0 (Gumbel):

f(x) = \frac{1}{\sigma} \exp\left(-\frac{x-\mu}{\sigma}\right) \exp\left[-\exp\left(-\frac{x-\mu}{\sigma}\right)\right]

For \xi \neq 0:

f(x) = \frac{1}{\sigma} \left[1 + \xi\left(\frac{x-\mu}{\sigma}\right)\right]^{-1/\xi-1} \exp\left\{-\left[1 + \xi\left(\frac{x-\mu}{\sigma}\right)\right]^{-1/\xi}\right\}

where 1 + \xi(x-\mu)/\sigma > 0.

Cumulative distribution function (c.d.f):

For \xi = 0 (Gumbel):

F(x) = \exp\left[-\exp\left(-\frac{x-\mu}{\sigma}\right)\right]

For \xi \neq 0:

F(x) = \exp\left\{-\left[1+\xi\left(\frac{x-\mu}{\sigma}\right)\right]^{-1/\xi}\right\}

where 1 + \xi(x-\mu)/\sigma > 0.

Quantile function:

For \xi = 0 (Gumbel):

Q(p) = \mu - \sigma \log(-\log p)

For \xi \neq 0:

Q(p) = \mu + \frac{\sigma}{\xi}\left[(-\log p)^{-\xi} - 1\right]

References

Jenkinson, A. F. (1955) The frequency distribution of the annual maximum (or minimum) of meteorological elements. Quart. J. R. Met. Soc., 81, 158–171.

See Also

evd::dgev()

Examples

# Create GEV distributions with different shape parameters

# Gumbel distribution (shape = 0)
gumbel <- dist_gev(location = 0, scale = 1, shape = 0)

# Frechet distribution (shape > 0, heavy-tailed)
frechet <- dist_gev(location = 0, scale = 1, shape = 0.3)

# Reverse Weibull distribution (shape < 0, bounded above)
weibull <- dist_gev(location = 0, scale = 1, shape = -0.2)

dist <- c(gumbel, frechet, weibull)
dist

# Statistical properties
mean(dist)
median(dist)
variance(dist)

# Generate random samples
generate(dist, 10)

# Evaluate density
density(dist, 2)
density(dist, 2, log = TRUE)

# Evaluate cumulative distribution
cdf(dist, 4)

# Calculate quantiles
quantile(dist, 0.95)


distributional documentation built on June 11, 2026, 9:07 a.m.