Add survey-aware bootstrap for all estimators (Phase 6)#237
Add survey-aware bootstrap for all estimators (Phase 6)#237
Conversation
Implement bootstrap + survey interaction for all 8 bootstrap-using estimators. Two strategies: PSU-level multiplier bootstrap (CS, ImputationDiD, TwoStageDiD, ContinuousDiD, EfficientDiD) and Rao-Wu rescaled bootstrap (SunAbraham, SyntheticDiD, TROP). Expand CS analytical support to full strata/PSU/FPC via compute_survey_if_variance. Add shared infrastructure: generate_survey_multiplier_weights_batch, generate_rao_wu_weights, compute_survey_if_variance, aggregate_to_psu. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
P0: Thread survey weights through bootstrap aggregation/IF paths - CS: use survey_weight_sum for bootstrap re-aggregation weights - ImputationDiD: pass survey_weights_0 to _precompute_bootstrap_psi - TwoStageDiD: add survey weights to _compute_cluster_S_scores P1: Fix CS df_survey inconsistency (use unit-level df everywhere), fix ContinuousDiD event-study bootstrap weights P2: Update REGISTRY.md deferred language, clean TODO.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
P0: Pass survey weights to TwoStageDiD Stage-2 solve_ols calls
P1: ImputationDiD event-study/group bootstrap uses survey-weighted
target weights; SunAbraham collapses to unit-level before Rao-Wu
and stores NaN for failed draws
P2: CS metadata from unit-level resolved survey; registry CS note
updated for consistency
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
P0: SunAbraham pairs bootstrap now passes survey weights through to
_fit_saturated_regression, _compute_iw_effects, _compute_overall_att
P1: ImputationDiD passes both treated (sw_1) and untreated (sw_0)
survey weights to _precompute_bootstrap_psi, fixing array indexing
P1: ContinuousDiD IF scores now include per-unit w_i factor in
sandwich meat (w_i * X_i * u_i), fixing weighted IF consistency
P3: REGISTRY.md CS section updated for consistent survey support docs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
P0: TwoStage solve_ols now passes survey weights for all 3 Stage-2
paths (static, event-study, group)
P0: SunAbraham pairs bootstrap passes resolved_survey=None to avoid
stale design weights overriding bootstrap-resampled weights
P1: CS bootstrap uses fixed cohort masses from precomputed survey
weights (not per-cell survey_weight_sum) for overall and event study
P1: Single-PSU unstratified guard in generate_survey_multiplier_weights_batch
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Reject lonely_psu="adjust" for bootstrap with NotImplementedError - Add FPC validation in multiplier and Rao-Wu bootstrap generators - Gate SyntheticDiD placebo + full survey design (require bootstrap) - Update REGISTRY.md for SyntheticDiD, TROP, and CS survey support - Update TROP fit() docstring for full design support Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Overall Assessment ⛔ Blocker The PR introduces one unmitigated P0 in the shared Rao-Wu bootstrap path and three P1 methodology/documentation issues in the new survey-bootstrap support. The P0 is a silent statistical correctness bug in shared code, so this should not merge as-is. Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Path to Approval
|
Summary
compute_survey_if_variance()generate_survey_multiplier_weights_batch,generate_rao_wu_weights,compute_survey_if_variance,aggregate_to_psulonely_psu="adjust"rejection, FPC validation, single-PSU handling, SyntheticDiD placebo+full-design guardMethodology references (required if estimator / math changes)
m_h = round((1-f_h)*(n_h-1))per Rao-Wu-Yue (1992) Section 3lonely_psu="adjust"rejected for bootstrap paths (analytical path supports it)Validation
tests/test_survey.py,tests/test_survey_phase3.py,tests/test_survey_phase4.py,tests/test_survey_phase5.pySecurity / privacy
Generated with Claude Code