|
| 1 | +.. _orthoivuserguide: |
| 2 | + |
| 3 | +================================= |
| 4 | +Orthogonal instrumental variables |
| 5 | +================================= |
| 6 | + |
| 7 | + |
| 8 | +What is it? |
| 9 | +================================== |
| 10 | +Orthogonal instrumental variables is a suite of methods to estimate heterogeneous treatment effects with arbitrary machine |
| 11 | +learning methods in the presence of unobserved confounders with the aid of a valid instrument. We develop a statistical learning |
| 12 | +approach to the estimation of heterogeneous effects, reducing the problem to the minimization of an appropriate loss function that |
| 13 | +depends on a set of auxiliary models (each corresponding to a separate prediction task). The reduction enables the use of all |
| 14 | +recent Machine Learning models (e.g. random forest, boosting, neural nets). We show that the estimated effect model is robust to |
| 15 | +estimation errors in the auxiliary models, by showing that the loss satisfies a Neyman orthogonality criterion. |
| 16 | +Our approach can be used to estimate projections of the true effect model on simpler hypothesis spaces. |
| 17 | +When these spaces are parametric, then the parameter estimates are asymptotically normal, |
| 18 | +which enables construction of confidence intervals. |
| 19 | +For a more detailed overview of these methods, see e.g. [Syrgkanis2019]_. |
| 20 | + |
| 21 | + |
| 22 | +What are the relevant estimator classes? |
| 23 | +======================================== |
| 24 | + |
| 25 | +This section describes the methodology implemented in the classes :class:`.OrthoIV`, |
| 26 | +:class:`.DMLIV`, :class:`.NonParamDMLIV`, :class:`.LinearDRIV`, :class:`.SparseLinearDRIV`, :class:`.ForestDRIV`, |
| 27 | +:class:`.IntentToTreatDRIV`, :class:`.LinearIntentToTreatDRIV`. |
| 28 | +Click on each of these links for detailed module documentation and input parameters of each class. |
| 29 | + |
| 30 | +When should you use it? |
| 31 | +================================== |
| 32 | +Suppose you have observational (or experimental from an A/B test) historical data, where some treatment(s)/intervention(s)/action(s) |
| 33 | +:math:`T` were chosen and some outcome(s) :math:`Y` were observed. However, not all of the variables :math:`W` that could have |
| 34 | +potentially gone into the choice of :math:`T`, and simultaneously could have had a direct effect on the outcome :math:`Y` |
| 35 | +(aka controls or confounders) are recorded in the dataset. At the same time if you could observe a variable :math:`Z` which |
| 36 | +will have a direct effect on treatment and an indirect effect on outcome which only goes through the treatment, we could use classes |
| 37 | +mentioned above to learn the heterogeneous treatment effect on high dimensional dataset. In other words, we learn the effect of the |
| 38 | +treatment on the outcome as a function of a set of observable characteristics :math:`X`. |
| 39 | + |
| 40 | +In particular, these methods are especially useful in A/B tests with an intent-to-treat structure, where the experimenter randomizes over |
| 41 | +which user will receive a recommendation to take an action, and we are interested in the effect of the downstream action. |
| 42 | + |
| 43 | +For instance call: |
| 44 | + |
| 45 | +.. testsetup:: |
| 46 | + |
| 47 | + # LinearIntentToTreatDRIV |
| 48 | + import numpy as np |
| 49 | + X = np.random.normal(size=(100, 3)) |
| 50 | + y = np.random.normal(size=(100,)) |
| 51 | + T = np.random.binomial(1, 0.5, size=(100,)) |
| 52 | + Z = np.random.binomial(1, 0.5, size=(100,)) |
| 53 | + W = np.random.normal(size=(100, 10)) |
| 54 | + |
| 55 | +.. testcode:: |
| 56 | + |
| 57 | + from econml.iv.dr import LinearIntentToTreatDRIV |
| 58 | + est = LinearIntentToTreatDRIV() |
| 59 | + est.fit(y, T, Z=Z, X=X, W=X) |
| 60 | + est.effect(X) |
| 61 | + |
| 62 | + |
| 63 | +Class Hierarchy Structure |
| 64 | +================================== |
| 65 | +In this library we implement variants of several of the approaches mentioned in the last section. The hierarchy |
| 66 | +structure of the implemented CATE estimators is as follows. |
| 67 | + |
| 68 | + .. inheritance-diagram:: econml.iv.dml.OrthoIV econml.iv.dml.NonParamDMLIV econml.iv.dml.DMLIV econml.iv.dr.DRIV |
| 69 | + econml.iv.dr.LinearDRIV econml.iv.dr.SparseLinearDRIV econml.iv.dr.ForestDRIV |
| 70 | + econml.iv.dr.IntentToTreatDRIV econml.iv.dr.LinearIntentToTreatDRIV |
| 71 | + :parts: 1 |
| 72 | + :private-bases: |
| 73 | + :top-classes: econml._ortho_learner._OrthoLearner, econml._cate_estimator.StatsModelsCateEstimatorMixin, econml._cate_estimator.DebiasedLassoCateEstimatorMixin |
| 74 | + |
| 75 | + |
| 76 | +Usage Examples |
| 77 | +================================== |
| 78 | + |
| 79 | +For more extensive examples check out the following notebooks: |
| 80 | +`OrthoIV and DRIV Examples Jupyter Notebook <https://github.com/microsoft/EconML/blob/master/notebooks/OrthoIV%20and%20DRIV%20Examples.ipynb>`_. |
0 commit comments