Density, distribution function, quantile function and random generation for the generalized Pareto distribution with location, scale and shape parameters.
dGPD(x, loc = 0, scale = 1, shape = 0, log = FALSE)pGPD(q, loc = 0, scale = 1, shape = 0, lower.tail = TRUE,
log.p = FALSE)
qGPD(p, loc = 0, scale = 1, shape = 0, lower.tail = TRUE,
log.p = FALSE)
rGPD(n, loc = 0, scale = 1, shape = 0)
vector of quantiles.
location parameter.
scale parameter.
shape parameter.
logical; if TRUE, probabilities \(p\) are given as \(log(p)\), default: FALSE.
logical; if TRUE, probabilities are \(P[X \le x]\) otherwise, \(P[X > x]\), default: TRUE.
vector of probabilities.
number of observations.
dGPD gives the density, pGPD gives the distribution function, qGPD gives the quantile function, and
rGPD generates random deviates.
Invalid arguments will result in return value NaN, with a warning.
The generalized Pareto distribution function with location parameter \(\mu\), scale parameter \(\sigma\) and shape parameter \(\xi\) has density given by $$f(x)=1/\sigma (1 + \xi z)^-(1/\xi + 1)$$ for \(x\ge \mu\) and \(\xi> 0\), or \(\mu-\sigma/\xi \ge x\ge \mu\) and \(\xi< 0\), where \(z=(x-\mu)/\sigma\). In the case where \(\xi= 0\), the density is equal to \(f(x)=1/\sigma e^-z\) for \(x\ge \mu\). The cumulative distribution function is $$F(x)=1-(1+\xi z)^(-1/\xi)$$ for \(x\ge \mu\) and \(\xi> 0\), or \(\mu-\sigma/\xi \ge x\ge \mu\) and \(\xi< 0\), with \(z\) as stated above. If \(\xi= 0\) the CDF has form \(F(x)=1-e^-z\).
See https://en.wikipedia.org/wiki/Generalized_Pareto_distribution for more details.
# NOT RUN {
dGPD(seq(1, 5), 0, 1, 1)
qGPD(pGPD(seq(1, 5), 0, 1, 1), 0, 1 ,1)
rGPD(5, 0, 1, 1)
# }
Run the code above in your browser using DataLab