Kappa distribution | R Documentation |
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
.
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)
loc |
location parameter |
scale |
scale parameter |
sh |
first shape parameter |
sh2 |
second shape parameter |
lower.tail |
logical; if |
n |
number of observations. If |
p |
vector of probabilities |
x, q |
vector of quantiles |
log, log.p |
logical; if TRUE, probabilities p are given as log(p) |
#' 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).
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.
Hosking, J.R.M. and Wallis, J.R., 2005. Regional frequency analysis: an approach based on L-moments. Cambridge university press.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.