gumbel | R Documentation |
Density, distribution function, quantile function and random generation for the gumbel distribution with the two parameters location
and scale
.
dgumbel(x, location = 0, scale = 1) pgumbel(q, location = 0, scale = 1) qgumbel(p, location = 0, scale = 1) rgumbel(n, location = 0, scale = 1)
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. |
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}.
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.
Collett, D. (2015). Modelling survival data in medical research, chapter 6. CRC press.
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')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.