Log-Density function of the generalised extreme value (GEV) distribution

log_gev(x, loc = 0, scale = 1, shape = 0)

Arguments

x

Numeric vectors of quantiles.

loc, scale, shape

Numeric scalars. Location, scale and shape parameters. scale must be positive.

Value

A numeric vector of value(s) of the log-density of the GEV distribution.

Details

It is assumed that x, loc = \(\mu\), scale = \(\sigma\) and shape = \(\xi\) are such that the GEV density is non-zero, i.e. that \(1 + \xi (x - \mu) / \sigma > 0\). No check of this, or that scale > 0 is performed in this function.

The distribution function of a GEV distribution with parameters loc = \(\mu\), scale = \(\sigma\) (>0) and shape = \(\xi\) is $$F(x) = exp { - [1 + \xi (x - \mu) / \sigma] ^ (-1/\xi)} $$ for \(1 + \xi (x - \mu) / \sigma > 0\). If \(\xi = 0\) the distribution function is defined as the limit as \(\xi\) tends to zero. The support of the distribution depends on \(\xi\): it is \(x <= \mu - \sigma / \xi\) for \(\xi < 0\); \(x >= \mu - \sigma / \xi\) for \(\xi > 0\); and \(x\) is unbounded for \(\xi = 0\). Note that if \(\xi < -1\) the GEV density function becomes infinite as \(x\) approaches \(\mu -\sigma / \xi\) from below.

See https://en.wikipedia.org/wiki/Generalized_extreme_value_distribution for further information.

References

Jenkinson, A. F. (1955) The frequency distribution of the annual maximum (or minimum) of meteorological elements. Quart. J. R. Met. Soc., 81, 158-171. Chapter 3: doi:10.1002/qj.49708134804

Coles, S. G. (2001) An Introduction to Statistical Modeling of Extreme Values, Springer-Verlag, London. doi:10.1007/978-1-4471-3675-0_3

Examples

log_gev(1:4, 1, 0.5, 0.8)
#> [1] -0.3068528 -1.7596424 -2.7021107 -3.3731334
log_gev(1:3, 1, 0.5, -0.2)
#> [1] -0.3068528 -1.4279153 -5.7449245