Commit 41d54b9
Address PR #393 R5 P1: F_g=3 boundary divergence warning + narrowed contract
CI reviewer flagged that the by_path + trends_linear public contract
overstated R parity. The shipped contract said "single-baseline panels"
broadly, but the parity scenario was restricted to F_g >= 4 because
F_g=3 switchers trigger a 30%+ point-estimate divergence between
Python's global-then-disaggregate architecture and R's per-path full-
pipeline call (only 1 valid pre-window Z value remains after
first-differencing + time==1 filter, triggering different control-
eligibility treatment).
Fix: add a targeted UserWarning fired at fit-time when by_path +
trends_linear is set AND any switcher has F_g==3 (predicate:
first_switch_idx_arr == 2). Mirrors the existing F_g < 3 exclusion
warning but for the boundary case rather than the exclusion case.
Documentation: docstring at the by_path paragraph now narrows the
parity claim to "single-baseline panels with sufficient pre-window
depth (F_g >= 4 for every selected-path switcher)" and explicitly
documents the F_g=3 boundary regime + warning. REGISTRY adds the
same narrowing + warning text to the per-path linear-trends Note.
CHANGELOG adds the divergence note to the Unreleased entry.
Regression test test_F_g_three_boundary_case_emits_warning added in
TestByPathTrendsLinear: 4 F_g=3 switchers + 4 F_g=4 switchers in a
single-baseline panel, asserts the new warning fires (named
"by_path + trends_linear" + "F_g=3").
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent ad8f6be commit 41d54b9
4 files changed
Lines changed: 114 additions & 6 deletions
File tree
- diff_diff
- docs/methodology
- tests
| 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 | |
|---|---|---|---|
| |||
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
465 | 476 | | |
466 | 477 | | |
467 | 478 | | |
| |||
1689 | 1700 | | |
1690 | 1701 | | |
1691 | 1702 | | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
1692 | 1741 | | |
1693 | 1742 | | |
1694 | 1743 | | |
| |||
0 commit comments