Commit 14891c9
Add per-path joint sup-t bands to ChaisemartinDHaultfoeuille.by_path
When `n_bootstrap > 0` is set with `by_path=k`, per-path joint sup-t
simultaneous confidence bands are now computed across horizons
`1..L_max` within each path. A single shared `(n_bootstrap, n_eligible)`
Hall-Mammen multiplier weight matrix is drawn per path and broadcast
across all valid horizons, producing correlated bootstrap distributions.
The path-specific critical value `c_p = quantile(max_l |t_l|, 1-α)` is
applied per horizon as `cband_conf_int = (eff - c_p·se, eff + c_p·se)`,
and surfaced at top level as `results.path_sup_t_bands[path]`.
Closes Wave 2 #4 of the by_path follow-up sequence (PR #357 foundation,
PR #360 R-parity, PR #364 bootstrap, PR #371 placebos).
Methodology asymmetry vs OVERALL `event_study_sup_t_bands` (intentional,
documented): per-path sup-t draws fresh shared weights AFTER the
per-path SE bootstrap block has populated `path_ses` via independent
per-(path, horizon) draws. Asymptotically equivalent to OVERALL's
self-consistent reuse but NOT bit-identical. Preserves RNG-state
isolation for existing per-path SE seed-reproducibility tests.
Gates mirror OVERALL: a path needs >=2 valid horizons (finite bootstrap
SE > 0) AND >=50% finite sup-t draws to receive a band; otherwise the
path is absent from `path_sup_t_bands` (NaN-on-invalid absent-key
pattern).
Deviation from R: `did_multiplegt_dyn` provides no joint / sup-t bands
at any surface — Python-only methodology extension consistent with the
existing OVERALL sup-t bands. Inherits the cross-path cohort-sharing
SE deviation from R documented for `path_effects` (the bootstrap SE
used in the t-stat denominator carries the same deviation).
Bundled pre-audit fix (sibling-surface check): the existing OVERALL
`sup_t_bands` field's stale "Phase 2 placeholder" docstring updated
to the actual contract description.
Tests: new `TestByPathSupTBands` class with 11 tests covering
none-when-no-bootstrap, none-when-no-by_path, keys-match-path-effects,
band-wider-than-pointwise, crit-finite-and-positive, seed-reproducibility,
single-horizon-path-skip, L_max=1-skip, n_valid_horizons-matches,
absent-path-no-cband-keys, summary-renders. All `@pytest.mark.slow`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8596f51 commit 14891c9
7 files changed
Lines changed: 544 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
434 | 449 | | |
435 | 450 | | |
436 | 451 | | |
| |||
2986 | 3001 | | |
2987 | 3002 | | |
2988 | 3003 | | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
| 3009 | + | |
| 3010 | + | |
| 3011 | + | |
| 3012 | + | |
| 3013 | + | |
| 3014 | + | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
| 3029 | + | |
| 3030 | + | |
2989 | 3031 | | |
2990 | 3032 | | |
2991 | 3033 | | |
| |||
3618 | 3660 | | |
3619 | 3661 | | |
3620 | 3662 | | |
| 3663 | + | |
| 3664 | + | |
| 3665 | + | |
| 3666 | + | |
| 3667 | + | |
| 3668 | + | |
| 3669 | + | |
| 3670 | + | |
| 3671 | + | |
| 3672 | + | |
| 3673 | + | |
| 3674 | + | |
| 3675 | + | |
| 3676 | + | |
| 3677 | + | |
| 3678 | + | |
| 3679 | + | |
| 3680 | + | |
| 3681 | + | |
| 3682 | + | |
| 3683 | + | |
| 3684 | + | |
3621 | 3685 | | |
3622 | 3686 | | |
3623 | 3687 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
781 | 865 | | |
782 | 866 | | |
783 | 867 | | |
| |||
0 commit comments