Skip to contents

Density, distribution function, quantile function, hazard function, survival function and random generation for the four-parameter Beta-Danish distribution.

Usage

dbetadanish(x, a, b, c, k, log = FALSE)

pbetadanish(q, a, b, c, k, lower.tail = TRUE, log.p = FALSE)

qbetadanish(p, a, b, c, k, lower.tail = TRUE, log.p = FALSE)

rbetadanish(n, a, b, c, k)

sbetadanish(x, a, b, c, k, log = FALSE)

hbetadanish(x, a, b, c, k, log = FALSE)

Arguments

x, q

Vector of quantiles (time points).

a

Shape parameter (beta generator). Set `a = 1` for the three-parameter Exponentiated Danish (ED) submodel.

b

Shape parameter (beta generator). Governs the upper tail: the survival function is regularly varying with index `-b`.

c

Shape parameter (baseline shape).

k

Scale parameter (baseline scale).

log, log.p

Logical; if `TRUE`, densities/probabilities are returned on the log scale.

lower.tail

Logical; if `TRUE` (default) probabilities are \(P[X \le x]\), otherwise \(P[X > x]\).

p

Vector of probabilities.

n

Number of observations to generate.

Value

`dbetadanish` gives the density, `pbetadanish` the distribution function, `qbetadanish` the quantile function, `sbetadanish` the survival function, `hbetadanish` the hazard function, and `rbetadanish` generates random deviates. Length is the maximum of the lengths of the numeric arguments.

Details

With baseline \(G(t) = \{kt/(1+kt)\}^{c}\), the Beta-Danish CDF is the regularised incomplete beta function \(F(t) = I_{G(t)}(a, b)\) and the density is $$f(t) = \frac{c\,k^{ca}\,t^{ca-1}}{B(a,b)\,(1+kt)^{ca+1}} \bigl\{1 - G(t)\bigr\}^{b-1}.$$ The family accommodates decreasing, increasing, unimodal and bathtub-shaped hazard rates.

Numerical notes

All three of the density, distribution and quantile functions are evaluated so as to retain full relative precision in the upper tail, which is where this family is distinctive and where naive implementations fail:

* \(\log\{1 - G(t)\}\) is formed as `log(-expm1(c * -log1p(1/(k*t))))`. Writing \(\log G\) as \(-c\,\log(1 + 1/kt)\) avoids the cancellation in \(\log(kt) - \log(1+kt)\), which loses all significant digits once \(kt \gtrsim 10^{15}\). * The survival function uses the beta mirror identity \(1 - I_{y}(a,b) = I_{1-y}(b,a)\), so no probability near one is ever subtracted from one. * `qbetadanish` obtains \(1 - u\) directly via \(1 - q\beta(p; a, b) = q\beta(p; b, a)\) with the tail flag reversed, so `1 - p` is never formed.

Parameters recycle element-wise against `x`, `q` or `p` following the usual convention for R distribution functions, so a per-observation scale (as produced by an AFT link) may be supplied directly.

As \(t \to \infty\), \(S(t) \propto t^{-b}\); consequently \(E(X^{r})\) is finite if and only if \(b > r\).

References

Ahmad, B., & Danish, M. Y. (2025). Development and characterization of a flexible three-parameter lifetime distribution: theoretical properties and real-world applications. *Journal of Applied Mathematics, Statistics and Informatics*, 21(1). doi:10.2478/jamsi-2025-0010

Examples

dbetadanish(x = 2, a = 1.5, b = 2, c = 3, k = 0.5)
#> [1] 0.1087591
pbetadanish(q = 2, a = 1.5, b = 2, c = 3, k = 0.5)
#> [1] 0.102199
qbetadanish(p = 0.5, a = 1.5, b = 2, c = 3, k = 0.5)
#> [1] 5.845611
hbetadanish(x = 2, a = 1.5, b = 2, c = 3, k = 0.5)
#> [1] 0.1211394
rbetadanish(n = 10, a = 1.5, b = 2, c = 3, k = 0.5)
#>  [1]  1.7965600 14.8497416  7.3683700  2.4826859  0.7584669  5.4241298
#>  [7]  5.8166488  3.6178282 10.4312825 11.8107549

# Per-observation scale, as used by the AFT link
dbetadanish(c(1, 2, 3), a = 1, b = 2, c = 1.5, k = c(0.5, 1, 2))
#> [1] 0.31082611 0.12401738 0.02340321

# The survival tail is regularly varying with index -b
round(log(sbetadanish(c(1e10, 1e12), 1.5, 3, 2, 1)), 4)
#> [1] -66.2154 -80.0309