Commit 780d502
committed
PR #457 R3 polish: assert R→Python U-bucket fold-back on always-treated
R3 verdict was Looks good with 1 P3 informational item. The per-component
parity test skips the `always_treated_remapped` fixture (R/Python decompose
the U bucket differently by convention), and the REGISTRY note documents
that aggregating R's `Later vs Always Treated` + `Treated vs Untreated`
rows by treated cohort should match Python's single `treated_vs_never`
component for that cohort. The reviewer flagged that the documented
structural claim was not directly asserted in tests — a cohort-level
regression in the fold-back could slip through under overall TWFE parity.
Per memory `feedback_test_coverage_gap_treat_as_actionable`, the
"test exists but doesn't directly exercise the documented surface"
P3 is actionable. Added `test_always_treated_remapped_fold_back_matches_r`
to `TestBaconParityR`: for each treated cohort in the remap fixture,
aggregate R's `Later vs Always Treated` + `Treated vs Untreated` rows
by combined weight and weight-averaged estimate, then assert both
match Python's `treated_vs_never` component for that cohort at
atol=1e-6. Currently passes — confirms the documented structural
fold-back is exact at numerical precision.
Tests: 34/34 pass in test_methodology_bacon.py (was 33; +1 new
regression).1 parent 86facdd commit 780d502
1 file changed
Lines changed: 68 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
468 | 536 | | |
469 | 537 | | |
470 | 538 | | |
| |||
0 commit comments