Estimators for Sequential and Simultaneous Nested NPIV
Start Here
Prerequisites: Installation & Replication
Diagnostic context before estimation: Estimation Diagnostics
API reference for these estimators: Longitudinal API Overview
Next after model fitting: Semiparametric Estimation
On This Page
Overview
This section summarizes the optimization targets for nested NPIV estimators under different function classes and links each target to practical implementations (RKHS, random forest/ensemble, neural network, sparse/regularized linear, and linear baselines).
Assumptions
Observations are i.i.d. draws of \((A, B, C, C', Y)\).
Function classes \(\mathcal{G}, \mathcal{H}, \mathcal{F}, \mathcal{F}'\) are chosen by the estimator family.
Penalization and/or norm constraints are used to regularize finite-sample minimax estimation.
Notation
\(A\): first-stage endogenous treatment/features.
\(B\): second-stage endogenous treatment/features.
\(C'\): first-stage instruments for recovering \(g\).
\(C\): second-stage instruments for recovering \(h\).
\(g\): first-stage bridge function, \(h\): structural function of primary interest.
Estimator Objectives
Sequential Nested NPIV:
Given observations \((A_i, B_i, C_i)\), an initial estimator \(\hat{g}\), and hyperparameter values \((\lambda, \mu)\), estimate
where \(\text{penalty}(f, \lambda) = \mathbb{E}_m\{f(C)^2\} + \lambda \cdot \|f\|^2_{\mathcal{F}}\) and \(\text{penalty}(h, \mu) = \mu \cdot \|h\|^2_{\mathcal{H}}\).
Interpretation: the adversary \(f\) probes IV moment violations for fixed \(h\), while the learner regularizes complexity to stabilize inversion.
Sequential Nested NPIV: Ridge:
Given observations \((A_i, B_i, C_i)\), an initial estimator \(\hat{g}\), and hyperparameter \(\mu\), estimate
where \(\text{penalty}(f) = \mathbb{E}_m\{f(C)^2\}\) and \(\text{penalty}(h, \mu) = \mu \cdot \mathbb{E}_m\{h(B)^2\}\).
Interpretation: this variant emphasizes prediction-space regularization for \(h\) via \(\mathbb{E}[h(B)^2]\).
Simultaneous Nested NPIV:
Given observations \((A_i, B_i, C_i, C_i')\) and hyperparameters \((\mu', \mu)\), estimate
Interpretation: joint estimation can propagate first-stage uncertainty into the second stage; diagnostics in Estimation Diagnostics help assess conditioning before fitting.
Progressive Recipe
# Step 1: prepare arrays (A, B, C_prime, C, Y)
from nnpiv.rkhs import RKHS2IVL2
est = RKHS2IVL2(mu=0.1, mu_prime=0.1)
# Step 2: fit simultaneous nested NPIV
est.fit(A=A, B=B, C=C, D=C_prime, Y=Y)
# Step 3: inspect structural predictions
h_hat = est.predict(B_test)