Learn R Programming

VGAM (version 0.9-1)

Gumbel-II: The Gumbel-II Distribution

Description

Density, cumulative distribution function, quantile function and random generation for the Gumbel-II distribution.

Usage

dgumbelII(x, shape, scale = 1, log = FALSE)
pgumbelII(q, shape, scale = 1)
qgumbelII(p, shape, scale = 1)
rgumbelII(n, shape, scale = 1)

Arguments

x, q
vector of quantiles.
p
vector of probabilities.
n
number of observations.
log
Logical. If log = TRUE then the logarithm of the density is returned.
shape, scale
positive shape and scale parameters.

Value

  • dgumbelII gives the density, pgumbelII gives the cumulative distribution function, qgumbelII gives the quantile function, and rgumbelII generates random deviates.

Details

See gumbelII for details.

See Also

gumbelII, dgumbel.

Examples

Run this code
probs <- seq(0.01, 0.99, by = 0.01)
Shape <- exp( 0.5); Scale <- exp(1);
max(abs(pgumbelII(qgumbelII(p = probs, Shape, Scale),
                  Shape, Scale) - probs)) # Should be 0

x <- seq(-0.1, 10, by = 0.01);
plot(x, dgumbelII(x, Shape, Scale), type = "l", col = "blue", las = 1,
     main = "Blue is density, orange is cumulative distribution function",
     sub = "Purple lines are the 10,20,...,90 percentiles",
     ylab = "", ylim = 0:1)
abline(h = 0, col = "blue", lty = 2)
lines(x, pgumbelII(x, Shape, Scale), col = "orange")
probs <- seq(0.1, 0.9, by = 0.1)
Q <- qgumbelII(probs, Shape, Scale)
lines(Q, dgumbelII(Q, Shape, Scale), col = "purple", lty = 3, type = "h")
pgumbelII(Q, Shape, Scale) - probs # Should be all zero
abline(h = probs, col = "purple", lty = 3)

Run the code above in your browser using DataLab