Commit 028e7e1
Address PR #378 R0 P1: multi-baseline R-deviation warning + REGISTRY note
CI reviewer flagged that the new by_path + controls combination
silently produces point-estimate divergence from R on multi-baseline
switcher panels (R re-runs per-baseline residualization on each
path's restricted subsample; we residualize once globally). The
parity test docstring documented the deviation but REGISTRY.md and
the runtime did not.
Fixes:
- Emit UserWarning in fit() when by_path + controls is used on a
panel with multiple switcher D_{g,1} values (chaisemartin_dhaultfoeuille.py
inside the controls residualization block, after _compute_group_switch_metadata)
- Update the by_path docstring with an explicit "Deviation from R on
multi-baseline switcher panels" paragraph
- Update REGISTRY.md "Per-path covariate residualization (DID^X)"
paragraph to document the point-estimate deviation alongside the
existing SE deviation
- Update CHANGELOG entry to call out the multi-baseline deviation
- Update R-generator scenario 16 comment to correctly describe R's
per-path re-residualization (the prior comment misstated R's
behavior as "residualize once globally")
- Update parity test class docstring to be precise about R's
per-path call site (R/R/did_multiplegt_dyn.R lines 393-411)
- Add two regression tests:
* test_multi_baseline_panel_emits_r_deviation_warning — joiner +
leaver + always-treated + never-treated panel triggers the warning
* test_single_baseline_panel_does_not_emit_r_deviation_warning —
standard 3-path joiners-only fixture does NOT trigger the warning
The single-baseline R-parity scenario (multi_path_reversible_by_path_controls)
remains exact-match (rtol ~1e-11) because all switchers in the DGP
share D_{g,1}=0 and R's per-path control pool reduces to the global
control pool we use.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 963a409 commit 028e7e1
6 files changed
Lines changed: 195 additions & 30 deletions
File tree
- benchmarks/R
- 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 | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
716 | 725 | | |
717 | 726 | | |
718 | 727 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
422 | | - | |
423 | | - | |
424 | | - | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
425 | 437 | | |
426 | 438 | | |
427 | 439 | | |
| |||
1478 | 1490 | | |
1479 | 1491 | | |
1480 | 1492 | | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
1481 | 1526 | | |
1482 | 1527 | | |
1483 | 1528 | | |
| |||
0 commit comments