multiple-testing-correction
Skill3 starsChanged 12 days agoApache-2.0View on GitHub
Correct for multiple hypothesis testing before calling any factor, sub-period, or parameter-sweep result significant — and check whether a claimed set of independent signals or bets is actually a smaller number of correlated ones wearing a disguise. Trigger for "测了8个因子哪个显著", "筛选因子", "factor screen", "parameter sweep", "which of these signals is real", "p-hacking", "data snooping", "统计显著性", "breadth illusion", "effective breadth", "多重检验", "这些信号真的独立吗", "multiple testing correction", or whenever the user has run more than one significance test in a batch and is about to act on the ones that passed. Also trigger when a Sharpe/IR target is being justified by citing a number of supposedly independent bets, signals, or symbols — that count needs a correlation check before it goes into any Information Ratio math. Pair with backtest-validation: that skill’s Deflated Sharpe Ratio is this same correction applied to the single case of picking the best strategy variant out of N backtested; this skill is the general case for any batch of hypothesis tests, plus the separate breadth-illusion check neither skill otherwise covers. Do NOT trigger for a single, pre-specified test with no batch and no breadth claim — correcting one test against itself is a no-op.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- artheras/skillsword for word, first seen Oct 31, 2026
Other versions1 project uses a version of this.
Word for word · 1
- artheras/skills★ 3100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository25 other files it gives its agents.
- ai-generated-ui-craftSkill
- backtest-validationSkill
- carrier-scorecardSkill
- compliance-audit-trailSkill
- conversational-ui-restraintSkill
- equity-research-reportSkill
- execution-positionSkill
- factor-researchSkill
- gamma-exposureSkill
- industry-design-directionSkill
- inventory-policySkill
- minimal-editorial-exportsSkill
- minimal-editorial-posterSkill
- operator-revenue-integritySkill
- point-in-time-researchSkill
- portfolio-optimizationSkill
- risk-assessmentSkill
- short-form-video-editingSkill
- stablecoin-settlement-auditSkill
- strategy-generationSkill
- terminal-software-designSkill
- trading-ui-patternsSkill
- ui-asset-sourcingSkill
- ui-design-systemSkill
- your-skill-nameSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Every hypothesis test carries a false-positive rate at its stated confidence level — run enough of them and false positives arrive on …
- Very specific: line 66
If a breadth/IR claim is also being made, add --ic <avg information coefficient> --n-bets <N> --avg-corr <rho> to the same call (or call it …
- Very specific: line 81
If breadth was checked and flagged breadth_illusion, report the *effective*-breadth Information Ratio, not the nominal one, in any …
- Distinctive: line 89
No citing a Fundamental-Law IR without disclosing the correlation assumption behind the breadth number that produced it.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Multiple Testing Correction
Every hypothesis test carries a false-positive rate at its stated confidence
level — run enough of them and false positives arrive on schedule, not by bad
luck. Screen 30 factors at the conventional |t| >= 2 (~95% single-test
confidence) and roughly 1-2 will look "significant" even if every one of them
is pure noise, purely from running 30 tests. Nobody needs to be dishonest for
this to happen; the batch size does it on its own. The same arithmetic error
shows up one level up: claim N "independent" signals or symbols and the
Fundamental Law of Active Management (Grinold, 1989) says skill scales with
sqrt(N) — but if those N things actually share high pairwise correlation
(same model family, same data source, same market regime), the effective
N is far smaller, and the implied Information Ratio was never really there.
The two failure modes this skill catches
- Uncorrected batch significance. A naive per-test threshold (
|t| >= 2,p < 0.05) does not control the batch's error rate. Bonferroni controls the probability of any false positive in the batch (conservative); Benjamini-Hochberg (BH/FDR) controls the expected proportion of false positives among what gets called significant (the more common choice in modern quant research — the same logic behind the Deflated Sharpe Ratio). - Breadth illusion. A count of "independent" bets that are actually
correlated inflates the Fundamental Law's IR estimate.
Nnominal bets at average pairwise correlationrhobehave likeN / (1 + (N-1)*rho)effective bets — atrho=0.7andN=20, that's ~1.4 effective bets, not 20.
Workflow
- Collect every test actually run in the batch — not just the ones that
looked interesting. The batch size (
n) is the correction; leaving out the tests that failed and only reporting the survivors defeats the whole point, the same way undisclosed trials defeat the Deflated Sharpe Ratio inbacktest-validation. - For each test, get the t-statistic and the sample size (or degrees of freedom) that produced it.
- Run the gate:
python scripts/multiplicity_gate.py --tests tests.json --alpha 0.05wheretests.jsonis{"name": {"t_stat": float, "n_periods": int}, ...}— one entry per hypothesis actually tested. With no data at hand, show the mechanics with--demo. - If a breadth/IR claim is also being made, add
--ic <avg information coefficient> --n-bets <N> --avg-corr <rho>to the same call (or call it standalone with just those three flags) to check the Fundamental-Law breadth illusion independently of the correction above. - Report the BH-FDR survivor set, not the naive-significant set, as "what passed." Bonferroni's stricter survivor set is worth stating alongside it when the user needs the conservative answer (e.g. before capital deployment). Never report a factor as significant because it cleared the naive threshold alone.
- Completion gate: a factor/variant is only "significant" in the final
writeup if it is in the BH-FDR (or stricter) survivor set. On a
significance_evaporatesFAIL — naive flagged some, corrected keeps none — the correct deliverable is "this batch shows no evidence of a real effect at this batch size," which is a valid, useful research result, not a failure to find something. - If breadth was checked and flagged
breadth_illusion, report the effective-breadth Information Ratio, not the nominal one, in any forward-looking claim.
Guardrails
- No "N of M factors were significant" claim using the naive per-test threshold when M > 1. Correct first.
- No citing a Fundamental-Law IR without disclosing the correlation assumption behind the breadth number that produced it.
- Both checks require honest inputs the skill cannot verify on its own: the full test batch (not a cherry-picked subset) and a real, not assumed-away, correlation estimate for the breadth check. Say so when either is unavailable rather than defaulting silently to "independent."
- Missing scipy degrades to a normal approximation for the p-value (accurate
once
n_periodsis reasonably large) rather than failing — but the CLI says so; don't silently treat it as exact for small samples.
Bundled resources
scripts/multiplicity_gate.py— Bonferroni + BH-FDR correction and the breadth-illusion check, in one gate with a PASS/WARN/FAIL verdict.--demoruns both scenarios with synthetic data and no dependencies beyond numpy/scipy (skips cleanly if absent).references/methodology.md— the exact formulas, when to prefer Bonferroni over BH-FDR, and how this relates tobacktest-validation's Deflated Sharpe Ratio andrisk-assessment's effective-N diversification check.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

