feat: RegressionDiscontinuity - sharp RD estimator with rdrobust 4.0.0 parity (RDD PR-2)#684
Conversation
Overall AssessmentExecutive Summary
MethodologyFinding 1 — P1:
|
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment✅ Looks good — no unmitigated P0/P1 findings found in the re-review scope. Executive Summary
MethodologyFinding 1 — P3 Informational: Documented rdrobust output-binding deviationSeverity: P3 Finding 2 — P3 Informational: Documented v1 RD scope seamsSeverity: P3 Prior P1 check: Code QualityNo blocking findings. Public integer knobs now reject bools via PerformanceNo findings. The implementation remains small weighted least-squares fits plus 1D nearest-neighbor scans; bandwidth selection is the expected dominant cost. MaintainabilityNo findings. The methodology-sensitive choices are heavily documented in code and registry notes, including Q/q score construction and robust/conventional sandwich assembly at Tech DebtFinding 3 — P3 Informational: Deferred RD feature scope is documentedSeverity: P3 SecurityNo findings. Static scan of changed files did not identify secrets or credential material. Documentation / TestsNo blocking findings. The PR adds parity and methodology coverage, including full golden parity at Tests were not executed in this environment because |
Estimation-path port + public estimator + docs sweep (PR-2 of 2). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QGca52n6H8oDDXALjjrsp4
…ols on integer knobs rdrobust.R:365-380 runs the mass-point check in rdrobust() itself, ahead of the manual-vs-data-driven bandwidth split, so the warning must fire on manual-h fits too (verified on installed 4.0.0). fit() now performs the detection and the port's rdbwselect-level warning is suppressed on the estimator path to mirror R's single warning per fit. Integer knobs (p/q/nnmatch/bwcheck) now reject bool (int subclass) inputs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QGca52n6H8oDDXALjjrsp4
…job) The type: ignore[assignment] comments on the beta_p_* dataclass fields are unused under the pinned CI mypy config, which now fails on unused ignores (warn_unused_ignores = true). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QGca52n6H8oDDXALjjrsp4
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment✅ Looks good — no unmitigated P0/P1 findings found in the re-review scope. Executive Summary
MethodologyFinding 1 — P3 Informational: Documented rdrobust output-binding deviationSeverity: P3 Finding 2 — P3 Informational: Documented v1 scope seamsSeverity: P3 Prior P1 checks are resolved: mass-point detection is performed at Code QualityNo blocking findings. Public integer knobs reject bools via PerformanceNo findings. The implementation uses expected local WLS and same-side nearest-neighbor residual scans; bandwidth selection remains the dominant cost. MaintainabilityNo findings. The Q/q bias-correction score matrix and sandwich construction are localized and documented at Tech DebtFinding 3 — P3 Informational: Deferred RD features are documentedSeverity: P3 SecurityNo findings in the changed RDD implementation, fixtures, or docs. Documentation / TestsNo blocking findings. The PR adds parity, methodology, and validation tests, including R golden parity at Tests were not executed in this environment: |
Summary
RegressionDiscontinuity(aliasRDD): sharp regression discontinuity estimation with robust bias-corrected inference, parity-targeting Rrdrobust4.0.0 end-to-end (PR-2 of the 2-PR RDD plan; PR-1 was the bandwidth-selection port, feat: rdrobust 4.0.0 sharp-RD bandwidth-selection port + R golden parity (RDD PR-1) #680).rdrobust_fit_sharpindiff_diff/_rdrobust_port.py: Q_q bias-correction score matrix, conventional/robust nearest-neighbor sandwich variances sharing same-side NN residuals, per-side fail-closed identification guards (distinct-support rank condition per window).bwselectselectors, manualh/b/rhowith R-exact resolution semantics,masspointsadjust/check/off, N<20 full-range fallback, warn-and-drop NaN handling.att/se/t_stat/p_value/conf_intare ONE coherent row (the robust bias-corrected row); rdrobust's printed headline is exposed asatt_conventionalwith a full inference row;summary()prints the familiar three-row table. Full config echoes on the results object.RegressionDiscontinuitysection (deviations labeled), RTD API page, references, llms guides, README/choosing-estimator one-liners, doc-deps entries, CHANGELOG.Methodology references (required if estimator / math changes)
diff_diff/_rdrobust_port.py). Paper reviews on file indocs/methodology/papers/calonico-*.md(docs: add RDD paper reviews (CCT 2014, CCFT 2017, CCF 2018, CCFT 2019) #675).docs/methodology/REGISTRY.md(RegressionDiscontinuity section) - canonicalatt = tau_bcrobust-row binding (uniform field semantics across the library; rdrobust prints tau_cl as headline), warn-instead-of-silent NaN drops andb-without-hhandling, fail-closed targeted errors on degenerate designs (R propagates NaN/opaque errors or silent pseudo-inverse fits), v1 scope seams (fuzzy/covariates/cluster/weights/kink/diagnostics deferred).Validation
tests/test_rdd.py(API/validation/echoes),tests/test_rdd_parity.py(16-config R golden parity at rtol=1e-9 incl. asymmetric selectors + 10-selector routing locks + Senate anchors incl. published 2017 Stata Journal numbers),tests/test_rdd_methodology.py(CCT 2014 Remark 7 identities across kernels and at p=0, invariances, NaN/degenerate fail-closed contracts),tests/test_rdrobust_port.py(port-level fit validation).benchmarks/R/generate_rdrobust_estimates_golden.R->benchmarks/data/rdrobust_estimates_golden.json); worst observed parity deviation ~5e-11.Security / privacy
Generated with Claude Code
https://claude.ai/code/session_01QGca52n6H8oDDXALjjrsp4