Skip to contents

Computes \(P(w_1 \le x \mid a, b)\) using the closed-form expression derived by marginalizing over \(\alpha \sim Gamma(a, b)\).

Usage

cdf_w1(x, a, b)

Arguments

x

Numeric vector. Values outside the unit interval are allowed but are mapped to the boundary values of the CDF (0 for \(x \le 0\), 1 for \(x \ge 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 CDF values F(x | a, b) with same length as x.

Details

The unconditional CDF is given by: $$F_{w_1}(x | a, b) = 1 - \left(\frac{b}{b - \log(1-x)}\right)^a$$

The implementation uses log1p and expm1 for numerical stability, particularly when the CDF is close to 0 (small x).

Interpretation

The weight \(w_1\) is in GEM (size-biased) order, not ranked by size. It represents the asymptotic cluster share of a randomly chosen unit, not the largest cluster proportion. See Lee (2026, Section 4) for details.

References

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

Vicentini, C. and Jermyn, I. H. (2025). Prior selection for the precision parameter of Dirichlet Process Mixtures. arXiv:2502.00864.

Examples

# P(w1 <= 0.3) under standard prior
cdf_w1(0.3, a = 2, b = 1)
#> [1] 0.4566891

# Vectorized computation
cdf_w1(c(0.1, 0.3, 0.5, 0.7), a = 1.6, b = 1.22)
#> [1] 0.1241267 0.3365805 0.5131689 0.6666263