diff_diff.BiasCorrectedFit#

class diff_diff.BiasCorrectedFit[source]#

Bases: object

Bias-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’s HeterogeneousAdoptionDiD class applies the beta-scale (1/G) * sum(D_{g,2}) rescaling.

estimate_classical#

Classical point estimate tau.cl from nprobust::lprobust (local-linear boundary intercept at h; no bias correction).

Type:

float

estimate_bias_corrected#

Bias-corrected point estimate tau.bc = mu_hat + M_hat from the Calonico-Cattaneo-Titiunik (2014) combined design-matrix statistic.

Type:

float

se_classical#

Naive plug-in standard error.

Type:

float

se_robust#

Robust standard error accounting for the additional variability introduced by the bias-correction term (CCT 2014).

Type:

float

ci_low, ci_high

Endpoints of the bias-corrected CI: tau.bc +/- z_{1-alpha/2} * se.rb.

Type:

float

alpha#

CI level (0.05 gives a 95% CI).

Type:

float

h, b

Main and bias-correction bandwidths actually used (post-bwcheck floor).

Type:

float

bandwidth_source#

"auto" when the wrapper called the Phase 1b DPI selector (_nprobust_port.lpbwselect_mse_dpi) internally with the caller’s cluster / vce / nnmatch; "user" when the caller passed explicit bandwidths. Auto mode then enforces nprobust’s rho=1 default by setting b = h; the selector’s distinct b_mse is surfaced via bandwidth_diagnostics but not applied.

Type:

{“auto”, “user”}

bandwidth_diagnostics#

Full Phase 1b selector output when bandwidth_source == "auto"; None when 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) when h <= b and sum(ind.h) when h > b; with the rho=1 default the two coincide).

Type:

int

n_total#

Total observations passed in (before kernel filtering).

Type:

int

kernel#

Kernel name as supplied by the caller.

Type:

str

boundary#

Evaluation point c.

Type:

float

Notes

p=1, q=2, deriv=0 are 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_function

Per-observation influence function of the BIAS-CORRECTED point estimate tau.bc (Phase 4.5 survey composition).

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

__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:
Return type:

None

classmethod __new__(*args, **kwargs)#