Commit efb5252
Address PR #364 AI review R5: placebo_event_study NaN-on-invalid parity
P1: the NaN-on-invalid-bootstrap pattern was applied to overall /
joiners / leavers / event_study_effects / path_effects, but the
parallel dynamic-placebo propagation block at
chaisemartin_dhaultfoeuille.py:3050 kept the pre-fix pattern
(`if np.isfinite(bs_se): overwrite else leave analytical intact`).
Dynamic placebo rows surface on `results.placebo_event_study` and in
`results.to_dataframe(level="event_study")` negative-horizon rows; a
non-finite placebo bootstrap SE would silently leave analytical
`se / t_stat / p_value / conf_int` in place, mixing bootstrap- and
analytical-contract semantics in the same rendered output.
Fix: add the `else -> NaN tuple` branch to the placebo_event_study
propagation block, mirroring the five other surfaces above.
Regression test
`test_nan_contract_extends_to_placebo_event_study_horizons` fits
`n_bootstrap=1` on a T=5 panel with placebos enabled and asserts that
every `placebo_event_study[-lag]` entry and every negative-horizon
row in `to_dataframe(level="event_study")` has NaN `se / t_stat /
p_value / conf_int_{lower,upper}`.
Full dCDH regression: 215 pass. TestByPathBootstrap: 15 pass under
-m slow.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 62578ac commit efb5252
2 files changed
Lines changed: 100 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3034 | 3034 | | |
3035 | 3035 | | |
3036 | 3036 | | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
| 3041 | + | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
| 3048 | + | |
| 3049 | + | |
3037 | 3050 | | |
3038 | | - | |
3039 | 3051 | | |
3040 | 3052 | | |
3041 | 3053 | | |
| |||
3049 | 3061 | | |
3050 | 3062 | | |
3051 | 3063 | | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
| 3068 | + | |
| 3069 | + | |
| 3070 | + | |
3052 | 3071 | | |
3053 | 3072 | | |
3054 | 3073 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4593 | 4593 | | |
4594 | 4594 | | |
4595 | 4595 | | |
| 4596 | + | |
| 4597 | + | |
| 4598 | + | |
| 4599 | + | |
| 4600 | + | |
| 4601 | + | |
| 4602 | + | |
| 4603 | + | |
| 4604 | + | |
| 4605 | + | |
| 4606 | + | |
| 4607 | + | |
| 4608 | + | |
| 4609 | + | |
| 4610 | + | |
| 4611 | + | |
| 4612 | + | |
| 4613 | + | |
| 4614 | + | |
| 4615 | + | |
| 4616 | + | |
| 4617 | + | |
| 4618 | + | |
| 4619 | + | |
| 4620 | + | |
| 4621 | + | |
| 4622 | + | |
| 4623 | + | |
| 4624 | + | |
| 4625 | + | |
| 4626 | + | |
| 4627 | + | |
| 4628 | + | |
| 4629 | + | |
| 4630 | + | |
| 4631 | + | |
| 4632 | + | |
| 4633 | + | |
| 4634 | + | |
| 4635 | + | |
| 4636 | + | |
| 4637 | + | |
| 4638 | + | |
| 4639 | + | |
| 4640 | + | |
| 4641 | + | |
| 4642 | + | |
| 4643 | + | |
| 4644 | + | |
| 4645 | + | |
| 4646 | + | |
| 4647 | + | |
| 4648 | + | |
| 4649 | + | |
| 4650 | + | |
| 4651 | + | |
| 4652 | + | |
| 4653 | + | |
| 4654 | + | |
| 4655 | + | |
| 4656 | + | |
| 4657 | + | |
| 4658 | + | |
| 4659 | + | |
| 4660 | + | |
| 4661 | + | |
| 4662 | + | |
| 4663 | + | |
| 4664 | + | |
| 4665 | + | |
| 4666 | + | |
| 4667 | + | |
| 4668 | + | |
| 4669 | + | |
| 4670 | + | |
| 4671 | + | |
| 4672 | + | |
| 4673 | + | |
| 4674 | + | |
| 4675 | + | |
4596 | 4676 | | |
4597 | 4677 | | |
4598 | 4678 | | |
| |||
0 commit comments