gumbel: The Gumbel Distribution.

gumbelR Documentation

The Gumbel Distribution.

Description

Density, distribution function, quantile function and random generation for the gumbel distribution with the two parameters location and scale.

Usage

dgumbel(x, location = 0, scale = 1)
pgumbel(q, location = 0, scale = 1)
qgumbel(p, location = 0, scale = 1)
rgumbel(n, location = 0, scale = 1)

Arguments

q

vector of quantiles.

location

location parameter and mode of the distribution.

scale

scaling parameter, has to be positive.

x

vector of locations.

p

vector of probabilities.

n

number of observations. If length(n) > 1, the length is taken to be the number required.

Details

The gumbel distribution has the following density and cdf
f(x) = (1/scale)*exp((x - location)/scale - exp((x - location)/scale)), F(x) = 1 - exp(- exp((x - location)/scale)). The mode of the distribution is location, the variance is π^{2/6} * \code{scale}.

Value

dgumbel gives the density, pgumbel gives the distribution function, qgumbel gives the quantile function, and rgumbel generates random deviates.

The length of the result is determined by n for rgumbel, and is the maximum of the lengths of the numerical arguments for the other functions.

The numerical arguments other than n are recycled to the length of the result.

References

Collett, D. (2015). Modelling survival data in medical research, chapter 6. CRC press.

Examples


hist(rgumbel(1000))

qg <- qgumbel(0.1, 1, 2)

pgumbel(qg, 1, 2)

ax <- c(1:1000)/100-5
plot(ax,dgumbel(ax), type = 'l')


dirttee documentation built on Sept. 14, 2022, 5:06 p.m.