| dist_gev | R Documentation |
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.
dist_gev(location, scale, shape)
location |
the location parameter |
scale |
the scale parameter |
shape |
the shape parameter |
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]
Jenkinson, A. F. (1955) The frequency distribution of the annual maximum (or minimum) of meteorological elements. Quart. J. R. Met. Soc., 81, 158–171.
evd::dgev()
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.