Skip to content

Commit 5cd6051

Browse files
igerberclaude
andcommitted
Sync bias_corrected_local_linear docstring with vce='nn'-only surface
P3 follow-up from AI review. The class-level scope note still claimed HC0-3 were "exposed here", and the Raises section listed the old `ValueError` for `vce='hc2'/'hc3'` with cluster. Both are stale: the wrapper now raises `NotImplementedError` for any `vce != "nn"` regardless of cluster. Updated the scope note and Raises section to reflect the current behavior. Behavior unchanged; docstring-only. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2c48e60 commit 5cd6051

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

diff_diff/local_linear.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -959,10 +959,12 @@ def bias_corrected_local_linear(
959959
**Public API scope (Phase 1c of HAD).** Hard-coded for the HAD
960960
configuration: ``p=1`` (local-linear), ``q=2`` (bias-correction
961961
order), ``deriv=0`` (level), ``interior=False`` (boundary eval
962-
point), ``bwcheck=21``, ``bwregul=1``. The underlying
963-
``diff_diff._nprobust_port`` supports more. HC0-3 vce modes are
964-
exposed here but NOT separately golden-parity-tested against R in
965-
Phase 1c; use at your own risk until Phase 2+.
962+
point), ``bwcheck=21``, ``bwregul=1``, and ``vce="nn"`` (the only
963+
variance mode golden-parity-tested against R in this phase). The
964+
underlying ``diff_diff._nprobust_port.lprobust`` accepts the broader
965+
surface (hc0/hc1/hc2/hc3, higher ``p``, interior eval), but those
966+
paths are not separately parity-tested and remain private until
967+
Phase 2+ ships dedicated goldens.
966968
967969
Parameters
968970
----------
@@ -1012,12 +1014,14 @@ def bias_corrected_local_linear(
10121014
------
10131015
ValueError
10141016
Shape mismatch, non-finite inputs, off-support boundary, negative
1015-
doses, ``alpha`` outside ``(0, 1)``, unsupported ``kernel``/``vce``,
1016-
NaN cluster IDs, incompatible ``vce="hc2"/"hc3"`` with clustering,
1017-
``b`` supplied without ``h``, or a rank-deficient window.
1017+
doses, ``alpha`` outside ``(0, 1)``, unknown ``kernel``,
1018+
NaN / None cluster IDs, ``b`` supplied without ``h``, or a
1019+
rank-deficient window.
10181020
NotImplementedError
1019-
``weights=`` passed, or a Design 1 mass-point sample (redirects to
1020-
Phase 2's 2SLS sample-average path per the paper's Section 3.2.4).
1021+
``weights=`` passed; ``vce != "nn"`` (hc0/hc1/hc2/hc3 deferred
1022+
to Phase 2+ pending dedicated R parity goldens); a Design 1
1023+
mass-point sample (redirects to Phase 2's 2SLS sample-average
1024+
path per the paper's Section 3.2.4).
10211025
10221026
Notes
10231027
-----

0 commit comments

Comments
 (0)