GevDistribution {fExtremes} | R Documentation |
Generalized Extreme Value Distribution
Description
Density, distribution function, quantile function, random
number generation, and true moments for the GEV including
the Frechet, Gumbel, and Weibull distributions.
The GEV distribution functions are:
dgev | density of the GEV distribution, |
pgev | probability function of the GEV distribution, |
qgev | quantile function of the GEV distribution, |
rgev | random variates from the GEV distribution, |
gevMoments | computes true mean and variance, |
gevSlider | displays density or rvs from a GEV. |
Usage
dgev(x, xi = 1, mu = 0, beta = 1, log = FALSE)
pgev(q, xi = 1, mu = 0, beta = 1, lower.tail = TRUE)
qgev(p, xi = 1, mu = 0, beta = 1, lower.tail = TRUE)
rgev(n, xi = 1, mu = 0, beta = 1)
gevMoments(xi = 0, mu = 0, beta = 1)
gevSlider(method = c("dist", "rvs"))
Arguments
log |
a logical, if |
lower.tail |
a logical, if |
method |
a character string denoting what should be displayed. Either
the density and |
n |
the number of observations. |
p |
a numeric vector of probabilities.
[hillPlot] - |
q |
a numeric vector of quantiles. |
x |
a numeric vector of quantiles. |
xi , mu , beta |
|
Value
d*
returns the density,
p*
returns the probability,
q*
returns the quantiles, and
r*
generates random variates.
All values are numeric vectors.
Author(s)
Alec Stephenson for R's evd
and evir
package, and
Diethelm Wuertz for this R-port.
References
Coles S. (2001); Introduction to Statistical Modelling of Extreme Values, Springer.
Embrechts, P., Klueppelberg, C., Mikosch, T. (1997); Modelling Extremal Events, Springer.
Examples
## rgev -
# Create and plot 1000 Weibull distributed rdv:
r = rgev(n = 1000, xi = -1)
plot(r, type = "l", col = "steelblue", main = "Weibull Series")
grid()
## dgev -
# Plot empirical density and compare with true density:
hist(r[abs(r)<10], nclass = 25, freq = FALSE, xlab = "r",
xlim = c(-5,5), ylim = c(0,1.1), main = "Density")
box()
x = seq(-5, 5, by = 0.01)
lines(x, dgev(x, xi = -1), col = "steelblue")
## pgev -
# Plot df and compare with true df:
plot(sort(r), (1:length(r)/length(r)),
xlim = c(-3, 6), ylim = c(0, 1.1),
cex = 0.5, ylab = "p", xlab = "q", main = "Probability")
grid()
q = seq(-5, 5, by = 0.1)
lines(q, pgev(q, xi = -1), col = "steelblue")
## qgev -
# Compute quantiles, a test:
qgev(pgev(seq(-5, 5, 0.25), xi = -1), xi = -1)
## gevMoments:
# Returns true mean and variance:
gevMoments(xi = 0, mu = 0, beta = 1)
## Slider:
# gevSlider(method = "dist")
# gevSlider(method = "rvs")