Kappa-distribution: The Kappa distribution

Kappa distributionR Documentation

The Kappa distribution

Description

Density, distribution function, quantile function and random generation for the Kappa distribution with location parameter equal to loc, scale parameter equals to scale, first shape parameter equal to sh and second shape parameter equal to sh2.

Usage

pkappa(q, loc, scale, sh, sh2, lower.tail = TRUE, log.p = FALSE)

rkappa(n, loc, scale, sh, sh2)

qkappa(p, loc, scale, sh, sh2, lower.tail = TRUE, log.p = FALSE)

dkappa(x, loc, scale, sh, sh2, log = FALSE)

Arguments

loc

location parameter

scale

scale parameter

sh

first shape parameter

sh2

second shape parameter

lower.tail

logical; if TRUE (default), probabilities are P[X \leq x] otherwise, P[X > x]

n

number of observations. If length(n) > 1, the length is taken to be the number required.

p

vector of probabilities

x, q

vector of quantiles

log, log.p

logical; if TRUE, probabilities p are given as log(p)

Details

#' The distribution is described in the Hosking and Wallis book and can be seen as a generelisation of several distributions used in extreme value modelling. Depending on the sh2 parameter value the Kappa distribution reduces to others commonly used distributions For example: when sh2 is equal to -1 the distribution reduces to a GLO, when sh2 is equal to 0 the distribution reduces to a GEV, when sh2 is equal to +1 the distribution reduces to a Generalised Pareto distribution (GPA).

Value

dkappa gives the density, pkappa gives the distribution function, qkappa gives the quantile function, and rkappa generates random deviates. The length of the result is determined by n for rkappa, and is the maximum of the lengths of the numerical arguments for the other functions. The numerical arguments are recycled to the length of the result. Only the first elements of the logical arguments are used.

References

Hosking, J.R.M. and Wallis, J.R., 2005. Regional frequency analysis: an approach based on L-moments. Cambridge university press.

Examples

plot(seq(-26,40,by=0.2),dkappa(seq(-26,40,by=0.2),4,6,0.2,-0.4),type="l", ylab = "density")
lines(seq(-26,40,by=0.2),dkappa(seq(-26,40,by=0.2),4,6,0.2,-1),type="l", col = 2)
set.seed(123)
plot(ecdf(rkappa(100,4,6,0.2,-0.4)))
lines(seq(-20,30,by=0.5),pkappa(seq(-20,30,by=0.5),4,6,0.2,-0.4),col=2)
## notable quantiles 
qkappa(c(0.5,0.99,0.995,0.995,0.999),4,6,0.2, -0.4) 

ilapros/ilaprosUtils documentation built on April 6, 2023, 4:44 a.m.