Skip to main content

Module zscorehyper

Module zscorehyper 

Source
Expand description

Mid-p z-score equivalents of hypergeometric deviates.

Pure-Rust port of limma’s zscoreHyper.R (zscore_hyper): the signed standard-normal deviate matching the mid-p-value of a hypergeometric count. Tail probabilities are accumulated in log space (via logsumexp) so the result stays accurate deep into either tail, as in R’s log.p = TRUE path.

Functions§

zscore_hyper
zscoreHyper(q, m, n, k): z-score equivalent of a hypergeometric deviate q (white balls drawn) for an urn of m white and n black with k draws. Uses the mid-p-value — the full tail plus half the point mass at q — and maps the smaller tail through the normal quantile in log space.