test(se-audit): G2 hetero + cluster machine-precision fixest locks on unbalanced heteroskedastic DGP#644
Merged
Merged
Conversation
… unbalanced heteroskedastic DGP Adds two appended scenarios to the fixest golden (error sd varying by arm/period, ~15% rows dropped; the original balanced scenarios' RNG draws precede them and reproduce value-identically). On the plain-OLS DiD path, hetero (HC1) no longer collapses to iid and is locked at machine precision — and the CR1 cluster SE matches fixest EXACTLY on plain OLS (balanced + unbalanced), so the former DiD cluster band-pin is tightened to a machine lock: the documented ~0.25% fixest-CR1 DOF-convention deviation is absorbed-FE-only. The TWFE cluster band is retained and re-scoped to that documented non-nested-FE ssc deviation; TWFE hetero has no public unclustered surface (auto-cluster-at-unit), so its scenario locks iid — pinning the D4 full-K rescale on an UNBALANCED panel for the first time. Required golden blocks assert (not skip) when missing. Closes SE-audit G2(a) in the TODO. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Overall Assessment: ✅ Looks Good Executive Summary
Methodology
Code Quality Performance Maintainability Tech Debt Security Documentation/Tests |
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
fixest_did_twfe_golden.jsongains two appended scenarios (heteroskedastic — error sd varies by arm and period — and unbalanced, ~15% rows dropped), so fixest'shetero(HC1) no longer collapses to iid. The original balanced scenarios' RNG draws precede the new blocks and reproduce value-identically on regeneration (verified).ssc()probing (fixef.K=full/nested+adjreproduce the gap only under absorbed FE).heterohas no public unclustered Python surface (documented auto-cluster-at-unit convention), so scenario 4 locks iid — which pins the SE-audit D4 full-K rescale on an unbalanced panel for the first time. The fixestheteroblock is stored for reference.Methodology references (required if estimator / math changes)
fixest::feolsssc()(no estimator code changed — golden fixture, tests, TODO/CHANGELOG only)Validation
tests/test_fixest_did_twfe_parity.py(7 tests: 2 existing iid locks unchanged, DiD cluster tightened to machine precision across both scenarios, TWFE cluster ATT exact + SE band, new hetero class with a discriminating hetero≠iid assertion).Security / privacy
Generated with Claude Code