ConleySpatialHAC methodology-review-tracker promotion + Bertanha-Imbens 2014 citation correction#496
Merged
Conversation
…ns 2014 citation correction
Three bundled changes:
1. ConleySpatialHAC methodology-review-tracker promotion (In Progress → Complete).
- METHODOLOGY_REVIEW.md L91 + L1262-1290 flipped Complete with full
Verified Components / Test Coverage / R Comparison Results inline
table / Corrections Made / Deviations / Outstanding Concerns
structure, with Last Review = 2026-05-26.
- New tests/test_methodology_conley.py (~1600 LoC; 10 classes;
60 tests, 5 of them @pytest.mark.slow). Paper-equation-numbered
Verified Components walk-through covering:
* Eq. 4.2 cross-sectional sandwich (pairwise-distance
specialization; Eq. 3.13 is the lattice-indexed form reserved
for grid coordinates)
* Eq. 4.2 HC0 + rank-1 limits + K(0) = 1 diagonal contribution
* Andrews (1991) HAC lag truncation matching
conleyreg::time_dist.cpp
* Haversine convention with Earth radius 6371.01 km (matches
conleyreg::haversine_dist)
* Phase 2 panel block-decomposed sandwich at atol=1e-12 (internal
cross-check vs hand-coded reference + cluster time-invariance
contract)
* Wave A #120 sparse k-d-tree numerical correctness (sparse-vs-
dense bit-identity at atol=1e-10 on cross-sectional, panel,
and sparse-with-cluster paths)
* R conleyreg v0.1.9 parity at atol=1e-6 on 6 fixtures
(3 cross-sectional + 3 panel) + sparse-forced cross-sectional
+ sparse-forced panel + time-asymmetric kernel literal-matching
Three dedicated deviations-area classes:
* TestConleyLibraryExtensions (6 tests, no R correspondence):
combined spatial+cluster product kernel Wave A #119 (two
limit-fixture anchors), callable conley_metric validation
Wave A #123, sparse k-d-tree activation Wave A #120,
indefiniteness guard on Bartlett + uniform kernels.
* TestConleyDeviationsFromR (3 tests): 1-D radial Bartlett vs
paper's 2-D separable Eq. 3.14, time-label normalization,
independent temporal kernel deferred.
* TestConleyDeferrals (5 tests): fail-closed NotImplementedError
/ TypeError contracts for LinearRegression + survey_design,
DiD/MPD/TWFE + survey_design (estimator-level via
conley.py::_validate_conley_estimator_inputs), Conley +
weights (rejected for any weight_type — pweight, aweight,
fweight), SyntheticDiD + Conley (TypeError), wild_bootstrap
+ Conley.
- tests/test_conley_vcov.py extracted 1135+ LoC out (4248 → 3113);
defensive surface preserved (input validation, NaN/inf guards,
dispatch-level validity, estimator-level integration smoke tests,
set_params atomicity, sparse-path activation thresholds + density-
gate fallback). Module docstring refreshed to describe its current
defensive-regression role.
2. Stale priority-queue cleanup at METHODOLOGY_REVIEW.md L1386:
- PreTrendsPower removed (already Complete since 2026-05-19).
- ConleySpatialHAC removed (this PR).
- Substantive-review-blocked renumbered #2-#5 → #1-#4.
- Consolidation-pass-blocked renumbered #6-#8 → #5-#6.
3. Bertanha-Imbens 2014 citation correction across 16 sites:
- linalg.py × 8, conley.py × 1, llms-full.txt × 2, REGISTRY.md × 4,
spillover.rst × 1.
- NBER w20773 is on FRD external validity, NOT weighted spatial-HAC.
- The boundary is now framed as a tri-part contract:
* Shipped — SpilloverDiD + Conley + survey via Wave E.1/E.2/E.3
(PR #468/#474/#482, stratified-Conley sandwich on PSU totals
with within-PSU serial Bartlett HAC for lag_cutoff > 0);
TwoStageDiD + Conley + survey via Wave E.3 parity (PR #485).
* Deferred (generic linalg surface, any weight_type) — DiD/MPD/
TWFE/LinearRegression generic path + Conley + survey_design;
LinearRegression / compute_robust_vcov Conley + weights rejected
for pweight, aweight, AND fweight (weighted Conley is not
implemented on the generic linalg surface).
* Open methodological question (subset) — the pweight /
survey_design portion of the deferral additionally lacks a
canonical methodological extension of Conley (1999) for weighted
spatial-HAC under probability sampling.
- REGISTRY sites use canonical `**Note (open methodological
question):**` label wrapper per CLAUDE.md "Documenting Deviations".
- Historical CHANGELOG entries (pre-[Unreleased]) intentionally
retain Bertanha-Imbens 2014 attribution as accurate records of
past release claims.
Verification:
- pytest tests/test_methodology_conley.py: 60 tests (55 unit + 5 slow)
pass.
- pytest tests/test_methodology_conley.py + tests/test_conley_vcov.py:
176 pass + 5 slow deselected (preserves pre-edit baseline coverage
176 vs original 175 + 1 new uniform-kernel indefiniteness guard).
- grep -rn "Bertanha" diff_diff/ docs/ benchmarks/: 0 hits.
- black + ruff clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <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
ConleySpatialHAC methodology-review-tracker promotion: In Progress → Complete. Closes the Conley (1999) primary-source review on the methodology-review tracker. New
tests/test_methodology_conley.py(~1600 LoC; 10 classes; 60 tests, 5 of them@pytest.mark.slow) with paper-equation-numbered Verified Components walk-through:conley-1999-review.md)conleyreg::time_dist.cppatol=1e-12atol=1e-10(cross-sectional + panel + sparse-with-cluster paths)conleyregv0.1.9 parity atatol=1e-6on 6 fixtures (3 cross-sectional + 3 panel) + sparse-forced + time-asymmetric kernel literal-matchingTestConleyLibraryExtensions(Wave A Align TROP lambda conventions with paper (Athey et al. 2025) #119/Add git worktree management slash commands #120/Fix worktree-rm: detect squash-merged branches via GitHub PR status #123 + indefiniteness guard on both kernels),TestConleyDeviationsFromR(1-D radial vs 2-D separable, time-label normalization, independent temporal kernel deferred),TestConleyDeferrals(5 fail-closedNotImplementedError/TypeErrorcontracts).Companion
tests/test_conley_vcov.pydrops 4248 → 3113 lines after methodology extraction; defensive surface preserved.Stale priority-queue cleanup at
METHODOLOGY_REVIEW.md:L1386. PreTrendsPower removed (already Complete since 2026-05-19) and ConleySpatialHAC removed (this PR); substantive-review queue Add fixed effects and absorb parameters to DifferenceInDifferences #2-Add comprehensive code review for diff-diff library #5 renumbered to Add initial diff-diff library implementation #1-Claude/setup pip install k2 m4j #4; consolidation-pass queue Add multi-period DiD support #6-Add Synthetic Difference-in-Differences (SDID) estimator #8 renumbered to Add comprehensive code review for diff-diff library #5-Add multi-period DiD support #6.Bertanha-Imbens 2014 citation correction (16 sites across 5 files). NBER w20773 is on FRD external validity, NOT weighted spatial-HAC. Replaced across
diff_diff/linalg.py(×8),diff_diff/conley.py(×1),diff_diff/guides/llms-full.txt(×2),docs/methodology/REGISTRY.md(×4),docs/api/spillover.rst(×1). New**Note (deferral status, 2026-05-26):**block frames the boundary as a tri-part contract:weight_type) — DiD/MPD/TWFE/LinearRegression generic path + Conley +survey_design=;LinearRegression/compute_robust_vcovConley +weights=rejected forpweight,aweight, ANDfweight.pweight/survey_designportion of the deferral additionally lacks a canonical methodological extension of Conley (1999) for weighted spatial-HAC under probability sampling.Historical CHANGELOG entries (pre-
[Unreleased]) intentionally retain Bertanha-Imbens 2014 attribution as accurate records of past release claims.Methodology references
Method name(s): ConleySpatialHAC
Paper / source link(s): Conley, T. G. (1999), GMM Estimation with Cross-Sectional Dependence, J. Econometrics 92(1), 1-45. Paper review on file:
docs/methodology/papers/conley-1999-review.md. Secondary: Andrews (1991) HAC theory; Düsterhöft (2021)conleyreg(CRAN v0.1.9) parity target; Colella, Lalive, Sakalli & Thoenig (2019) Stataacregparallel.Any intentional deviations from the source (and why):
conleyreg, Stataacreg, Hsiang (2010); indefiniteness guard at-1e-12applies to both kernels.np.unique— deviation from Rconleyregliteral; diff-diff is more robust on non-dense encodings.conleyregliteral (kernel arg controls spatial only).All documented in
docs/methodology/REGISTRY.md§ ConleySpatialHAC +METHODOLOGY_REVIEW.md§ ConleySpatialHAC Deviations block.Validation
tests/test_methodology_conley.py(CREATE, ~1600 LoC, 10 classes, 60 tests)tests/test_conley_vcov.py(EDIT, methodology-anchored tests extracted; defensive surface preserved; ~1135 LoC removed)conleyregv0.1.9 parity atatol=1e-6on 6 fixtures (3 cross-sectional + 3 panel) + sparse-forced cross-sectional + sparse-forced panel; internal block-decomposition cross-check atatol=1e-12.tests/test_methodology_conley.py+tests/test_conley_vcov.py= 176 pass + 5 slow deselected.grep -rn "Bertanha" diff_diff/ docs/ benchmarks/= 0 hits.black+ruffclean.Security / privacy
Generated with Claude Code