test(twfe): tighten live-R fixest parity bands to measured precision (SE-audit C7/C8)#663
Open
igerber wants to merge 2 commits into
Open
test(twfe): tighten live-R fixest parity bands to measured precision (SE-audit C7/C8)#663igerber wants to merge 2 commits into
igerber wants to merge 2 commits into
Conversation
|
Overall Assessment ✅ Looks good — no unmitigated P0/P1 findings. Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
|
58e9d00 to
5e27a9b
Compare
…(SE-audit C7/C8 re-derivation) TestRBenchmarkTWFE's assertions predate the D4 within-transform rescale. Measured against live R (fixest 0.14.2): ATT agrees at ~4e-16 relative (asserted 0.1% -> rtol=1e-12); the cluster-robust SE and CI bands drop 0.01 -> 0.005, pinning the documented ~0.25% absorbed-FE fixest-CR1 DOF-convention deviation instead of sitting 4x above it; the p-value assert (atol=0.01 was vacuous: at |t|~15 Python's normal tail is ~1e-49 vs fixest's t-tail ~1e-27, the documented distribution deviation) becomes a both-are-zero pin at atol=1e-12. Docstrings record measured gaps + deviation attributions. TODO SE-audit row updated with the re-derivation findings (remaining inventory candidates are statistical-by-design or fixture-not-committed). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5e27a9b to
a08bc0e
Compare
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment ✅ Looks good — no unmitigated P0/P1 findings. Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
|
… |t| Review optional P3: the R-benchmark p-value pin sits at |t|~22 where the residual-df and cluster-df (G-1) tails are both numerically zero and cannot distinguish the conventions. New fixture tuned to |t|~1.8 (t(148) vs t(49) p-values differ ~5% relative): asserts the estimator's p-value matches the residual-df tail to 1e-10 AND differs measurably from the cluster-df tail, with a regime guard on |t| so data-gen drift cannot silently defang the assertions. REGISTRY deviation note now cites it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lbd6nqWmg4snvvBmegwqiw
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment ✅ Looks good — no unmitigated P0/P1 findings. 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
TestRBenchmarkTWFE's live-R (fixest) parity bands predate the D4 within-transform rescale; measured against fixest 0.14.2: ATT agrees at ~4e-16 relative (asserted 0.1% → now rtol=1e-12), the cluster-robust SE and CI bands drop 0.01 → 0.005, pinning the documented ~0.25% absorbed-FE fixest-CR1 ssc deviation instead of sitting 4x above it.**Note (deviation from R):**in the TwoWayFixedEffects section, the test becomes an honest both-are-zero pin at atol=1e-12, and a new Actionable TODO row poses the library-wide decision (adopt cluster-df — the common applied recommendation — vs keep residual-df as documented; adopting moves every clustered p-value/CI, so it needs its own impact sweep).Methodology references (required if estimator / math changes)
Validation
tests/test_methodology_twfe.py::TestRBenchmarkTWFE(6 assertions tightened, docstrings rewritten). All 6 pass against live R.Security / privacy
Generated with Claude Code