The Gumbel distribution is a special case of the Generalized Extreme Value distribution, obtained when the GEV shape parameter $$\xi$$ is equal to 0. It may be referred to as a type I extreme value distribution.

dist_gumbel(alpha, scale)

## Arguments

alpha

location parameter.

scale

parameter. Must be strictly positive.

## Details

We recommend reading this documentation on https://pkg.mitchelloharawild.com/distributional/, where the math will render nicely.

In the following, let $$X$$ be a Gumbel random variable with location parameter mu = $$\mu$$, scale parameter sigma = $$\sigma$$.

Support: $$R$$, the set of all real numbers.

Mean: $$\mu + \sigma\gamma$$, where $$\gamma$$ is Euler's constant, approximately equal to 0.57722.

Median: $$\mu - \sigma\ln(\ln 2)$$.

Variance: $$\sigma^2 \pi^2 / 6$$.

Probability density function (p.d.f):

$$f(x) = \sigma ^ {-1} \exp[-(x - \mu) / \sigma]% \exp\{-\exp[-(x - \mu) / \sigma] \}$$ for $$x$$ in $$R$$, the set of all real numbers.

Cumulative distribution function (c.d.f):

In the $$\xi = 0$$ (Gumbel) special case $$F(x) = \exp\{-\exp[-(x - \mu) / \sigma] \}$$ for $$x$$ in $$R$$, the set of all real numbers.

## Examples

dist <- dist_gumbel(alpha = c(0.5, 1, 1.5, 3), scale = c(2, 2, 3, 4))
dist
#> <distribution[4]>
#> [1] Gumbel(0.5, 2) Gumbel(1, 2)   Gumbel(1.5, 3) Gumbel(3, 4)

mean(dist)
#> [1] 1.654431 2.154431 3.231647 5.308863
variance(dist)
#> [1]  6.579736  6.579736 14.804407 26.318945
skewness(dist)
#> [1] 1.139547 1.139547 1.139547 1.139547
kurtosis(dist)
#> [1] 2.4 2.4 2.4 2.4
support(dist)
#> <support_region[4]>
#> [1] R R R R
generate(dist, 10)
#> [[1]]
#>  [1] -1.8061146  9.6045238 -0.6696276 -0.2610720  1.5117307  2.8049826
#>  [7]  2.8807408 -0.5473662  0.8243930  3.0807372
#>
#> [[2]]
#>  [1]  1.5718871  0.5726492  3.8677119  5.9692654  1.2540717  2.5478451
#>  [7]  0.2436495 -1.4007318  2.7968322  0.1055007
#>
#> [[3]]
#>  [1]  3.3579583 -0.2585148 -1.4419297  7.3497240  4.5801018 -1.2591714
#>  [7]  3.1824212  0.2875095 -0.2553291 -0.5373263
#>
#> [[4]]
#>  [1]  2.5338757  0.5675519 11.4054492  7.5807278  7.5514069 -4.0137240
#>  [7] 21.3646841  7.4815507  3.2350890  4.2665746
#>

density(dist, 2)
#> [1] 0.14726616 0.16535215 0.12102469 0.08889319
density(dist, 2, log = TRUE)
#> [1] -1.915514 -1.799678 -2.111761 -2.420320

cdf(dist, 4)
#> [1] 0.8404869 0.8000107 0.6475248 0.4589561

quantile(dist, 0.7)
#> [1] 2.561861 3.061861 4.592791 7.123722