Skip to content

Commit 044baed

Browse files
igerberclaude
andcommitted
Clarify boundary= contract in mse_optimal_bandwidth docstring (P3)
CI AI review P3: the boundary parameter docs said callers could pass d_lower (the theoretical support lower bound), but the implementation requires boundary = float(d.min()) (the sample minimum). Users following the old docs on e.g. U(1, 2) data with boundary=1.0 would hit an avoidable ValueError. Docstring now explicitly says use the sample minimum. Deferred (P3): extending R golden parity to triangular and uniform kernels. All three kernels go through the same lprobust_bw code path, so epa parity transitively covers dispatch; tri/uni parity is a nice-to-have regression anchor but not a correctness gap. 175 tests pass (unchanged). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7277ec8 commit 044baed

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

diff_diff/local_linear.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,8 +533,15 @@ def mse_optimal_bandwidth(
533533
y : np.ndarray, shape (G,)
534534
Outcome values (the first-difference ``Delta Y_g`` in HAD).
535535
boundary : float, default=0.0
536-
Evaluation point ``d_0``. For Design 1' ``d_0 = 0``; for Design 1
537-
continuous-near-``d_lower`` pass ``d_0 = d_lower``.
536+
Evaluation point ``d_0``. The Phase 1b wrapper accepts only
537+
two values (within float tolerance): ``boundary = 0`` for
538+
Design 1' or ``boundary = float(d.min())`` for Design 1
539+
continuous-near-``d_lower``. Use the sample minimum
540+
``d.min()`` (not a known theoretical lower bound of the
541+
support), because the downstream selector operates on the
542+
realized data. Any other value -- including
543+
``boundary < d.min()``, interior points, or
544+
``boundary > d.min()`` -- raises ``ValueError``.
538545
kernel : str, default="epanechnikov"
539546
One of ``"epanechnikov"``, ``"triangular"``, ``"uniform"``.
540547
weights : np.ndarray or None, default=None

0 commit comments

Comments
 (0)