Learn R Programming

CoSMoS (version 2.2.0)

GEV: Generalized Extreme Value distribution

Description

Provides density, distribution function, quantile function, random value generation, and raw moments of order r for the generalized extreme value distribution.

Usage

dgev(x, loc, scale, shape, log = FALSE)

pgev(q, loc, scale, shape, lower.tail = TRUE, log.p = FALSE)

qgev(p, loc, scale, shape, lower.tail = TRUE, log.p = FALSE)

rgev(n, loc, scale, shape)

mgev(r, loc, scale, shape)

Value

dgev returns a numeric vector of density values. pgev returns a numeric vector of cumulative probabilities. qgev returns a numeric vector of quantiles. rgev returns a numeric vector of random deviates. mgev returns the raw moment of order r (via numerical integration).

Arguments

x, q

vector of quantiles.

loc, scale, shape

location, scale, and shape parameters.

log, log.p

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

lower.tail

logical; if TRUE (default), probabilities are \(P[X \le 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.

r

raw moment order.

See Also

fitDist, moments

Examples

Run this code

## plot the density

ggplot(data.frame(x = c(0, 20)),
       aes(x)) +
  stat_function(fun = dgev,
                args = list(loc = 1,
                            scale = .5,
                            shape = .15),
                colour = "royalblue4") +
  labs(x = "",
       y = "Density") +
  theme_classic()

Run the code above in your browser using DataLab