Computes the probability density function (PDF) for the Exponentiated
Kumaraswamy (EKw) distribution with parameters alpha (\(\alpha\)),
beta (\(\beta\)), and lambda (\(\lambda\)).
This distribution is defined on the interval (0, 1).
Arguments
- x
Vector of quantiles (values between 0 and 1).
- alpha
Shape parameter
alpha> 0. Can be a scalar or a vector. Default: 1.0.- beta
Shape parameter
beta> 0. Can be a scalar or a vector. Default: 1.0.- lambda
Shape parameter
lambda> 0 (exponent parameter). Can be a scalar or a vector. Default: 1.0.- log
Logical; if
TRUE, the logarithm of the density is returned (\(\log(f(x))\)). Default:FALSE.
Value
A vector of density values (\(f(x)\)) or log-density values
(\(\log(f(x))\)). The length of the result is determined by the recycling
rule applied to the arguments (x, alpha, beta,
lambda). Returns 0 (or -Inf if
log = TRUE) for x strictly outside the interval [0, 1]. At the
closed boundaries x = 0 and x = 1 the limiting density is
returned rather than 0, following the convention of base R's density
functions (compare dbeta); depending on the parameters
that limit is 0, a finite positive value, or Inf.
An out-of-bound or missing parameter is an error, not a return value: the
wrapper stops with a message naming the parameter. An infinite parameter is
not currently intercepted there and reaches the C++ layer, which treats it
as invalid.
Details
The probability density function (PDF) of the Exponentiated Kumaraswamy (EKw) distribution is given by: $$ f(x; \alpha, \beta, \lambda) = \lambda \alpha \beta x^{\alpha-1} (1 - x^\alpha)^{\beta-1} \bigl[1 - (1 - x^\alpha)^\beta \bigr]^{\lambda - 1} $$ for \(0 < x < 1\).
The EKw distribution is a special case of the five-parameter
Generalized Kumaraswamy (GKw) distribution (dgkw) obtained
by setting the parameters \(\gamma = 1\) and \(\delta = 0\).
When \(\lambda = 1\), the EKw distribution reduces to the standard
Kumaraswamy distribution.
References
Nadarajah, S., Cordeiro, G. M., & Ortega, E. M. (2012). The exponentiated Kumaraswamy distribution. Journal of the Franklin Institute, 349(3),
Cordeiro, G. M., & de Castro, M. (2011). A new family of generalized distributions. Journal of Statistical Computation and Simulation, 81(7), 883-898. doi:10.1080/00949650903530745
Kumaraswamy, P. (1980). A generalized probability density function for double-bounded random processes. Journal of Hydrology, 46(1-2), 79-88. doi:10.1016/0022-1694(80)90036-0
Examples
x <- c(0.1, 0.3, 0.5, 0.7, 0.9)
dekw(x, alpha = 2, beta = 3, lambda = 1.2)
#> [1] 0.3492666 1.3516831 1.8148025 1.2741180 0.2336062
dekw(x, alpha = 2, beta = 3, lambda = 1.2, log = TRUE)
#> [1] -1.0519197 0.3013506 0.5959767 0.2422542 -1.4541184
## EKw is GKw with gamma = 1, delta = 0
all.equal(dekw(x, 2, 3, 1.2), dgkw(x, 2, 3, gamma = 1, delta = 0, lambda = 1.2))
#> [1] TRUE
## The density integrates to one
integrate(dekw, 0, 1, alpha = 2, beta = 3, lambda = 1.2, rel.tol = 1e-10)
#> 1 with absolute error < 2.6e-13
curve(dekw(x, alpha = 2, beta = 3, lambda = 1.2), from = 0, to = 1, ylab = "density")