Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/api/dml_models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ doubleml.plm

DoubleMLPLR
DoubleMLPLIV
DoubleMLLPLR


.. _api_irm_models:
Expand Down
13 changes: 13 additions & 0 deletions doc/guide/models/plm/lplr.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
**Logistic partially linear regression (LPLR)** models take the form

.. math::

\mathbb{E} [Y | D, X] = \mathbb{P} (Y=1 | D, X) = \text{expit} \{\beta_0 D + r_0 (X) \}

where :math:`Y` is the binary outcome variable and :math:`D` is the policy variable of interest.
The high-dimensional vector :math:`X = (X_1, \ldots, X_p)` consists of other confounding covariates.
:math:`\text{expit}` is the logistic link function

.. math::
\text{expit} ( X ) = \frac{1}{1 + e^{-x}}

37 changes: 36 additions & 1 deletion doc/guide/models/plm/plm_models.inc
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,39 @@ Estimation is conducted via its ``fit()`` method:
obj_dml_data = DoubleMLData$new(data, y_col="y", d_col = "d", z_cols= "Z1")
dml_pliv_obj = DoubleMLPLIV$new(obj_dml_data, ml_l, ml_m, ml_r)
dml_pliv_obj$fit()
print(dml_pliv_obj)
print(dml_pliv_obj)

Logistic partially linear regression model (LPLR)
***************************************

.. include:: /guide/models/plm/lplr.rst

.. include:: /shared/causal_graphs/plr_irm_causal_graph.rst

``DoubleMLLPLR`` implements LPLR models. Estimation is conducted via its ``fit()`` method.

.. note::
Remark that the treatment effects are not additive in this model. The partial linear term enters the model through a logistic link function.

.. tab-set::

.. tab-item:: Python
:sync: py

.. ipython:: python

import numpy as np
import doubleml as dml
from doubleml.plm.datasets import make_lplr_LZZ2020
from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier
from sklearn.base import clone
np.random.seed(3141)
ml_t = RandomForestRegressor(n_estimators=100, max_features=20, max_depth=5, min_samples_leaf=2)
ml_m = RandomForestRegressor(n_estimators=100, max_features=20, max_depth=5, min_samples_leaf=2)
ml_M = RandomForestClassifier(n_estimators=100, max_features=20, max_depth=5, min_samples_leaf=2)
obj_dml_data = make_lplr_LZZ2020(alpha=0.5, n_obs=500, dim_x=20)
dml_lplr_obj = dml.DoubleMLPLR(obj_dml_data, ml_M, ml_t, ml_m)
dml_lplr_obj.fit().summary



Loading