diff_diff.LocalLinearFit#

class diff_diff.LocalLinearFit[source]#

Bases: object

Result of a local-linear regression at a boundary.

intercept#

Estimated conditional mean at the boundary, mu_hat_h(d0).

Type:

float

slope#

Estimated slope of the local linear fit (coefficient on d - d0).

Type:

float

n_effective#

Count of observations with strictly positive kernel weight (within [d0, d0 + h] for the one-sided kernels shipped here).

Type:

int

bandwidth#

Bandwidth h used.

Type:

float

kernel#

Kernel name.

Type:

str

boundary#

Evaluation point d0.

Type:

float

residuals#

Residuals from the weighted OLS fit, in the order of the retained observations.

Type:

np.ndarray, shape (n_effective,)

kernel_weights#

Kernel weights k((d_i - d0) / h). These are the pre-scaled weights; the 1/h scaling cancels out of the weighted-OLS estimator (a constant factor on all weights does not change the point estimate).

Type:

np.ndarray, shape (n_effective,)

design_matrix#

Design matrix X = [1, d_i - d0] used in the fit. Preserved for Phase 1c bias-correction machinery.

Type:

np.ndarray, shape (n_effective, 2)

Methods

__init__(intercept, slope, n_effective, ...)

Attributes

__init__(intercept, slope, n_effective, bandwidth, kernel, boundary, residuals, kernel_weights, design_matrix)#
Parameters:
Return type:

None

classmethod __new__(*args, **kwargs)#