Add calibrated global min-PTE threshold for many null tests - #370
Merged
Merged
Conversation
calibrate_min_pte takes a (n_mocks, n_stats) PTE matrix from noise-only realisations and returns the alpha-quantile of the per-mock minimum PTE (with a distribution-free order-statistic interval), the implied effective number of independent tests k_eff from 1 - (1 - t)^k = alpha, and a global_pte method giving the data's global p-value with a Wilson interval. Statistic-agnostic: columns can be any statistics, bin pairs or scale cuts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem. A null test that runs many correlated statistics (E/B estimators, bin pairs, scale cuts) cannot use a fixed per-test PTE cut. The global false-positive rate is unknown because it depends on how the statistics correlate and how well each PTE is calibrated.
Change. Adds
calibrate_min_ptetosp_validation.statistics. It takes an(n_mocks, n_stats)PTE matrix from noise-only realisations and returns:k_eff, from1 − (1 − t)^k = α;.global_pte(data_ptes): the fraction of mocks whose minimum PTE is ≤ the data's, with a Wilson interval.It works with any statistic and any number of tomographic bins. An optional two-sided mode uses
2 min(p, 1−p). It needs only numpy and scipy.Verification. Five new tests in
src/sp_validation/tests/test_statistics.py:k_eff = k;k_eff = 1;🤖 Generated with Claude Code