gpdUC: The Generalized Pareto Distribution

gpdUCR Documentation

The Generalized Pareto Distribution


Density, distribution function, quantile function and random generation for the generalized Pareto distribution (GPD) with location parameter location, scale parameter scale and shape parameter shape.


dgpd(x, location = 0, scale = 1, shape = 0, log = FALSE,
     tolshape0 = sqrt(.Machine$double.eps))
pgpd(q, location = 0, scale = 1, shape = 0,
     lower.tail = TRUE, log.p = FALSE)
qgpd(p, location = 0, scale = 1, shape = 0,
     lower.tail = TRUE, log.p = FALSE)
rgpd(n, location = 0, scale = 1, shape = 0)


x, q

vector of quantiles.


vector of probabilities.


number of observations. If length(n) > 1 then the length is taken to be the number required.


the location parameter mu.


the (positive) scale parameter sigma.


the shape parameter xi.


Logical. If log = TRUE then the logarithm of the density is returned.

lower.tail, log.p

Same meaning as in punif or qunif.


Positive numeric. Threshold/tolerance value for resting whether xi is zero. If the absolute value of the estimate of xi is less than this value then it will be assumed zero and an exponential distribution will be used.


See gpd, 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.


dgpd gives the density, pgpd gives the distribution function, qgpd gives the quantile function, and rgpd generates random deviates.


The default values of all three parameters, especially xi = 0, means the default distribution is the exponential.

Currently, these functions have different argument names compared with those in the evd package.


T. W. Yee and Kai Huang


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

See Also

gpd, Exponential.


## Not run:  loc <- 2; sigma <- 1; xi <- -0.4
x <- seq(loc - 0.2, loc + 3, by = 0.01)
plot(x, dgpd(x, loc, sigma, xi), type = "l", col = "blue",
     main = "Blue is density, red is the CDF", ylim = c(0, 1),
     sub = "Purple are 5,10,...,95 percentiles", ylab = "", las = 1)
abline(h = 0, col = "blue", lty = 2)
lines(qgpd(seq(0.05, 0.95, by = 0.05), loc, sigma, xi),
  dgpd(qgpd(seq(0.05, 0.95, by = 0.05), loc, sigma, xi), loc, sigma, xi),
      col = "purple", lty = 3, type = "h")
lines(x, pgpd(x, loc, sigma, xi), type = "l", col = "red")
abline(h = 0, lty = 2)

pgpd(qgpd(seq(0.05, 0.95, by = 0.05), loc, sigma, xi), loc, sigma, xi)

## End(Not run)

VGAM documentation built on July 6, 2022, 5:05 p.m.