Density, distribution function, quantile function and random variate generation for the (generalized) Pareto distribution (GPD).
dGPD(x, xi, beta, log=FALSE)
pGPD(q, xi, beta, lower.tail=TRUE, log.p=FALSE)
qGPD(p, xi, beta, lower.tail=TRUE, log.p=FALSE)
rGPD(n, xi, beta)dPar(x, theta, log=FALSE)
pPar(q, theta, lower.tail=TRUE, log.p=FALSE)
qPar(p, theta, lower.tail=TRUE, log.p=FALSE)
rPar(n, theta)
vector of quantiles.
vector of probabilities.
number of observations.
GPD shape parameter, a real number.
GPD scale parameter, a positive number.
Pareto parameter, a positive number.
logical
; if TRUE (default)
probabilities are \(P(X \le x)\) otherwise, \(P(X > x)\).
logical; if TRUE, probabilities p are given as log(p).
dGPD()
computes the density, pGPD()
the distribution
function, qGPD()
the quantile function and rGPD()
random
variates of the generalized Pareto distribution.
Similary for dPar()
, pPar()
, qPar()
and
rPar()
for the (standard) Pareto distribution.
The distribution function of the generalized Pareto distribution is given by $$F(x)=\cases{ 1-(1+\xi x/\beta)^{-1/\xi},&if $\xi\neq 0$,\cr 1-\exp(-x/\beta),&if $\xi=0$,\cr}$$ where \(\beta>0\) and \(x\ge0\) if \(\xi\ge 0\) and \(x\in[0,-\beta/\xi]\) if \(\xi<0\).
The distribution function of the (standard) Pareto distribution is given by $$F(x)=1-(1+x)^{-\theta},\ x\ge 0,$$ where \(\theta>0\).
In contrast to dGPD()
, pGPD()
, qGPD()
and
rGPD()
, the functions dPar()
, pPar()
,
qPar()
and rPar()
are vectorized in both their main
argument and \(\theta\).
McNeil, A. J., Frey, R., and Embrechts, P. (2015). Quantitative Risk Management: Concepts, Techniques, Tools. Princeton University Press.
## Basic sanity checks
plot(pGPD(rGPD(1000, xi=0.5, beta=3), xi=0.5, beta=3)) # should be U[0,1]
curve(dGPD(x, xi=0.5, beta=3), from=-1, to=5)
Run the code above in your browser using DataLab