qrmtools (version 0.0-6)

GEV: Generalized Extreme Value Distribution

Description

Density, distribution function, quantile function and random variate generation for the generalized extreme value distribution (GEV).

Usage

dGEV(x, xi, mu=0, sigma=1, log=FALSE)
pGEV(q, xi, mu=0, sigma=1, lower.tail=TRUE, log.p=FALSE)
qGEV(p, xi, mu=0, sigma=1, lower.tail=TRUE, log.p=FALSE)
rGEV(n, xi, mu=0, sigma=1)

Arguments

x, q

vector of quantiles.

p

vector of probabilities.

n

number of observations.

xi

GEV shape parameter, a real number.

mu

GEV location parameter, a real number.

sigma

GEV scale parameter, a positive number.

lower.tail

logical; if TRUE (default) probabilities are \(P(X \le x)\) otherwise, \(P(X > x)\).

log, log.p

logical; if TRUE, probabilities p are given as log(p).

Value

dGEV() computes the density, pGEV() the distribution function, qGEV() the quantile function and rGEV() random variates of the generalized extreme value distribution.

Details

The distribution function of the generalized extreme value distribution is given by $$F(x)=\cases{ \exp(-(1-\xi(x-\mu)/\sigma)^{-1/\xi}),&if $\xi\neq 0,\ 1+\xi(x-\mu)/\sigma>0$,\cr \exp(-e^{-(x-\mu)/\sigma}),&if $\xi=0$,\cr}$$ where \(\sigma>0\).

References

McNeil, A. J., Frey, R., and Embrechts, P. (2015). Quantitative Risk Management: Concepts, Techniques, Tools. Princeton University Press.

Examples

Run this code
## Basic sanity checks
plot(pGEV(rGEV(1000, xi=0.5), xi=0.5)) # should be U[0,1]
curve(dGEV(x, xi=0.5), from=-3, to=5)

Run the code above in your browser using DataLab