moderndid.didcont.NPIVResult#

class moderndid.didcont.NPIVResult(h: ndarray, h_lower: ndarray | None, h_upper: ndarray | None, deriv: ndarray, h_lower_deriv: ndarray | None, h_upper_deriv: ndarray | None, beta: ndarray, asy_se: ndarray, deriv_asy_se: ndarray, cv: float | None, cv_deriv: float | None, residuals: ndarray, j_x_degree: int, j_x_segments: int, k_w_degree: int, k_w_segments: int, args: dict)[source]#

Bases: NamedTuple

Container for nonparametric instrumental variables estimation results.

Attributes:
hnumpy.ndarray

Estimated structural function \(\hat{h}_J(x)\) at evaluation points.

h_lowernumpy.ndarray or None

Lower uniform confidence band for \(h_0\).

h_uppernumpy.ndarray or None

Upper uniform confidence band for \(h_0\).

derivnumpy.ndarray

Estimated derivative \(\partial^a \hat{h}_J(x)\) at evaluation points.

h_lower_derivnumpy.ndarray or None

Lower uniform confidence band for \(\partial^a h_0\).

h_upper_derivnumpy.ndarray or None

Upper uniform confidence band for \(\partial^a h_0\).

betanumpy.ndarray

Sieve coefficient vector \(\hat{c}_J\).

asy_senumpy.ndarray

Pointwise asymptotic standard errors \(\hat{\sigma}_J(x)\).

deriv_asy_senumpy.ndarray

Pointwise asymptotic standard errors \(\hat{\sigma}_J^a(x)\) for derivatives.

cvfloat or None

Bootstrap critical value \(z_{1-\alpha}^*\) for function UCBs.

cv_derivfloat or None

Bootstrap critical value \(z_{1-\alpha}^{a*}\) for derivative UCBs.

residualsnumpy.ndarray

TSLS residuals \(\hat{u}_{i,J} = Y_i - \hat{h}_J(X_i)\).

j_x_degreeint

Degree of B-spline basis for \(X\).

j_x_segmentsint

Number of segments for \(X\) basis.

k_w_degreeint

Degree of B-spline basis for \(W\).

k_w_segmentsint

Number of segments for \(W\) basis.

argsdict

Diagnostic information. When data-driven selection is used, includes j_x_seg, k_w_seg, j_hat_max, theta_star, and other selection diagnostics from the Lepski procedure.

Methods

count(value, /)

Return number of occurrences of value.

index(value[, start, stop])

Return first index of value.

Attributes

args

Diagnostic information and selection diagnostics.

asy_se

Pointwise asymptotic standard errors for the structural function.

beta

Sieve coefficient vector.

cv

Bootstrap critical value for function uniform confidence bands.

cv_deriv

Bootstrap critical value for derivative uniform confidence bands.

deriv

Estimated derivative at evaluation points.

deriv_asy_se

Pointwise asymptotic standard errors for derivatives.

h

Estimated structural function at evaluation points.

h_lower

Lower uniform confidence band for the structural function.

h_lower_deriv

Lower uniform confidence band for the derivative.

h_upper

Upper uniform confidence band for the structural function.

h_upper_deriv

Upper uniform confidence band for the derivative.

j_x_degree

Degree of B-spline basis for X.

j_x_segments

Number of segments for X basis.

k_w_degree

Degree of B-spline basis for W.

k_w_segments

Number of segments for W basis.

residuals

TSLS residuals.