diff_diff.BiasCorrectedFit#
- class diff_diff.BiasCorrectedFit[source]#
Bases:
objectBias-corrected local-linear fit at a boundary (Phase 1c).
Output of
bias_corrected_local_linear(). Produces the mu-scale quantities needed by Equation 8 of de Chaisemartin, Ciccia, D’Haultfoeuille, and Knau (2026). Phase 2’sHeterogeneousAdoptionDiDclass applies the beta-scale(1/G) * sum(D_{g,2})rescaling.- estimate_classical#
Classical point estimate
tau.clfromnprobust::lprobust(local-linear boundary intercept ath; no bias correction).- Type:
- estimate_bias_corrected#
Bias-corrected point estimate
tau.bc = mu_hat + M_hatfrom the Calonico-Cattaneo-Titiunik (2014) combined design-matrix statistic.- Type:
- se_robust#
Robust standard error accounting for the additional variability introduced by the bias-correction term (CCT 2014).
- Type:
- ci_low, ci_high
Endpoints of the bias-corrected CI:
tau.bc +/- z_{1-alpha/2} * se.rb.- Type:
- h, b
Main and bias-correction bandwidths actually used (post-
bwcheckfloor).- Type:
- bandwidth_source#
"auto"when the wrapper called the Phase 1b DPI selector (_nprobust_port.lpbwselect_mse_dpi) internally with the caller’scluster/vce/nnmatch;"user"when the caller passed explicit bandwidths. Auto mode then enforces nprobust’srho=1default by settingb = h; the selector’s distinctb_mseis surfaced viabandwidth_diagnosticsbut not applied.- Type:
{“auto”, “user”}
- bandwidth_diagnostics#
Full Phase 1b selector output when
bandwidth_source == "auto";Nonewhen the user supplied bandwidths (to avoid a redundant selector call).- Type:
BandwidthResult or None
- n_used#
Observations retained in the active kernel window (
sum(ind.b)whenh <= bandsum(ind.h)whenh > b; with therho=1default the two coincide).- Type:
Notes
p=1,q=2,deriv=0are hard-coded for HAD Phase 1c and are not exposed as fields. Phase 2 may surface them on the estimator-level result class if a use case materializes.Methods
__init__(estimate_classical, ...[, ...])Attributes
influence_functionPer-observation influence function of the BIAS-CORRECTED point estimate
tau.bc(Phase 4.5 survey composition).ci_lowci_highhb- __init__(estimate_classical, estimate_bias_corrected, se_classical, se_robust, ci_low, ci_high, alpha, h, b, bandwidth_source, bandwidth_diagnostics, n_used, n_total, kernel, boundary, influence_function=None)#
- Parameters:
estimate_classical (float)
estimate_bias_corrected (float)
se_classical (float)
se_robust (float)
ci_low (float)
ci_high (float)
alpha (float)
h (float)
b (float)
bandwidth_source (str)
bandwidth_diagnostics (BandwidthResult | None)
n_used (int)
n_total (int)
kernel (str)
boundary (float)
influence_function (ndarray | None)
- Return type:
None
- classmethod __new__(*args, **kwargs)#