Distribution function and quantile function of the kappa distribution.

cdfkap(x, para = c(0, 1, 0, 0))
quakap(f, para = c(0, 1, 0, 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, h\) (location, scale, shape, shape).

Details

The kappa distribution with location parameter \(\xi\), scale parameter \(\alpha\) and shape parameters \(k\) and \(h\) has quantile function $$x(F)=\xi+{\alpha\over k}\biggl\lbrace1-\biggl({1-F^h \over h}\biggr)^k\biggr\rbrace.$$

Its special cases include the generalized logistic (\(h=-1\)), generalized extreme-value (\(h=0\)), generalized Pareto (\(h=1\)), logistic (\(k=0\), \(h=-1\)), Gumbel (\(k=0\), \(h=0\)), exponential (\(k=0\), \(h=1\)), and uniform (\(k=1\), \(h=1\)) distributions.

Value

cdfkap gives the distribution function; quakap gives the quantile function.

References

Hosking, J. R. M. (1994). The four-parameter kappa distribution. IBM Journal of Research and Development, 38, 251-258.

Hosking, J. R. M., and Wallis, J. R. (1997). Regional frequency analysis: an approach based on L-moments, Cambridge University Press, Appendix A.10.

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.

See also

cdfglo for the generalized logistic distribution, cdfgev for the generalized extreme-value distribution, cdfgpa for the generalized Pareto distribution, cdfgum for the Gumbel distribution, cdfexp for the exponential distribution.

Examples

# Random sample from the kappa distribution
# with parameters xi=0, alpha=1, k=-0.5, h=0.25.
quakap(runif(100), c(0,1,-0.5,0.25))
#>   [1] -0.060183750  3.193037901 -0.277196415  2.403198344  0.120144531
#>   [6] -0.146214389  3.122975262 -0.417890710  2.201118466  0.096028726
#>  [11]  8.520039275 -0.444048713  0.375065973  0.587762007  2.795166773
#>  [16] -0.677978253 -0.643885590  2.203276013 -0.256619342 -0.568296656
#>  [21]  3.287906717 -0.546097496  0.295680998 10.253014873  0.765666546
#>  [26]  1.833945665 -0.169033319  1.013828336 -0.331915314  0.335422988
#>  [31] -0.340175518 -0.444995494  0.125164642  6.563387390  3.528465722
#>  [36] -0.129731150  1.168791556 -0.436661324  0.005796371  0.994083037
#>  [41]  0.341892099  1.479203442  3.902273100 -0.478019453  1.029721576
#>  [46]  2.867453005  0.117045284  0.993421785  0.382867248 -0.342969145
#>  [51]  0.553772695 -0.387876576  1.131181279 -0.360978683  0.534845821
#>  [56] -0.523446651  0.517096378 -0.659898678  2.601203792 -0.070906922
#>  [61] -0.159480755  0.204716992  1.038007730  6.733412838  0.057045598
#>  [66]  1.014839241  2.613674124 -0.383722216  8.964254782 -0.523019226
#>  [71] -0.173456898  1.072010740  0.518326525 -0.151073644 11.757776228
#>  [76]  1.164880589 -0.513423989  1.030366452  3.560389115  5.473354577
#>  [81]  0.263300853  0.492404454  0.088061472 -0.155061640  7.767527775
#>  [86]  0.106197877 -0.264758804  1.607491751 -0.332538034 -0.204365566
#>  [91]  2.933991936  0.071109690 -0.572341981 -0.703120529 -0.445536760
#>  [96] -0.767129251  1.679708479  5.147007132 12.936360443  0.224295953