Density function, distribution function, quantile function and random generation for the generalised Pareto (GP) distribution.
dgp(x, loc = 0, scale = 1, shape = 0, log = FALSE)pgp(q, loc = 0, scale = 1, shape = 0, lower.tail = TRUE, log.p = FALSE)
qgp(p, loc = 0, scale = 1, shape = 0, lower.tail = TRUE, log.p = FALSE)
rgp(n, loc = 0, scale = 1, shape = 0)
Numeric vectors of quantiles. All elements of x
and q
must be non-negative.
Numeric vectors.
Location, scale and shape parameters.
All elements of scale
must be positive.
A logical scalar; if TRUE, probabilities p are given as log(p).
A logical scalar. If TRUE (default), probabilities
are
A numeric vector of probabilities in [0,1].
Numeric scalar. The number of observations to be simulated.
If length(n) > 1
then length(n)
is taken to be the number
required.
dgp
gives the density function, pgp
gives the
distribution function, qgp
gives the quantile function,
and rgp
generates random deviates.
The distribution function of a GP distribution with parameters
location
= scale
= shape
=
If lower.tail = TRUE
then if p = 0
(p = 1
) then
the lower (upper) limit of the distribution is returned.
The upper limit is Inf
if shape
is non-negative.
Similarly, but reversed, if lower.tail = FALSE
.
See https://en.wikipedia.org/wiki/Generalized_Pareto_distribution for further information.
Pickands, J. (1975) Statistical inference using extreme order statistics. Annals of Statistics, 3, 119-131. https://doi.org/10.1214/aos/1176343003
Coles, S. G. (2001) An Introduction to Statistical Modeling of Extreme Values, Springer-Verlag, London. Chapter 4: https://doi.org/10.1007/978-1-4471-3675-0_4
# NOT RUN {
dgp(0:4, scale = 0.5, shape = 0.8)
dgp(1:6, scale = 0.5, shape = -0.2, log = TRUE)
dgp(1, scale = 1, shape = c(-0.2, 0.4))
pgp(0:4, scale = 0.5, shape = 0.8)
pgp(1:6, scale = 0.5, shape = -0.2)
pgp(1, scale = c(1, 2), shape = c(-0.2, 0.4))
pgp(7, scale = 1, shape = c(-0.2, 0.4))
qgp((0:9)/10, scale = 0.5, shape = 0.8)
qgp(0.5, scale = c(0.5, 1), shape = c(-0.5, 0.5))
p <- (1:9)/10
pgp(qgp(p, scale = 2, shape = 0.8), scale = 2, shape = 0.8)
rgp(6, scale = 0.5, shape = 0.8)
# }
Run the code above in your browser using DataLab