Computes the \(p\)-th quantile of the marginal distribution of \(K_J\).
Value
Integer vector of quantiles (same length as p).
Each element is the smallest \(k\) such that \(P(K_J \leq k) \geq p\).
Details
This is the standard quantile definition for discrete distributions: \(Q(p) = \min\{k : F(k) \geq p\}\).
The function is vectorized over p, allowing efficient computation
of multiple quantiles in a single call.
Examples
logS <- compute_log_stirling(50)
# Single quantile (median)
quantile_K_marginal(0.5, 50, 1.5, 0.5, logS)
#> [1] 8
# Multiple quantiles at once
quantile_K_marginal(c(0.1, 0.25, 0.5, 0.75, 0.9), 50, 1.5, 0.5, logS)
#> [1] 3 5 8 11 15
# Interquartile range
qs <- quantile_K_marginal(c(0.25, 0.75), 50, 1.5, 0.5, logS)
diff(qs)
#> [1] 6