diff_diff.BandwidthResult#
- class diff_diff.BandwidthResult[source]#
Bases:
objectMSE-optimal bandwidth selector output plus per-stage diagnostics.
Returned by
mse_optimal_bandwidth(..., return_diagnostics=True). Mirrors the five-bandwidth + four-stage structure ofnprobust::lpbwselect.mse.dpi; seediff_diff/_nprobust_port.pyfor the source mapping.- h_mse#
Final MSE-optimal bandwidth
h*for local-linear estimation atboundary. The argument to pass tolocal_linear_fit(..., bandwidth=h_mse).- Type:
- b_mse#
Bias-correction bandwidth. Consumed by Phase 1c for the bias-corrected confidence interval (CCF 2018 Equation 8).
- Type:
- c_bw#
Stage 1 preliminary bandwidth used as
h.Vin everylprobust.bwcall downstream:C_kernel * min(sd(d), IQR(d)/1.349) * G^{-1/5}. Kernel constants:epa=2.34,uni=1.843,tri=2.576.- Type:
- stage_d1_V, stage_d1_B1, stage_d1_B2, stage_d1_R
Variance and bias coefficients from the first Stage-2
lprobust.bwcall (orderq+1, reading the(q+1)-th derivative). Parity-checked to 1% against R.- Type:
- stage_d2_V, stage_d2_B1, stage_d2_B2, stage_d2_R
Same for the second Stage-2 call (order
q+2).- Type:
- stage_b_V, stage_b_B1, stage_b_B2, stage_b_R
Same for the Stage-3 bias-bandwidth call (order
q, nup+1).- Type:
- stage_h_V, stage_h_B1, stage_h_B2, stage_h_R
Same for the final Stage-3 main-bandwidth call (order
p, nuderiv).- Type:
Methods
__init__(h_mse, b_mse, c_bw, bw_mp2, bw_mp3, ...)Attributes
stage_d1_Vstage_d1_B1stage_d1_B2stage_d1_Rstage_d2_Vstage_d2_B1stage_d2_B2stage_d2_Rstage_b_Vstage_b_B1stage_b_B2stage_b_Rstage_h_Vstage_h_B1stage_h_B2stage_h_R- __init__(h_mse, b_mse, c_bw, bw_mp2, bw_mp3, stage_d1_V, stage_d1_B1, stage_d1_B2, stage_d1_R, stage_d2_V, stage_d2_B1, stage_d2_B2, stage_d2_R, stage_b_V, stage_b_B1, stage_b_B2, stage_b_R, stage_h_V, stage_h_B1, stage_h_B2, stage_h_R, n, kernel, boundary)#
- Parameters:
h_mse (float)
b_mse (float)
c_bw (float)
bw_mp2 (float)
bw_mp3 (float)
stage_d1_V (float)
stage_d1_B1 (float)
stage_d1_B2 (float)
stage_d1_R (float)
stage_d2_V (float)
stage_d2_B1 (float)
stage_d2_B2 (float)
stage_d2_R (float)
stage_b_V (float)
stage_b_B1 (float)
stage_b_B2 (float)
stage_b_R (float)
stage_h_V (float)
stage_h_B1 (float)
stage_h_B2 (float)
stage_h_R (float)
n (int)
kernel (str)
boundary (float)
- Return type:
None
- classmethod __new__(*args, **kwargs)#