Skip to content

Commit e1d36f5

Browse files
igerberclaude
andcommitted
Document conley_* kwargs in compute_robust_vcov docstring
Address P3 doc-drift finding from CI Codex review of PR #411 R-final. The function-level docstring already lists Conley in the dispatch description, but the Parameters section's `vcov_type` enum line and the four `conley_*` keyword-only kwargs were not separately documented. Added `"conley"` to the enum and four new parameter entries (``conley_coords``, ``conley_cutoff_km``, ``conley_metric``, ``conley_kernel``) describing the cross-sectional-only Phase 1 contract and the both-kernel indefiniteness warning. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9b01208 commit e1d36f5

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

diff_diff/linalg.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,30 @@ def compute_robust_vcov(
12181218
weight_type : str, default "pweight"
12191219
Weight type: "pweight", "fweight", or "aweight".
12201220
vcov_type : str, default "hc1"
1221-
One of ``"classical"``, ``"hc1"``, ``"hc2"``, ``"hc2_bm"``.
1221+
One of ``"classical"``, ``"hc1"``, ``"hc2"``, ``"hc2_bm"``,
1222+
``"conley"`` (see top-level docstring above for the dispatch
1223+
contract).
1224+
conley_coords : ndarray of shape (n, 2), optional, keyword-only
1225+
Required when ``vcov_type="conley"``. Two-column array of
1226+
``[lat, lon]`` (degrees, for ``conley_metric="haversine"``) or
1227+
projected coordinates (for ``conley_metric="euclidean"`` or a
1228+
callable metric). Raises ``ValueError`` when missing under Conley.
1229+
conley_cutoff_km : float, optional, keyword-only
1230+
Required when ``vcov_type="conley"``. Positive finite bandwidth in
1231+
km (haversine) or coord units (euclidean / callable). No default
1232+
per Conley 1999 Section 5's sensitivity-grid recommendation;
1233+
raises ``ValueError`` when missing under Conley.
1234+
conley_metric : str, default "haversine", keyword-only
1235+
Distance metric for Conley. ``"haversine"`` (lat/lon → km, Earth
1236+
radius 6371.01 matching R ``conleyreg``), ``"euclidean"`` (any
1237+
units), or a callable ``f(coords1, coords2) -> n×n``.
1238+
conley_kernel : str, default "bartlett", keyword-only
1239+
Conley kernel on pairwise distance ``d_ij/h``. ``"bartlett"`` is
1240+
the radial 1-D specialization (matching R ``conleyreg``);
1241+
``"uniform"`` is the truncated indicator. Both kernels emit a
1242+
``UserWarning`` if the resulting meat is materially indefinite —
1243+
neither is formally PSD-guaranteed in the radial form (see
1244+
``docs/methodology/REGISTRY.md`` § ConleySpatialHAC for details).
12221245
return_dof : bool, default False
12231246
When True, returns ``(vcov, dof_vec)`` tuple. ``dof_vec`` is a length-k
12241247
array of per-coefficient degrees of freedom. For ``classical``,

0 commit comments

Comments
 (0)