pqc.utils.stats

Provide small statistical utilities without SciPy.

These helpers implement small, reusable statistical transforms used by the detectors. They intentionally avoid SciPy to keep dependencies minimal.

Functions

bh_fdr(pvals, q)

Apply Benjamini–Hochberg FDR and return discovery mask.

chi2_sf_approx(chi2, dof)

Approximate chi-square survival function using Wilson-Hilferty transform.

norm_abs_sf(x)

Return survival probabilities for |Z| where Z ~ N(0,1).

robust_scale_mad(x)

Estimate scale using the median absolute deviation (MAD).