test(imputation): covariate-path R parity anchor vs didimputation#643
Open
igerber wants to merge 1 commit into
Open
test(imputation): covariate-path R parity anchor vs didimputation#643igerber wants to merge 1 commit into
igerber wants to merge 1 commit into
Conversation
8ee3bf9 to
2b9a7db
Compare
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment✅ Looks good Executive Summary
MethodologyNo findings.
Code QualityNo findings.
PerformanceNo findings.
MaintainabilityNo findings.
Tech DebtNo findings.
SecurityNo findings.
Documentation/TestsNo PR findings.
|
2b9a7db to
876602b
Compare
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment✅ Looks good Executive Summary
MethodologyNo findings.
Code QualityNo findings.
PerformanceNo findings.
MaintainabilityNo findings.
Tech DebtNo findings.
SecurityNo findings.
Documentation/TestsP3-informational.
|
The covariate branch of ImputationDiD (first-stage imputation model y ~ x | unit + time on the untreated sample; R first_stage = ~ 0 + x | unit + time == diff-diff covariates=['x']) had no dedicated R anchor — only the no-covariate staggered panel was parity'd. Adds a time-varying, unit-correlated covariate panel to the didimputation golden generator (appended after the base scenario so its RNG draws — and the committed base panel + golden values — reproduce byte-identically; verified) and TestImputationDiDCovariateParityR pinning overall + per-horizon event-study ATT and SE. Observed agreement: SE ~2e-10, ATT ~2e-7 on the reference platform; asserted at abs=1e-6/1e-7 for cross-platform robustness. REGISTRY v_it-derivation note updated with the covariate anchor. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
876602b to
e23889f
Compare
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment ✅ Looks good Executive Summary
Methodology No findings.
Code Quality No findings.
Performance No findings.
Maintainability No findings.
Tech Debt No findings.
Security No findings.
Documentation/Tests P3-informational.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ImputationDiDhad no dedicated R anchor — only the no-covariate staggered panel was parity'd, though the covariate path shares the validated projection code. This adds the TODO row's "golden variant" (R available locally): a time-varying, unit-correlated covariate panel +didimputationreference values withfirst_stage = ~ 0 + x | unit + time(== diff-diffcovariates=["x"]).generate_didimputation_golden.R, so the base panel's RNG draws are unchanged — the committed base CSV and all base golden values reproduce byte-identically on regeneration (verified). The golden JSON gains acovariateblock; a newdidimputation_covariate_panel.csvis committed.TestImputationDiDCovariateParityRpins overall + per-horizon event-study ATT and SE. Observed agreement on the reference platform: SE ~2e-10 (the covariate-augmented untreatedv_itprojection + clustering machinery), ATT ~2e-7 (same platform class as the no-covariate anchor); asserted at abs=1e-6 (ATT) / abs=1e-7 (SE) for cross-platform robustness, with skip guards for missing fixtures.v_it-derivation note updated to record the covariate anchor. Closes the imputation-validation TODO row.Methodology references (required if estimator / math changes)
didimputation0.5.0 as the parity reference (R 4.5.2)Validation
tests/test_methodology_imputation.py::TestImputationDiDCovariateParityR(4 tests; full file 48 pass).Security / privacy
Generated with Claude Code