Learn R Programming

VGAM (version 0.7-5)

gevUC: The Generalized Extreme Value Distribution

Description

Density, distribution function, quantile function and random generation for the generalized extreme value distribution (GEV) with location parameter location, scale parameter scale and shape parameter shape.

Usage

dgev(x, location=0, scale=1, shape=0)
pgev(q, location=0, scale=1, shape=0)
qgev(p, location=0, scale=1, shape=0)
rgev(n, location=0, scale=1, shape=0)

Arguments

x, q
vector of quantiles.
p
vector of probabilities.
n
number of observations. Positive integer of length 1.
location
the location parameter $\mu$.
scale
the scale parameter $\sigma$. Must consist of positive values.
shape
the shape parameter $\xi$.

Value

  • dgev gives the density, pgev gives the distribution function, qgev gives the quantile function, and rgev generates random deviates.

Details

See gev, the VGAM family function for estimating the two parameters by maximum likelihood estimation, for formulae and other details. Apart from n, all the above arguments may be vectors and are recyled to the appropriate length if necessary.

References

Coles, S. (2001) An Introduction to Statistical Modeling of Extreme Values. London: Springer-Verlag.

See Also

gev.

Examples

Run this code
x = seq(-3, 3, by=0.01)
loc = 0; sigma = 1; xi = -0.4
plot(x, dgev(x, loc, sigma, xi), type="l", col="blue", ylim=c(0,1),
     main="Blue is density, red is cumulative distribution function",
     sub="Purple are 5,10,...,95 percentiles", ylab="", las=1)
abline(h=0, col="blue", lty=2)
lines(qgev(seq(0.05,0.95,by=0.05), loc, sigma, xi), 
      dgev(qgev(seq(0.05,0.95,by=0.05), loc, sigma, xi), loc, sigma, xi),
      col="purple", lty=3, type="h")
lines(x, pgev(x, loc, sigma, xi), type="l", col="red")
abline(h=0, lty=2)

pgev(qgev(seq(0.05,0.95,by=0.05), loc, sigma, xi), loc, sigma, xi)

Run the code above in your browser using DataLab