Commit 5515fbe
Address PR #355 R7 P1 + P3: fit-time positive-mass guard + doc wording fix
R7 P1: the per-draw zero-mass retry in ``_bootstrap_se`` (PR #355 R2 P0)
only covers bootstrap draws, not the fit-time ATT. Survey weights are
non-negative post-resolve() but all-zero mass on either arm is a valid
input that encodes an unidentified target population. Without a fit-
time guard the downstream ``np.average(Y, weights=w_treated)`` and
``omega_eff = unit_weights * w_control`` normalizations would hit 0/0
and silently propagate NaN through the bootstrap / placebo / jackknife
dispatchers. Front-door the case: after ``w_control`` / ``w_treated``
are sourced from the resolved unit-level design, raise ``ValueError``
if either arm's total mass is <= 0. Covers both pweight-only and
strata/PSU/FPC paths. Three regression tests added:
``test_fit_raises_on_zero_total_treated_survey_mass``,
``test_fit_raises_on_zero_total_control_survey_mass``, and
``test_fit_raises_on_zero_treated_mass_under_full_design``.
R7 P3: the SDID row in ``docs/choosing_estimator.rst`` said "pweight
only (placebo / jackknife); full (bootstrap)" in the **Weights** column,
conflating weight-type support (fweight / aweight / pweight) with
design-element support (strata / PSU / FPC). The code still hard-
rejects non-pweight survey designs on every variance method. Narrow
the wording to "pweight only" and leave "Via bootstrap" in the
Strata/PSU/FPC column to describe design-element support.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 6f7eb8e commit 5515fbe
3 files changed
Lines changed: 96 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
459 | 487 | | |
460 | 488 | | |
461 | 489 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
783 | 783 | | |
784 | 784 | | |
785 | 785 | | |
786 | | - | |
| 786 | + | |
787 | 787 | | |
788 | 788 | | |
789 | 789 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
842 | 842 | | |
843 | 843 | | |
844 | 844 | | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
845 | 912 | | |
846 | 913 | | |
847 | 914 | | |
| |||
0 commit comments