Description Usage Arguments Details References Examples
Density, distribution function, quantile function and random generation for the generalized extreme value distribution.
1 2 3 4 5 6 7 |
x, q |
vector of quantiles. |
mu, sigma, xi |
location, scale, and shape parameters. Scale must be positive. |
log, log.p |
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X ≤ x] otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. If |
Probability density function
f(x) = [if ξ != 0:] 1/σ * (1+ξ*(x-μ)/σ)^{-1/ξ-1} * exp(-(1+ξ*(x-μ)/σ)^{-1/ξ}) [else:] 1/σ * exp(-(x-μ)/σ) * exp(-exp(-(x-μ)/σ))
Cumulative distribution function
F(x) = [if ξ != 0:] exp(-(1+ξ*(x-μ)/σ)^{1/ξ}) [else:] exp(-exp(-(x-μ)/σ))
Quantile function
F^-1(p) = [if ξ != 0:] μ - σ/ξ * (1 - (-log(p))^ξ) [else:] μ - σ * log(-log(p))
Coles, S. (2001). An Introduction to Statistical Modeling of Extreme Values. Springer.
1 2 3 4 5 6 7 8 9 10 11 12 | curve(dgev(x, xi = -1/2), -4, 4, col = "green", ylab = "")
curve(dgev(x, xi = 0), -4, 4, col = "red", add = TRUE)
curve(dgev(x, xi = 1/2), -4, 4, col = "blue", add = TRUE)
legend("topleft", col = c("green", "red", "blue"), lty = 1,
legend = expression(xi == -1/2, xi == 0, xi == 1/2), bty = "n")
x <- rgev(1e5, 5, 2, .5)
hist(x, 1000, freq = FALSE, xlim = c(0, 50))
curve(dgev(x, 5, 2, .5), 0, 50, col = "red", add = TRUE, n = 5000)
hist(pgev(x, 5, 2, .5))
plot(ecdf(x), xlim = c(0, 50))
curve(pgev(x, 5, 2, .5), 0, 50, col = "red", lwd = 2, add = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.