from _api_doc_utils import *EPLM
Robins-Newey partially linear E-estimator
1 Where it fits
Group: Causal inference
EPLM targets a scalar treatment effect in a partially linear model. It combines an outcome equation with a working model for \(E[D\mid W]\) and solves the resulting stacked moment system.
The intended estimand is the coefficient on the scalar treatment after accounting for controls \(W\) without treating the nuisance regression as the object of interest.
2 Python API
Constructor: cm.EPLM
Call fit(y, d, w) with scalar treatment d and 2D controls w. summary(vcov=None, lags=None, clusters=None) returns the coefficient, standard error, covariance matrix, and nuisance coefficients. There is no predict() method.
print(inspect.signature(cm.EPLM))(fd_eps=1e-06)
cls = cm.EPLM
display(HTML(html_table(["Public method"], public_methods(cls))))| Public method |
|---|
fit(self, /, y, d, w) |
summary(self, /, vcov=None, lags=None, clusters=None) |
3 Minimal example
rng=np.random.default_rng(11)
w=rng.normal(size=(300,3)); d=.4+w@np.array([.6,-.2,.3])+rng.normal(size=300); y=1.1*d+w@np.array([.2,.1,-.2])+rng.normal(scale=.5,size=300)
model=cm.EPLM(); model.fit(y,d,w)
print(model.summary()["coef"])
print(model.summary()["se"])1.0900606444971932
0.027112508384829728
4 summary() contract
The table below is generated by fitting the live class in this repository and then inspecting summary(). Shapes are shown because most values are plain NumPy arrays or scalars.
rng=np.random.default_rng(111); w=rng.normal(size=(120,3)); d=.4+w@np.array([.6,-.2,.3])+rng.normal(size=120); y=1.1*d+w@np.array([.2,.1,-.2])+rng.normal(size=120)*.5
model=cm.EPLM(); model.fit(y,d,w)
summary = model.summary()
display(HTML(html_table(["summary() key", "shape"], summary_shape_rows(summary))))| summary() key | shape |
|---|---|
coef |
() |
se |
() |
vcov |
(1, 1) |
nuisance_coef |
(4,) |