@@ -13,6 +13,8 @@ via feature construction.
13
13
Group Average Treatment Effects (GATEs)
14
14
++++++++++++++++++++++++++++++++++++++++++++++
15
15
16
+ .. include :: ../shared/heterogeneity/gate.rst
17
+
16
18
The ``DoubleMLIRM `` class contains the ``gate() `` method, which enables the estimation and construction of confidence intervals
17
19
for GATEs after fitting the ``DoubleMLIRM `` object. To estimate GATEs, the user has to specify a pandas ``DataFrame `` containing
18
20
the groups (dummy coded or one column with strings).
@@ -54,6 +56,8 @@ A more detailed notebook on GATEs is available in the :ref:`example gallery <exa
54
56
Conditional Average Treatment Effects (CATEs)
55
57
++++++++++++++++++++++++++++++++++++++++++++++
56
58
59
+ .. include :: ../shared/heterogeneity/cate.rst
60
+
57
61
The ``DoubleMLIRM `` class contains the ``cate() `` method, which enables the estimation and construction of confidence intervals
58
62
for CATEs after fitting the ``DoubleMLIRM `` object. To estimate CATEs, the user has to specify a pandas ``DataFrame `` containing
59
63
the basis (e.g. B-splines) for the conditional treatment effects.
@@ -98,7 +102,7 @@ The examples also include the construction of a two-dimensional basis with B-spl
98
102
Quantiles
99
103
++++++++++++++++++++++++++++++++++++++++++++++
100
104
101
- The :ref: `DoubleML <doubleml-package >` package includes (local) quantile estimation for potential outcomes for
105
+ The :ref: `DoubleML <doubleml_package >` package includes (local) quantile estimation for potential outcomes for
102
106
:ref: `IRM <irm-model >` and :ref: `IIVM <iivm-model >` models.
103
107
104
108
Potential Quantiles (PQs)
@@ -124,7 +128,8 @@ Potential Quantiles (PQs)
124
128
dml_pq_obj = dml.DoubleMLPQ(obj_dml_data, ml_g, ml_m, treatment = 1 , quantile = 0.5 )
125
129
dml_pq_obj.fit().summary
126
130
127
- ``DoubleMLLPQ `` implements local potential quantile estimation. Estimation is conducted via its ``fit() `` method:
131
+ ``DoubleMLLPQ `` implements local potential quantile estimation, where the argument ``treatment `` indicates the potential outcome.
132
+ Estimation is conducted via its ``fit() `` method:
128
133
129
134
.. tabbed :: Python
130
135
@@ -142,23 +147,89 @@ Potential Quantiles (PQs)
142
147
dml_lpq_obj = dml.DoubleMLLPQ(obj_dml_data, ml_g, ml_m, treatment = 1 , quantile = 0.5 )
143
148
dml_lpq_obj.fit().summary
144
149
150
+
145
151
Quantile Treatment Effects (QTEs)
146
152
*******************************************
147
153
154
+ .. include :: ../shared/heterogeneity/qte.rst
155
+
156
+ ``DoubleMLQTE `` implements quantile treatment effect estimation. Estimation is conducted via its ``fit() `` method:
157
+
158
+ .. tabbed :: Python
159
+
160
+ .. ipython :: python
161
+
162
+ import numpy as np
163
+ import doubleml as dml
164
+ from doubleml.datasets import make_irm_data
165
+ from sklearn.ensemble import RandomForestClassifier
166
+ np.random.seed(3141 )
167
+ ml_g = RandomForestClassifier(n_estimators = 100 , max_features = 20 , max_depth = 10 , min_samples_leaf = 2 )
168
+ ml_m = RandomForestClassifier(n_estimators = 100 , max_features = 20 , max_depth = 10 , min_samples_leaf = 2 )
169
+ data = make_irm_data(theta = 0.5 , n_obs = 500 , dim_x = 20 , return_type = ' DataFrame' )
170
+ obj_dml_data = dml.DoubleMLData(data, ' y' , ' d' )
171
+ dml_qte_obj = dml.DoubleMLQTE(obj_dml_data, ml_g, ml_m, score = ' PQ' , quantiles = [0.25 , 0.5 , 0.75 ])
172
+ dml_qte_obj.fit().summary
173
+
174
+ To estimate local quantile effects the ``score `` argument has to be set to ``LPQ ``.
148
175
A detailed notebook on PQs and QTEs is available in the :ref: `example gallery <examplegallery >`.
149
176
150
177
Conditional Value at Risk (CVaR)
151
178
++++++++++++++++++++++++++++++++++++++++++++
152
179
153
- All implemented solutions focus on the :ref: `IRM <irm-model >` models
180
+ The :ref: `DoubleML <doubleml_package >` package includes conditional value at risk estimation for
181
+ :ref: `IRM <irm-model >` models.
154
182
155
183
CVaR of Potential Outcomes
156
184
*******************************************
157
185
186
+ .. include :: ../shared/heterogeneity/cvar.rst
187
+
188
+ ``DoubleMLCVAR `` implements conditional value at risk estimation for potential outcomes, where the argument ``treatment `` indicates the potential outcome.
189
+ Estimation is conducted via its ``fit() `` method:
190
+
191
+ .. tabbed :: Python
192
+
193
+ .. ipython :: python
194
+
195
+ import numpy as np
196
+ import doubleml as dml
197
+ from doubleml.datasets import make_irm_data
198
+ from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
199
+ np.random.seed(3141 )
200
+ ml_g = RandomForestRegressor(n_estimators = 100 , max_features = 20 , max_depth = 10 , min_samples_leaf = 2 )
201
+ ml_m = RandomForestClassifier(n_estimators = 100 , max_features = 20 , max_depth = 10 , min_samples_leaf = 2 )
202
+ data = make_irm_data(theta = 0.5 , n_obs = 500 , dim_x = 20 , return_type = ' DataFrame' )
203
+ obj_dml_data = dml.DoubleMLData(data, ' y' , ' d' )
204
+ dml_cvar_obj = dml.DoubleMLCVAR(obj_dml_data, ml_g, ml_m, treatment = 1 , quantile = 0.5 )
205
+ dml_cvar_obj.fit().summary
206
+
207
+
158
208
CVaR Treatment Effect
159
209
*******************************************
160
210
161
- A detailed notebook on conditional value at risk estimation
211
+ .. include :: ../shared/heterogeneity/cvar_qte.rst
212
+
213
+ ``DoubleMLQTE `` implements CVaR treatment effect estimation, if the ``score `` argument has been set to ``CVaR `` (default is ``PQ ``).
214
+ Estimation is conducted via its ``fit() `` method:
215
+
216
+ .. tabbed :: Python
217
+
218
+ .. ipython :: python
219
+
220
+ import numpy as np
221
+ import doubleml as dml
222
+ from doubleml.datasets import make_irm_data
223
+ from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
224
+ np.random.seed(3141 )
225
+ ml_g = RandomForestRegressor(n_estimators = 100 , max_features = 20 , max_depth = 10 , min_samples_leaf = 2 )
226
+ ml_m = RandomForestClassifier(n_estimators = 100 , max_features = 20 , max_depth = 10 , min_samples_leaf = 2 )
227
+ data = make_irm_data(theta = 0.5 , n_obs = 500 , dim_x = 20 , return_type = ' DataFrame' )
228
+ obj_dml_data = dml.DoubleMLData(data, ' y' , ' d' )
229
+ dml_cvar_obj = dml.DoubleMLQTE(obj_dml_data, ml_g, ml_m, score = ' CVaR' , quantiles = [0.25 , 0.5 , 0.75 ])
230
+ dml_cvar_obj.fit().summary
231
+
232
+ A detailed notebook on CVaR estimation for potential outcomes and treatment effects
162
233
is available in the :ref: `example gallery <examplegallery >`.
163
234
164
235
0 commit comments