Commit d8a7353
Address PR #370 R10 review (1 P1 + 1 P3)
R10 P1 (Methodology) -- Stute survey bootstrap was silently miscalibrated
on stratified designs. The HAD sup-t bootstrap (had.py:2120+) applies a
within-stratum demean + sqrt(n_h/(n_h-1)) small-sample correction AFTER
generate_survey_multiplier_weights_batch returns, to make the bootstrap
variance match the Binder-TSL stratified target. The same correction
has NOT been derived for the Stute CvM functional, so applying the
helper's raw multipliers directly to residual perturbations on stratified
designs left the bootstrap p-value silently miscalibrated.
Per the reviewer's offered "narrow support" path: Phase 4.5 C now
explicitly rejects stratified designs on the Stute family with
NotImplementedError. Pweight-only, PSU-only, and FPC-only designs
remain supported (the helper's output is appropriately scaled for those
without further correction). Stratified is a follow-up after the
matching Stute-CvM stratified-correction derivation lands.
Mirrors the lonely_psu='adjust' rejection pattern (R5 P1) — both are
methodology-gap-driven explicit NotImplementedErrors with documented
follow-up. The strata guard supersedes the lonely_psu='adjust'
singleton-strata guard for any stratified design (the latter is now
defense-in-depth for the unstratified residual case).
R10 P3 -- Added "stratified-design rejection" entry to REGISTRY's
Note (Phase 4.5 C). Also updated CHANGELOG to narrow the documented
survey contract.
Tests updated:
- test_stute_test_lonely_psu_adjust_singletons_raises ->
test_stute_test_stratified_design_raises (the strata guard fires
first; the test is still meaningful but on a strata key match).
- Same renaming for stute_joint_pretest variant.
- test_stute_test_lonely_psu_remove_singletons_returns_nan REMOVED
(singleton strata under lonely_psu='remove' now hits the strata
guard instead of the df_survey<=0 guard).
- test_joint_homogeneity_test_psu_strata_survey_smoke ->
test_joint_homogeneity_test_psu_only_survey_smoke (positive coverage
on PSU-only design) + new test_joint_homogeneity_test_stratified_raises.
- test_workflow_event_study_psu_strata_survey_smoke ->
test_workflow_event_study_psu_only_survey_smoke.
- test_workflow_event_study_survey_pass_does_not_say_inconclusive
switched from strata to PSU-only.
191 pretest tests pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 856e342 commit d8a7353
4 files changed
Lines changed: 95 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1722 | 1722 | | |
1723 | 1723 | | |
1724 | 1724 | | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
1725 | 1751 | | |
1726 | | - | |
1727 | | - | |
1728 | | - | |
1729 | | - | |
1730 | | - | |
1731 | | - | |
1732 | | - | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
1733 | 1755 | | |
1734 | 1756 | | |
1735 | 1757 | | |
| |||
2914 | 2936 | | |
2915 | 2937 | | |
2916 | 2938 | | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
2917 | 2955 | | |
2918 | | - | |
2919 | | - | |
| 2956 | + | |
| 2957 | + | |
2920 | 2958 | | |
2921 | 2959 | | |
2922 | 2960 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2444 | 2444 | | |
2445 | 2445 | | |
2446 | 2446 | | |
| 2447 | + | |
2447 | 2448 | | |
2448 | 2449 | | |
2449 | 2450 | | |
| |||
0 commit comments