Semiparametric Estimation
Start Here
Estimator families and nuisance-learning context: Estimators for Sequential and Simultaneous Nested NPIV
Conditioning checks before/after nuisance estimation: Estimation Diagnostics
Semiparametric API reference: Semiparametric API Overview
Setup and runnable notebook pointers: Installation & Replication
On This Page
Overview
The goal is general-purpose learning and inference for a nonparametric causal parameter \(\theta_0 \in \mathbb{R}\). Many targets admit multiply robust moment functions with nuisance parameters \((\nu_0, \delta_0, \alpha_0, \eta_0)\). This section summarizes the debiased machine learning (DML) meta-algorithm used in the package to convert nuisance estimators into valid point estimates and confidence intervals.
Assumptions
Nuisance estimators are trained on auxiliary folds and evaluated out-of-fold.
Each nuisance learner converges in mean-square error at rates compatible with DML remainder control.
Moment conditions are evaluated on held-out folds for orthogonalization.
Notation
\(\theta_0\): scalar target parameter.
\((\nu_0, \delta_0, \alpha_0, \eta_0)\): nuisance components entering the orthogonal score.
\(I_\ell\): fold index set; \(I_\ell^c\) its complement.
Debiased Machine Learning Meta-Algorithm
Given a sample \((Y_i, W_i)\) (\(i = 1, \ldots, n\)), partition the sample into folds \(I_\ell\) (\(\ell = 1, \ldots, L\)). Denote by \(I^c_\ell\) the complement of \(I_\ell\).
For each fold \(\ell\), estimate \((\hat{\nu}_\ell, \hat{\delta}_\ell, \hat{\alpha}_\ell, \hat{\eta}_\ell)\) from observations in \(I^c_\ell\).
Estimate \(\theta_0\) as
\[\hat{\theta} = \frac{1}{n} \sum_{\ell=1}^L \sum_{i \in I_\ell} \left[ \hat{\nu}_\ell(W_i) + \hat{\alpha}_\ell(W_i)\{Y_i - \hat{\delta}_\ell(W_i)\} + \hat{\eta}_\ell(W_i)\{\hat{\delta}_\ell(W_i) - \hat{\nu}_\ell(W_i)\} \right].\]Estimate the \((1 - \alpha)100\%\) confidence interval as \(\hat{\theta} \pm c_\alpha \hat{\sigma} n^{-1/2}\), where \(c_\alpha\) is the \(1 - \alpha/2\) quantile of the standard Gaussian and
\[\hat{\sigma}^2 = \frac{1}{n} \sum_{\ell=1}^L \sum_{i \in I_\ell} \left[ \hat{\nu}_\ell(W_i) + \hat{\alpha}_\ell(W_i)\{Y_i - \hat{\delta}_\ell(W_i)\} + \hat{\eta}_\ell(W_i)\{\hat{\delta}_\ell(W_i) - \hat{\nu}_\ell(W_i)\} - \hat{\theta} \right]^2.\]
Interpretation: fold-wise orthogonalization reduces sensitivity to nuisance estimation errors, enabling practical inference with flexible first-stage learners.
Progressive Recipe
# Step 1: configure nuisance learners and data blocks
import numpy as np
from nnpiv.rkhs import ApproxRKHSIVCV
from nnpiv.semiparametrics import DML_npiv
g_model = ApproxRKHSIVCV(kernel_approx="nystrom", n_components=200, cv=3)
# Step 2: fit DML NPIV estimator
dml = DML_npiv(Y=Y, D=D, Z=Z, W=W, model1=g_model, modelq1=g_model, n_folds=5)
theta, var, ci = dml.dml()
# Step 3: inspect estimate and uncertainty
print(theta, np.sqrt(var), ci)