You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Align public docstrings with Phase 1 Conley contract; drop redundant guards
Address P2/P3 findings from CI Codex review of PR #411 R-rebased:
P2 — Public docstrings for the cross-sectional supported APIs and the
rejected panel surfaces were missing or stale:
- `LinearRegression.__init__` and `solve_ols()` docstrings now document
`conley_coords`, `conley_cutoff_km`, `conley_metric`, `conley_kernel`
(the four newly added kwargs) plus the cluster/weights/survey rejection
contract, mirroring the `compute_robust_vcov` docstring.
- `SyntheticDiD` class docstring gains a `Notes (Conley spatial-HAC
rejection)` block stating that `vcov_type` and `conley_*` kwargs raise
`TypeError` at __init__ / set_params, with the bootstrap-variance
rationale.
- `TwoWayFixedEffects` class docstring gains a paragraph on the Phase 1
panel rejection (parallel to the existing HC2/Bell-McCaffrey paragraph),
including the sklearn-style API-symmetry rationale for why constructor
kwargs are inherited from DifferenceInDifferences.
P3 — Two cleanups:
- Removed the redundant `MultiPeriodDiD(absorb=..., vcov_type="conley")`
pre-guard; the unconditional Conley reject immediately after covered
the same path and the special-cased message was misleading (it told
users to "drop absorb=" even though dropping absorb= would NOT make
Conley available on MultiPeriodDiD).
- Renamed `test_bartlett_psd_on_random_distances` to
`test_bartlett_kernel_finite_and_in_unit_interval`. The original name
encoded a stronger property than the methodology contract guarantees
(radial 1-D Bartlett is a practitioner specialization, not PSD-
guaranteed). The renamed test asserts finite / symmetric / [0, 1]-
bounded instead; the both-kernel indefiniteness warning is locked
separately by `test_indefinite_meat_warning_fires_for_bartlett`.
Doc surfaces:
- `docs/methodology/papers/colella-et-al-2019-review.md`: updated the
Phase 1 parity target paragraph to state that Phase 1 ships only
cross-sectional Conley with R `conleyreg` parity; Stata `acreg` TWFE
parity is a Phase 2 target.
- PR body summary rewritten to match the shipped contract: cross-
sectional `LinearRegression` / `compute_robust_vcov` supported,
DiD / MultiPeriodDiD / TWFE reject at fit-time.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/methodology/papers/colella-et-al-2019-review.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -190,7 +190,7 @@ This is a parity gap relative to acreg - implementers must consult acreg source.
190
190
191
191
### Relation to Existing diff-diff Estimators
192
192
193
-
-**Phase 1 parity target:**`vcov_method="conley"` on TWFE must match acreg to <=1e-6 on at least 2-3 fixtures. The `coords=("lat","lon")` and `cutoff_km=<float>` parameters map directly onto acreg's lat/lon + cutoff inputs.
193
+
-**Phase 1 parity target (UPDATED):**Phase 1 ships `vcov_type="conley"` on **cross-sectional**`compute_robust_vcov` / `LinearRegression` only, with parity verified against R `conleyreg` (Düsterhöft 2021) to ≤1e-6 on three benchmark fixtures. Panel estimators (`DifferenceInDifferences`, `MultiPeriodDiD`, `TwoWayFixedEffects`) reject `vcov_type="conley"` at fit-time because the radial 1-D pairwise Conley does not handle the time dimension — applying it over (unit, time) rows would treat same-unit cross-time pairs as `d_ij = 0 → K = 1`, mishandling the space-time HAC. **Stata `acreg` parity for TWFE / panel space-time Conley is a Phase 2 target**, alongside the Driscoll-Kraay product-kernel implementation. The `coords` and `cutoff_km` parameter mapping below is still accurate for the cross-sectional path.
194
194
-**Reduces to HC0** when the cutoff is small enough that `S = I` (no neighbour pairs). The paper does not state this explicitly, but the meat formula collapses to `X' diag(e^2) X` in that case, which is HC0 (White 1980, equation referenced page 4).
195
195
-**Reduces to one-way clustering** when `S = block-diagonal indicator(same cluster)` (see Section 2, p. 6: Cameron et al. 2011 "can be embedded in this framework"). For multiway clustering, the paper says (page 6): "Multiway clustering assumes a particular *regularity condition* in the clustering structure ... However, in many real-life settings, this particular clustering structure may not hold." The acreg estimator is more flexible and the reduction to multiway clustering is approximate (binary `S` with the union-of-clusters structure).
196
196
-**Cluster + spatial joint mode:** The paper does NOT formally combine cluster-robust with spatial-HAC. However, since `S` is arbitrary, one can construct `S` as the elementwise OR of the cluster-indicator matrix and the spatial-cutoff matrix; this gives a joint estimator. acreg likely exposes both options - verify.
0 commit comments