nnpiv.diagnostics.relative_wellposedness_effective_diagnostic
- nnpiv.diagnostics.relative_wellposedness_effective_diagnostic(A, C, C_prime, e_g, *, feature_map='rff', n_features=300, gamma='auto', poly_degree=3, poly_include_bias=False, ridge_alpha=1.0, projection_ridge=1e-08, eta=1e-06, eta_mode='sigma_i', random_state=123, feature_builder=None, feature_matrix=None, mask_s=None, mask_t=None, return_details=False)[source]
Compute the post-estimation effective-direction diagnostic
kappa_eff.- Parameters
A (array-like of shape (n,) or (n, d_a)) – First-stage endogenous block used to construct feature functions.
C (array-like of shape (n,) or (n, d_c)) – Second-stage instrument block.
C_prime (array-like of shape (n,) or (n, d_cp)) – First-stage instrument block.
e_g (array-like of shape (n,) or (n, 1)) – Estimated first-stage error direction, typically \(\widehat g - g_0\).
feature_map – Same interpretation as in
relative_wellposedness_diagnostic().n_features – Same interpretation as in
relative_wellposedness_diagnostic().gamma – Same interpretation as in
relative_wellposedness_diagnostic().poly_degree – Same interpretation as in
relative_wellposedness_diagnostic().poly_include_bias – Same interpretation as in
relative_wellposedness_diagnostic().ridge_alpha – Same interpretation as in
relative_wellposedness_diagnostic().eta – Same interpretation as in
relative_wellposedness_diagnostic().eta_mode – Same interpretation as in
relative_wellposedness_diagnostic().random_state – Same interpretation as in
relative_wellposedness_diagnostic().feature_builder – Same interpretation as in
relative_wellposedness_diagnostic().feature_matrix – Same interpretation as in
relative_wellposedness_diagnostic().projection_ridge (float, default=1e-8) – Ridge used when projecting
e_ginto the feature span.mask_s (array-like, optional) – Optional stage-specific subset selectors, using the same mask/index formats accepted by
relative_wellposedness_diagnostic().mask_t (array-like, optional) – Optional stage-specific subset selectors, using the same mask/index formats accepted by
relative_wellposedness_diagnostic().return_details (bool, default=False) – If
True, include projected coefficients and intermediate matrices.
- Returns
Dictionary containing
kappa_eff, regularized counterpartkappa_eff_reg, associated norms, and metadata.- Return type
dict
Notes
The core quantity is
\[\kappa_{\mathrm{eff}} = \frac{\|T_g e_g\|_2}{\|S e_g\|_2},\]computed after projecting
e_gonto the selected finite feature span.