Commit 2431cce
Address PR #363 R7 review (1 P0)
R7 P0 (sup-t under-scaling on weights= shortcut): the per-unit IF
returned by _fit_continuous / _fit_mass_point_2sls is HC1-scaled per
the PR #359 convention — compute_survey_if_variance(psi,
trivial_resolved) ≈ V_HC1. Routing the weights= shortcut through the
unit-level ``resolved_survey=None`` branch of
_sup_t_multiplier_bootstrap normalized against raw sum(psi²) =
((n-1)/n) · V_HC1, producing silently too-narrow simultaneous bands.
Fix: when the weighted event-study + cband=True path runs, always
route the sup-t bootstrap through a ResolvedSurveyDesign. On the
weights= shortcut (no user-supplied survey), construct a synthetic
trivial resolved (pweight, no strata/psu/fpc, lonely_psu='remove')
so the centered + sqrt(n/(n-1))-corrected survey-aware branch fires.
The no-strata/no-PSU path inside that branch falls through to the
"single implicit stratum — demean across all PSUs, scale by
sqrt(n_psu/(n_psu-1))" block, which gives Var_xi(xi @ Psi_psu) ≈
V_HC1 as the IF scale convention requires.
Net effect: weights= shortcut and survey=SurveyDesign(weights=...)
now target the SAME variance family in the bootstrap (~atol=0.05
between the two quantiles at matching seeds, bounded by the
bc_fit.se_robust vs Binder-TSL per-horizon SE convergence
tolerance from PR #359). Previously the shortcut was under-scaled
by sqrt(n/(n-1)) relative to the analytical HC1 target.
Regression tests (+2):
- test_weights_shortcut_mass_point_h1_cband_matches_normal: helper-
level H=1 lock with mass-point HC1-scaled IF + synthetic trivial
resolved. q → Phi^-1(0.975) ≈ 1.96 at atol=0.15 (MC noise at
B=5000). The pre-fix under-scaling would have produced q ≈ 1.94
(systematic drift outside MC noise).
- test_weights_shortcut_cband_matches_trivial_survey: weights=
shortcut and survey=SurveyDesign(weights='w') event-study cband
quantiles agree within atol=0.05 on the same DGP / seed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 2c325f3 commit 2431cce
2 files changed
Lines changed: 157 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4261 | 4261 | | |
4262 | 4262 | | |
4263 | 4263 | | |
| 4264 | + | |
| 4265 | + | |
| 4266 | + | |
| 4267 | + | |
| 4268 | + | |
| 4269 | + | |
| 4270 | + | |
| 4271 | + | |
| 4272 | + | |
| 4273 | + | |
| 4274 | + | |
| 4275 | + | |
| 4276 | + | |
| 4277 | + | |
| 4278 | + | |
| 4279 | + | |
| 4280 | + | |
| 4281 | + | |
| 4282 | + | |
| 4283 | + | |
| 4284 | + | |
| 4285 | + | |
| 4286 | + | |
| 4287 | + | |
| 4288 | + | |
| 4289 | + | |
| 4290 | + | |
| 4291 | + | |
| 4292 | + | |
| 4293 | + | |
4264 | 4294 | | |
4265 | 4295 | | |
4266 | 4296 | | |
4267 | 4297 | | |
4268 | | - | |
| 4298 | + | |
4269 | 4299 | | |
4270 | 4300 | | |
4271 | 4301 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5453 | 5453 | | |
5454 | 5454 | | |
5455 | 5455 | | |
| 5456 | + | |
| 5457 | + | |
| 5458 | + | |
| 5459 | + | |
| 5460 | + | |
| 5461 | + | |
| 5462 | + | |
| 5463 | + | |
| 5464 | + | |
| 5465 | + | |
| 5466 | + | |
| 5467 | + | |
| 5468 | + | |
| 5469 | + | |
| 5470 | + | |
| 5471 | + | |
| 5472 | + | |
| 5473 | + | |
| 5474 | + | |
| 5475 | + | |
| 5476 | + | |
| 5477 | + | |
| 5478 | + | |
| 5479 | + | |
| 5480 | + | |
| 5481 | + | |
| 5482 | + | |
| 5483 | + | |
| 5484 | + | |
| 5485 | + | |
| 5486 | + | |
| 5487 | + | |
| 5488 | + | |
| 5489 | + | |
| 5490 | + | |
| 5491 | + | |
| 5492 | + | |
| 5493 | + | |
| 5494 | + | |
| 5495 | + | |
| 5496 | + | |
| 5497 | + | |
| 5498 | + | |
| 5499 | + | |
| 5500 | + | |
| 5501 | + | |
| 5502 | + | |
| 5503 | + | |
| 5504 | + | |
| 5505 | + | |
| 5506 | + | |
| 5507 | + | |
| 5508 | + | |
| 5509 | + | |
| 5510 | + | |
| 5511 | + | |
| 5512 | + | |
| 5513 | + | |
| 5514 | + | |
| 5515 | + | |
| 5516 | + | |
| 5517 | + | |
| 5518 | + | |
| 5519 | + | |
| 5520 | + | |
| 5521 | + | |
| 5522 | + | |
| 5523 | + | |
| 5524 | + | |
| 5525 | + | |
| 5526 | + | |
| 5527 | + | |
| 5528 | + | |
| 5529 | + | |
| 5530 | + | |
| 5531 | + | |
| 5532 | + | |
| 5533 | + | |
| 5534 | + | |
| 5535 | + | |
| 5536 | + | |
| 5537 | + | |
| 5538 | + | |
| 5539 | + | |
| 5540 | + | |
| 5541 | + | |
| 5542 | + | |
| 5543 | + | |
| 5544 | + | |
| 5545 | + | |
| 5546 | + | |
| 5547 | + | |
| 5548 | + | |
| 5549 | + | |
| 5550 | + | |
| 5551 | + | |
| 5552 | + | |
| 5553 | + | |
| 5554 | + | |
| 5555 | + | |
| 5556 | + | |
| 5557 | + | |
| 5558 | + | |
| 5559 | + | |
| 5560 | + | |
| 5561 | + | |
| 5562 | + | |
| 5563 | + | |
| 5564 | + | |
| 5565 | + | |
| 5566 | + | |
| 5567 | + | |
| 5568 | + | |
| 5569 | + | |
| 5570 | + | |
| 5571 | + | |
| 5572 | + | |
| 5573 | + | |
| 5574 | + | |
| 5575 | + | |
| 5576 | + | |
| 5577 | + | |
| 5578 | + | |
| 5579 | + | |
| 5580 | + | |
| 5581 | + | |
5456 | 5582 | | |
5457 | 5583 | | |
5458 | 5584 | | |
| |||
0 commit comments