# GPD: Generalized Pareto distribution In extraDistr: Additional Univariate and Multivariate Distributions

## Description

Density, distribution function, quantile function and random generation for the generalized Pareto distribution.

## Usage

 ```1 2 3 4 5 6 7``` ```dgpd(x, mu = 0, sigma = 1, xi = 0, log = FALSE) pgpd(q, mu = 0, sigma = 1, xi = 0, lower.tail = TRUE, log.p = FALSE) qgpd(p, mu = 0, sigma = 1, xi = 0, lower.tail = TRUE, log.p = FALSE) rgpd(n, mu = 0, sigma = 1, xi = 0) ```

## Arguments

 `x, q` vector of quantiles. `mu, sigma, xi` location, scale, and shape parameters. Scale must be positive. `log, log.p` logical; if TRUE, probabilities p are given as log(p). `lower.tail` logical; if TRUE (default), probabilities are P[X ≤ 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.

## Details

Probability density function

f(x) = [if ξ != 0:] (1+ξ*(x-μ)/σ)^{-(ξ+1)/ξ}/σ [else:] exp(-(x-μ)/σ)/σ

Cumulative distribution function

F(x) = [if ξ != 0:] 1-(1+ξ*(x-μ)/σ)^{-1/ξ} [else:] 1-exp(-(x-μ)/σ)

Quantile function

F^-1(x) = [if ξ != 0:] μ + σ * ((1-p)^{-ξ}-1)/ξ [else:] μ - σ * log(1-p)

## References

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

## Examples

 ```1 2 3 4 5 6``` ```x <- rgpd(1e5, 5, 2, .1) hist(x, 100, freq = FALSE, xlim = c(0, 50)) curve(dgpd(x, 5, 2, .1), 0, 50, col = "red", add = TRUE, n = 5000) hist(pgpd(x, 5, 2, .1)) plot(ecdf(x)) curve(pgpd(x, 5, 2, .1), 0, 50, col = "red", lwd = 2, add = TRUE) ```

extraDistr documentation built on Sept. 7, 2020, 5:09 p.m.