Description Usage Arguments Details Value Author(s) References See Also Examples
Density, distribution function, quantile function, random generation, and gradient of density of the extreme value (maximum and minimum) distributions. The Gumbel distribution is also known as the extreme value maximum distribution, the double-exponential distribution and the log-Weibull distribution.
1 2 3 4 5 6 7 8 9 |
x,q |
numeric vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. |
location |
numeric scalar. |
scale |
numeric scalar. |
lower.tail |
logical; if |
log |
logical; if |
max |
distribution for extreme maxima (default) or minima? The default corresponds to the standard right-skew Gumbel distribution. |
dgumbel
, pgumbel
and ggumbel
are implemented in C
for speed and care is taken that 'correct' results are provided for
values of NA
, NaN
, Inf
, -Inf
or just
extremely small or large.
See the 'Primer' vignette for the definition of the Gumbel distribution and its relation to the log-log and complementary-log-log link used in cumulative link models. See the examples for numerical relations between the max and min variants.
The distribution functions, densities and gradients are used in the
Newton-Raphson algorithms in fitting cumulative link models with
clm
and cumulative link mixed models with
clmm
.
pgumbel
gives the distribution function, dgumbel
gives the density, ggumbel
gives the gradient of the
density, qgumbel
is the quantile function, and
rgumbel
generates random deviates.
Rune Haubo B Christensen
wikipedia.org/wiki/Gumbel_distribution
Gradients of densities are also implemented for the normal, logistic,
cauchy, cf. gfun
and the log-gamma distribution,
cf. lgamma
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ## Illustrating the symmetry of the distribution functions:
pgumbel(5) == 1 - pgumbel(-5, max=FALSE) ## TRUE
dgumbel(5) == dgumbel(-5, max=FALSE) ## TRUE
ggumbel(5) == -ggumbel(-5, max=FALSE) ## TRUE
## More examples:
x <- -5:5
(pp <- pgumbel(x))
qgumbel(pp)
dgumbel(x)
ggumbel(x)
(ppp <- pgumbel(x, max=FALSE))
## Observe that probabilities close to 0 are more accurately determined than
## probabilities close to 1:
qgumbel(ppp, max=FALSE)
dgumbel(x, max=FALSE)
ggumbel(x, max=FALSE)
## random deviates:
set.seed(1)
(r1 <- rgumbel(10))
set.seed(1)
r2 <- -rgumbel(10, max = FALSE)
all(r1 == r2) ## TRUE
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.