Commit 262fc61
Round-5 CI P0: extend sentinel-mass guard to analytical TSL path
Addresses the P0 escalation: recommending `n_bootstrap=0` as a
workaround for terminal missingness + within-group-varying PSU was
incorrect — the analytical TSL path uses the SAME cell-period
allocator and has the same silent mass-drop bug.
**Analytical guard parity.** `_survey_se_from_group_if` now computes
`W_cell` (per-(g,t) weight totals) and, before the cell-to-obs
expansion, checks whether any cell has `W_cell == 0` while the
corresponding cohort-recentered IF mass is non-zero. If so, raises
a targeted `ValueError` mirroring the bootstrap-side
`_unroll_target_to_cells` guard. The message text is aligned
across the two paths (same "no positive-weight observations"
phrasing) so the regression test matches both.
**Docs cleanup.** Removed the "use n_bootstrap=0 as workaround"
language from REGISTRY, CHANGELOG, and the fit() docstring. Replaced
with the correct workaround: pre-process the panel (drop late-exit
groups / trim to a balanced sub-panel), or use an explicit
`psu=<group_col>` so the dispatcher routes through the legacy
group-level path (which does not use the cell-period allocator and
is not affected by the mass-leak).
**Regression test update.** The end-to-end fit() regression now
asserts `ValueError` on BOTH `n_bootstrap=0` and `n_bootstrap > 0`
under the terminally-missing + within-group-varying PSU fixture.
This is technically a behavior change for panels previously covered
silently by PR #323's cell-period analytical allocator — those
panels used to produce finite (but silently mass-dropped) SEs and
now raise. The change closes a real silent-correctness bug; the
analytical path never had a principled treatment for the leaked
mass in the first place.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent def6503 commit 262fc61
4 files changed
Lines changed: 71 additions & 28 deletions
File tree
- diff_diff
- docs/methodology
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
667 | 667 | | |
668 | 668 | | |
669 | 669 | | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
677 | 682 | | |
678 | 683 | | |
679 | 684 | | |
| |||
5885 | 5890 | | |
5886 | 5891 | | |
5887 | 5892 | | |
| 5893 | + | |
| 5894 | + | |
| 5895 | + | |
| 5896 | + | |
| 5897 | + | |
| 5898 | + | |
| 5899 | + | |
| 5900 | + | |
| 5901 | + | |
| 5902 | + | |
| 5903 | + | |
| 5904 | + | |
| 5905 | + | |
| 5906 | + | |
| 5907 | + | |
| 5908 | + | |
| 5909 | + | |
| 5910 | + | |
| 5911 | + | |
| 5912 | + | |
| 5913 | + | |
| 5914 | + | |
| 5915 | + | |
| 5916 | + | |
| 5917 | + | |
| 5918 | + | |
| 5919 | + | |
| 5920 | + | |
| 5921 | + | |
| 5922 | + | |
| 5923 | + | |
5888 | 5924 | | |
5889 | 5925 | | |
5890 | 5926 | | |
| |||
0 commit comments