Generalised-Extreme-Values-distribution: The Generalised Extreme Values distribution

Generalised Extreme Values distributionR Documentation

The Generalised Extreme Values distribution

Description

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.

Usage

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)

Arguments

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 TRUE (default), probabilities are P[X \leq x] otherwise, P[X > x]

p

vector of probabilities

n

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

Details

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!

Value

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.

References

Hosking, J.R.M. and Wallis, J.R., 2005. Regional frequency analysis: an approach based on L-moments. Cambridge university press.

Examples

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

ilapros/ilaprosUtils documentation built on April 6, 2023, 4:44 a.m.