Distribution function and quantile function of the generalized Pareto distribution.

cdfgpa(x, para = c(0, 1, 0))
quagpa(f, para = c(0, 1, 0))

Arguments

x

Vector of quantiles.

f

Vector of probabilities.

para

Numeric vector containing the parameters of the distribution, in the order \(\xi, \alpha, k\) (location, scale, shape).

Details

The generalized Pareto distribution with location parameter \(\xi\), scale parameter \(\alpha\) and shape parameter \(k\) has distribution function $$F(x)=1-\exp(-y)$$ where $$y=-k^{-1}\log\lbrace1-k(x-\xi)/\alpha\rbrace,$$ with \(x\) bounded by \(\xi+\alpha/k\) from below if \(k<0\) and from above if \(k>0\), and quantile function $$x(F)=\xi+{\alpha\over k}\lbrace 1-(1-F)^k\rbrace.$$

The exponential distribution is the special case \(k=0\). The uniform distribution is the special case \(k=1\).

Value

cdfgpa gives the distribution function; quagpa gives the quantile function.

Note

The functions expect the distribution parameters in a vector, rather than as separate arguments as in the standard R distribution functions pnorm, qnorm, etc.

Two parametrizations of the generalized Pareto distribution are in common use. When Jenkinson (1955) introduced the generalized extreme-value distribution he wrote the distribution function in the form $$F(x) = \exp [ - \lbrace 1 - k ( x - \xi ) / \alpha) \rbrace^{1/k}].$$ Hosking and Wallis (1987) wrote the distribution function of the generalized Pareto distribution analogously as $$F(x) = 1 - \lbrace 1 - k ( x - \xi ) / \alpha) \rbrace^{1/k}$$ and that is the form used in R package lmom. A slight inconvenience with it is that the skewness of the distribution is a decreasing function of the shape parameter \(k\). Perhaps for this reason, authors of some other R packages prefer a form in which the sign of the shape parameter \(k\) is changed and the parameters are renamed: $$F(x) = 1 - \lbrace 1 + \xi ( x - \mu ) / \sigma) \rbrace ^{-1/\xi}.$$ Users should be able to mix functions from packages that use either form; just be aware that the sign of the shape parameter will need to be changed when converting from one form to the other (and that \(\xi\) is a location parameter in one form and a shape parameter in the other).

References

Hosking, J. R. M., and Wallis, J. R. (1987). Parameter and quantile estimation for the generalized Pareto distribution. Technometrics, 29, 339-349.

Jenkinson, A. F. (1955). The frequency distribution of the annual maximum (or minimum) of meteorological elements. Quarterly Journal of the Royal Meteorological Society, 81, 158-171.

See also

cdfexp for the exponential distribution.

cdfkap for the kappa distribution and cdfwak for the Wakeby distribution, which generalize the generalized Pareto distribution.

Examples

# Random sample from the generalized Pareto distribution
# with parameters xi=0, alpha=1, k=-0.5.
quagpa(runif(100), c(0,1,-0.5))
#>   [1]  1.219137266  0.676197071  0.417537998  0.109725489  0.345077168
#>   [6]  1.398625971  5.446845392  0.027168402  1.013371663  3.237354803
#>  [11]  0.080494287  0.244258838  0.816872482  0.327875376  0.617033240
#>  [16]  0.670586402  0.211839909  0.083252259  0.018010347  1.836094262
#>  [21]  9.713148720  0.933628749  0.190659042  0.060843622  0.719488145
#>  [26]  1.256442958  1.141995564  1.945289202  0.899708569  0.819490113
#>  [31]  0.014883304  7.749618278  0.704405184 12.716966077  0.964037094
#>  [36]  0.500082819  0.837367867  0.079089285  9.507161840  1.373402346
#>  [41] 14.098419632  0.936522800  2.091523268  1.030253386  2.249113545
#>  [46]  1.328994544  0.537876395  0.499083845  3.067456858  0.713499843
#>  [51]  0.207331123  8.880046003  1.735949165  0.025360364  1.272347380
#>  [56]  2.821325639  1.347633310  1.704238937  3.562580894  0.359995090
#>  [61]  0.199562395  0.119602859  1.109183814  3.176439151  5.139496560
#>  [66]  1.511810014  0.481817801  0.008714705  0.651155748  1.813400383
#>  [71]  0.608771471  0.984284934  0.177466895  0.044439768  1.561471918
#>  [76]  0.870065269  6.581861308  3.049103717  0.068221465  2.100555906
#>  [81]  0.083315534  0.148560724  2.584650846  1.013002479  1.875864811
#>  [86]  0.480113795 13.191966977  0.601252879  0.501708182  1.392804728
#>  [91]  0.161132169  1.539953949  3.331644415  2.978730085  3.805348314
#>  [96]  0.290690376  1.081049143  4.259252246  0.470131869  2.089801933