Skip to contents

Computes the inverse CDF: \(Q(u \mid a, b) = F^{-1}(u)\).

Usage

quantile_w1(u, a, b)

Arguments

u

Numeric vector of probability levels in the unit interval. Values \(u \le 0\) return 0 and \(u \ge 1\) return 1.

a

Numeric; shape parameter of the Gamma prior on \(\alpha\) (a > 0).

b

Numeric; rate parameter of the Gamma prior on \(\alpha\) (b > 0).

Value

Numeric vector of quantile values Q(u | a, b).

Details

The quantile function has the closed form: $$Q_{w_1}(u | a, b) = 1 - \exp\left(b \left[1 - (1-u)^{-1/a}\right]\right)$$

The implementation computes (1-u)^(-1/a) in log space for stability when u is close to 1.

Numerical Note: For small values of a (a < 1) and u close to 1, the quantile approaches 1 very rapidly and may round to 1.0 in double precision.

References

Lee, J. (2026). Design-Conditional Prior Elicitation for Dirichlet Process Mixtures. arXiv preprint arXiv:2602.06301.

Examples

# Median of w1
quantile_w1(0.5, a = 2, b = 1)  # ~0.339
#> [1] 0.3391402

# 90th percentile
quantile_w1(0.9, a = 2, b = 1)  # ~0.732
#> [1] 0.8849373