Generalised Extreme Values distribution | R Documentation |
Density, distribution function, quantile function and random generation for
the Generalised Extreme Values distribution with location parameter equal to loc
,
scale parameter equal to scale
and shape parameter equal to sh
.
The functions use the Hosking and Wallis notation so that the domain of the distribution
has an upper bound when the shape parameter is positive.
dgev(x, loc, scale, sh, log = FALSE)
pgev(q, loc, scale, sh, lower.tail = TRUE, log.p = FALSE)
qgev(p, loc, scale, sh, lower.tail = TRUE, log.p = FALSE)
rgev(n, loc, scale, sh)
x, q |
vector of quantiles |
loc |
location parameter |
scale |
scale parameter |
sh |
shape parameter |
log, log.p |
logical; if TRUE, probabilities p are given as log(p) |
lower.tail |
logical; if |
p |
vector of probabilities |
n |
number of observations. If |
Extra care should be taken on the shape parameter of the distribution.
Different notations are used in the scientific literature: in one notation, presented
for example in the Hosking and Wallis book and common in hydrology,
the domain of the distribution has an upper bound when the shape parameter is positive.
Conversely, in one notation, presented for example in Coles' book and Wikipedia and
common in statistics, the domain of the distribution has a lower bound when the shape parameter is positive.
The two notation only differ for the sign of the shape parameter.
The functions in this package use the Hosking and Wallis notation for consistency with the pglo
functions.
Nevertheless the fitting in the gev.fit
function is based on the isemv::gev.fit
function written by Stuart Coles which uses the
Coles' notation: be aware of these differences!
dgev gives the density, pgev gives the distribution function, qgev gives the quantile function, and rgev generates random deviates. The length of the result is determined by n for rgev, and is the maximum of the lengths of the numerical arguments for the other functions. The numerical arguments are recycled to the length of the result. Only the first elements of the logical arguments are used.
Hosking, J.R.M. and Wallis, J.R., 2005. Regional frequency analysis: an approach based on L-moments. Cambridge university press.
plot(seq(-15,40,by=0.2),dgev(seq(-15,40,by=0.2),4,6,0.2),type="l")
plot(ecdf(rgev(100,4,6,0.2)))
lines(seq(-15,40,by=0.5),pgev(seq(-15,40,by=0.5),4,6,0.2),col=2)
qgev(c(0.5,0.99,0.995,0.995,0.999),4,6,0.2)
# notable quantiles
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.