GenPareto {reservr} | R Documentation |
The Generalized Pareto Distribution (GPD)
Description
These functions provide information about the generalized Pareto distribution
with threshold u
. dgpd
gives the density, pgpd
gives the distribution
function, qgpd
gives the quantile function and rgpd
generates random
deviates.
Usage
rgpd(n = 1L, u = 0, sigmau = 1, xi = 0)
dgpd(x, u = 0, sigmau = 1, xi = 0, log = FALSE)
pgpd(q, u = 0, sigmau = 1, xi = 0, lower.tail = TRUE, log.p = FALSE)
qgpd(p, u = 0, sigmau = 1, xi = 0, lower.tail = TRUE, log.p = FALSE)
Arguments
n |
integer number of observations. |
u |
threshold parameter (minimum value). |
sigmau |
scale parameter (must be positive). |
xi |
shape parameter |
x , q |
vector of quantiles. |
log , log.p |
logical; if |
lower.tail |
logical; if |
p |
vector of probabilities. |
Details
If u
, sigmau
or xi
are not specified, they assume the default values of
0
, 1
and 0
respectively.
The generalized Pareto distribution has density
where and
if
is 0.
The support is
for
and
for
.
The Expected value exists if and is equal to
k-th moments exist in general for .
Value
rgpd
generates random deviates.
dgpd
gives the density.
pgpd
gives the distribution function.
qgpd
gives the quantile function.
References
https://en.wikipedia.org/wiki/Generalized_Pareto_distribution
Examples
x <- rgpd(1000, u = 1, sigmau = 0.5, xi = 0.1)
xx <- seq(-1, 10, 0.01)
hist(x, breaks = 100, freq = FALSE, xlim = c(-1, 10))
lines(xx, dgpd(xx, u = 1, sigmau = 0.5, xi = 0.1))
plot(xx, dgpd(xx, u = 1, sigmau = 1, xi = 0), type = "l")
lines(xx, dgpd(xx, u = 0.5, sigmau = 1, xi = -0.3), col = "blue", lwd = 2)
lines(xx, dgpd(xx, u = 1.5, sigmau = 1, xi = 0.3), col = "red", lwd = 2)
plot(xx, dgpd(xx, u = 1, sigmau = 1, xi = 0), type = "l")
lines(xx, dgpd(xx, u = 1, sigmau = 0.5, xi = 0), col = "blue", lwd = 2)
lines(xx, dgpd(xx, u = 1, sigmau = 2, xi = 0), col = "red", lwd = 2)