Skip to content

Commit a3bb6f0

Browse files
committed
Merge branch 'master' of github.com:DoubleML/doubleml-for-r into 0.0.X
2 parents 40b3215 + 4e59666 commit a3bb6f0

File tree

12 files changed

+45
-41
lines changed

12 files changed

+45
-41
lines changed

DESCRIPTION

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ Authors@R: c(
77
person("Victor", "Chernozhukov", role="aut"),
88
person("Malte S.", "Kurz", email = "malte.simon.kurz@uni-hamburg.de", role=c("aut", "cre")),
99
person("Martin", "Spindler", email="martin.spindler@gmx.de", role="aut"))
10-
Description: The R package DoubleML provides an implementation of the double / debiased machine learning framework of Chernozhukov et al. (2018) for
11-
partially linear regression models, partially linear instrumental variable regression models, interactive regression models and interactive instrumental
12-
variable regression models. DoubleML allows estimation of the nuisance parts in these models by machine learning methods and computation of the Neyman
13-
orthogonal score functions. DoubleML is built on top of mlr3 and the mlr3 ecosystem. The object-oriented implementation of DoubleML that is based on
14-
the R6 package for R is very flexible.
10+
Description: The R package DoubleML provides an implementation of the double /
11+
debiased machine learning framework of Chernozhukov et al. (2018) for
12+
partially linear regression models, partially linear instrumental variable
13+
regression models, interactive regression models and interactive
14+
instrumental variable regression models. DoubleML allows estimation of the
15+
nuisance parts in these models by machine learning methods and computation
16+
of the Neyman orthogonal score functions. DoubleML is built on top of mlr3
17+
and the mlr3 ecosystem. The object-oriented implementation of DoubleML that
18+
is based on the R6 package for R is very flexible.
1519
License: MIT + file LICENSE
1620
URL: https://github.com/DoubleML/doubleml-for-r/
1721
Encoding: UTF-8

R/datasets.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ make_plr_turrell2018 = function(n_obs = 100, dim_x = 20, theta = 0.5, return_typ
315315
#'
316316
#' with
317317
#'
318-
#' \eqn{\left(\begin{matrix} \varepsilon_i \\ u_i \\ \zeta_i \\ x_i \end{matrix} \right) \sim \mathcal{N}\left(0, \left(\begin{matrix} 1 & 0.6 & 0 & 0 \\ 0.6 & 1 & 0 & 0 \\ 0 & 0 & 0.25 I_{p_n^z} & 0 \\ 0 & 0 & 0 & \Sigma \end{matrix} \right) \right)}
318+
#' \eqn{\left(\begin{array}{c} \varepsilon_i \\ u_i \\ \zeta_i \\ x_i \end{array} \right) \sim \mathcal{N}\left(0, \left(\begin{array}{cccc} 1 & 0.6 & 0 & 0 \\ 0.6 & 1 & 0 & 0 \\ 0 & 0 & 0.25 I_{p_n^z} & 0 \\ 0 & 0 & 0 & \Sigma \end{array} \right) \right)}
319319
#'
320320
#' where \eqn{\Sigma} is a \eqn{p_n^x \times p_n^x} matrix with entries \eqn{\Sigma_{kj} = 0.5^{|j-k|}} and \eqn{I_{p_n^z}} is the \eqn{p^z_n \times p^z_n} identity matrix. \eqn{\beta=\gamma} iis a \eqn{p^x_n}-vector with entries \eqn{\beta_j = \frac{1}{j^2}}, \eqn{\delta} is a \eqn{p^z_n}-vector with entries \eqn{\delta_j = \frac{1}{j^2}} and \eqn{\Pi = (I_{p_n^z}, O_{p_n^z \times (p_n^x - p_n^z)})}.
321321
#'
@@ -483,9 +483,9 @@ make_irm_data = function(n_obs = 500, dim_x = 20, theta = 0, R2_d = 0.5, R2_y =
483483
#'
484484
#' \eqn{y_i = \theta d_i + x_i' \beta + u_i,}
485485
#'
486-
#' \eqn{Z \sim \text{Bernoulli}(0.5)} and
486+
#' \eqn{Z \sim \textstyle{Bernoulli} (0.5)} and
487487
#'
488-
#' \eqn{\left(\begin{matrix} u_i \\ v_i \end{matrix} \right) \sim \mathcal{N}\left(0, \left(\begin{matrix} 1 0.3 \\ 0.3 1 \end{matrix} \right) \right).}
488+
#' \eqn{\left(\begin{array}{c} u_i \\ v_i \end{array} \right) \sim \mathcal{N}\left(0, \left(\begin{array}{cc} 1 & 0.3 \\ 0.3 & 1 \end{array} \right) \right).}
489489
#'
490490
#' The covariates :\eqn{x_i \sim \mathcal{N}(0, \Sigma)}, where \eqn{\Sigma} is a matrix with entries
491491
#' \eqn{\Sigma_{kj} = 0.5^{|j-k|}} and \eqn{\beta} is a `dim_x`-vector with entries \eqn{\beta_j=\frac{1}{j^2}}.

R/double_ml_iivm.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
#'
1515
#' \eqn{Z = m_0(X) + V},
1616
#'
17-
#' with \eqn{\mathbb{E}[\zeta|X,Z]=0} and \eqn{\mathbb{E}[V|X] = 0}. \eqn{Y} is the outcome variable, \eqn{D \in \{0,1\}} is the binary treatment variable and \eqn{Z \in \{0,1\}} is a binary instrumental variable. Consider the functions \eqn{g_0}, \eqn{r_0} and \eqn{m_0}, where \eqn{g_0} maps the support of \eqn{(Z,X)} to \eqn{\mathbb{R}} and \eqn{r_0} and \eqn{m_0}, respectively, map the support of \eqn{(Z,X)} and \eqn{X} to \eqn{(\epsilon, 1-\epsilon)} for some \eqn{\epsilon \in (1, 1/2)}, such that
17+
#' with \eqn{E[\zeta|X,Z]=0} and \eqn{E[V|X] = 0}. \eqn{Y} is the outcome variable, \eqn{D \in \{0,1\}} is the binary treatment variable and \eqn{Z \in \{0,1\}} is a binary instrumental variable. Consider the functions \eqn{g_0}, \eqn{r_0} and \eqn{m_0}, where \eqn{g_0} maps the support of \eqn{(Z,X)} to \eqn{R} and \eqn{r_0} and \eqn{m_0}, respectively, map the support of \eqn{(Z,X)} and \eqn{X} to \eqn{(\epsilon, 1-\epsilon)} for some \eqn{\epsilon \in (1, 1/2)}, such that
1818
#'
1919
#' \eqn{Y = g_0(D,X) + \zeta,}
2020
#'
2121
#' \eqn{D = r_0(D,X) + U,}
2222
#'
2323
#' \eqn{Z = m_0(X) + V,}
2424
#'
25-
#' with \eqn{\mathbb{E}[\zeta|Z,X]=0}, \eqn{\mathbb{E}[U|Z,X]=0} and \eqn{\mathbb{E}[V|X]=0}. The target parameter of interest in this model is the local average treatment effect (LATE),
25+
#' with \eqn{E[\zeta|Z,X]=0}, \eqn{E[U|Z,X]=0} and \eqn{E[V|X]=0}. The target parameter of interest in this model is the local average treatment effect (LATE),
2626
#'
27-
#' \eqn{\theta_0 = \frac{\mathbb{E}[g_0(1,X)] - \mathbb{E}[g_0(0,X)]}{\mathbb{E}[r(1,X)] - \mathbb{E}[r(0,X)]}.}
27+
#' \eqn{\theta_0 = \frac{E[g_0(1,X)] - E[g_0(0,X)]}{E[r(1,X)] - E[r(0,X)]}.}
2828
#'
2929
#'
3030
#' @usage NULL
@@ -65,17 +65,17 @@ DoubleMLIIVM =R6:: R6Class("DoubleMLIIVM", inherit = DoubleML, public = list(
6565
#' @param ml_g ([`LearnerRegr`][mlr3::LearnerRegr], `character(1)`) \cr
6666
#' An object of the class [mlr3 regression learner][mlr3::LearnerRegr] to pass a learner, possibly with specified parameters, for example `lrn(regr.cv_glmnet, s = "lambda.min")`.
6767
#' Alternatively, a `character(1)` specifying the name of a [mlr3 regression learner][mlr3::LearnerRegr] that is available in [mlr3](https://mlr3.mlr-org.com/index.html) or its extension packages [mlr3learners](https://mlr3learners.mlr-org.com/) or [mlr3extralearners](https://mlr3extralearners.mlr-org.com/), for example `"regr.cv_glmnet"`. \cr
68-
#' `ml_g` refers to the nuisance function \eqn{g_0(Z,X) = \mathbb{E}[Y|X,Z]}.
68+
#' `ml_g` refers to the nuisance function \eqn{g_0(Z,X) = E[Y|X,Z]}.
6969
#'
7070
#' @param ml_m ([`LearnerClassif`][mlr3::LearnerClassif], `character(1)`) \cr
7171
#' An object of the class [mlr3 classification learner][mlr3::LearnerClassif] to pass a learner, possibly with specified parameters, for example `lrn(classif.cv_glmnet, s = "lambda.min")`.
7272
#' Alternatively, a `character(1)` specifying the name of a [mlr3 classification learner][mlr3::LearnerClassif] that is available in [mlr3](https://mlr3.mlr-org.com/index.html) or its extension packages [mlr3learners](https://mlr3learners.mlr-org.com/) or [mlr3extralearners](https://mlr3extralearners.mlr-org.com/), for example `"regr.cv_glmnet"`. \cr
73-
#' `ml_m` refers to the nuisance function \eqn{m_0(X) = \mathbb{E}[Z|X]}.
73+
#' `ml_m` refers to the nuisance function \eqn{m_0(X) = E[Z|X]}.
7474
#'
7575
#' @param ml_r ([`LearnerClassif`][mlr3::LearnerClassif], `character(1)`) \cr
7676
#' An object of the class [mlr3 classification learner][mlr3::LearnerClassif] to pass a learner, possibly with specified parameters, for example `lrn(classif.cv_glmnet, s = "lambda.min")`.
7777
#' Alternatively, a `character(1)` specifying the name of a [mlr3 classification learner][mlr3::LearnerClassif] that is available in [mlr3](https://mlr3.mlr-org.com/index.html) or its extension packages [mlr3learners](https://mlr3learners.mlr-org.com/) or [mlr3extralearners](https://mlr3extralearners.mlr-org.com/), for example `"regr.cv_glmnet"`. \cr
78-
#' `ml_r` refers to the nuisance function \eqn{r_0(Z,X) = \mathbb{E}[D|X,Z]}.
78+
#' `ml_r` refers to the nuisance function \eqn{r_0(Z,X) = E[D|X,Z]}.
7979
#'
8080
#' @param n_folds (`integer(1)`)\cr
8181
#' Number of folds. Default is `5`.

R/double_ml_irm.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
#'
1515
#' \eqn{D = m_0(X) + V},
1616
#'
17-
#' with \eqn{\mathbb{E}[U|X,D]=0} and \eqn{\mathbb{E}[V|X] = 0}. \eqn{Y} is the outcome variable and \eqn{D \in \{0,1\}} is the binary treatment variable. We consider estimation of the average treamtent effects when treatment effects are fully heterogeneous. Target parameters of interest in this model are the average treatment effect (ATE),
17+
#' with \eqn{E[U|X,D]=0} and \eqn{E[V|X] = 0}. \eqn{Y} is the outcome variable and \eqn{D \in \{0,1\}} is the binary treatment variable. We consider estimation of the average treamtent effects when treatment effects are fully heterogeneous. Target parameters of interest in this model are the average treatment effect (ATE),
1818
#'
19-
#' \eqn{\theta_0 = \mathbb{E}[g_0(1,X) - g_0(0,X)]}
19+
#' \eqn{\theta_0 = E[g_0(1,X) - g_0(0,X)]}
2020
#'
2121
#' and the average treament effect on the treated (ATTE),
2222
#'
23-
#' \eqn{\theta_0 = \mathbb{E}[g_0(1,X) - g_0(0,X)|D=1]}.
23+
#' \eqn{\theta_0 = E[g_0(1,X) - g_0(0,X)|D=1]}.
2424
#'
2525
#' @usage NULL
2626
#'
@@ -55,12 +55,12 @@ DoubleMLIRM = R6::R6Class("DoubleMLIRM", inherit = DoubleML, public = list(
5555
#' @param ml_g ([`LearnerRegr`][mlr3::LearnerRegr], `character(1)`) \cr
5656
#' An object of the class [mlr3 regression learner][mlr3::LearnerRegr] to pass a learner, possibly with specified parameters, for example `lrn(regr.cv_glmnet, s = "lambda.min")`.
5757
#' Alternatively, a `character(1)` specifying the name of a [mlr3 regression learner][mlr3::LearnerRegr] that is available in [mlr3](https://mlr3.mlr-org.com/index.html) or its extension packages [mlr3learners](https://mlr3learners.mlr-org.com/) or [mlr3extralearners](https://mlr3extralearners.mlr-org.com/), for example `"regr.cv_glmnet"`. \cr
58-
#' `ml_g` refers to the nuisance function \eqn{g_0(X) = \mathbb{E}[Y|X,D]}.
58+
#' `ml_g` refers to the nuisance function \eqn{g_0(X) = E[Y|X,D]}.
5959
#'
6060
#' @param ml_m ([`LearnerClassif`][mlr3::LearnerClassif], `character(1)`) \cr
6161
#' An object of the class [mlr3 classification learner][mlr3::LearnerClassif] to pass a learner, possibly with specified parameters, for example `lrn(classif.cv_glmnet, s = "lambda.min")`.
6262
#' Alternatively, a `character(1)` specifying the name of a [mlr3 classification learner][mlr3::LearnerClassif] that is available in [mlr3](https://mlr3.mlr-org.com/index.html) or its extension packages [mlr3learners](https://mlr3learners.mlr-org.com/) or [mlr3extralearners](https://mlr3extralearners.mlr-org.com/), for example `"regr.cv_glmnet"`. \cr
63-
#' `ml_m` refers to the nuisance function \eqn{m_0(X) = \mathbb{E}[D|X]}.
63+
#' `ml_m` refers to the nuisance function \eqn{m_0(X) = E[D|X]}.
6464
#'
6565
#' @param n_folds (`integer(1)`)\cr
6666
#' Number of folds. Default is `5`.

R/double_ml_pliv.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ DoubleMLPLIV = R6::R6Class("DoubleMLPLIV", inherit = DoubleML, public = list(
5050
#' @param ml_g ([`LearnerRegr`][mlr3::LearnerRegr], `character(1)`) \cr
5151
#' An object of the class [mlr3 regression learner][mlr3::LearnerRegr] to pass a learner, possibly with specified parameters, for example `lrn(regr.cv_glmnet, s = "lambda.min")`.
5252
#' Alternatively, a `character(1)` specifying the name of a [mlr3 regression learner][mlr3::LearnerRegr] that is available in [mlr3](https://mlr3.mlr-org.com/index.html) or its extension packages [mlr3learners](https://mlr3learners.mlr-org.com/) or [mlr3extralearners](https://mlr3extralearners.mlr-org.com/), for example `"regr.cv_glmnet"`. \cr
53-
#' `ml_g` refers to the nuisance function \eqn{g_0(X) = \mathbb{E}[Y|X]}.
53+
#' `ml_g` refers to the nuisance function \eqn{g_0(X) = E[Y|X]}.
5454
#'
5555
#' @param ml_m ([`LearnerRegr`][mlr3::LearnerRegr], `character(1)`) \cr
5656
#' An object of the class [mlr3 regression learner][mlr3::LearnerRegr] to pass a learner, possibly with specified parameters, for example `lrn(regr.cv_glmnet, s = "lambda.min")`.

R/double_ml_plr.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#'
1414
#' \eqn{D = m_0(X) + V,}
1515
#'
16-
#' with \eqn{\mathbb{E}[\zeta|D,X]=0} and \eqn{\mathbb{E}[V|X] = 0}. \eqn{Y} is the outcome variable variable and \eqn{D} is the policy variable of interest. The high-dimensional vector \eqn{X = (X_1, \ldots, X_p)} consists of other confounding covariates, and \eqn{\zeta} and \eqn{V} are stochastic errors.
16+
#' with \eqn{E[\zeta|D,X]=0} and \eqn{E[V|X] = 0}. \eqn{Y} is the outcome variable variable and \eqn{D} is the policy variable of interest. The high-dimensional vector \eqn{X = (X_1, \ldots, X_p)} consists of other confounding covariates, and \eqn{\zeta} and \eqn{V} are stochastic errors.
1717
#'
1818
#' @usage NULL
1919
#'
@@ -40,11 +40,11 @@ DoubleMLPLR = R6::R6Class("DoubleMLPLR", inherit = DoubleML, public = list(
4040
#' @param ml_g ([`LearnerRegr`][mlr3::LearnerRegr], `character(1)`,) \cr
4141
#' An object of the class [mlr3 regression learner][mlr3::LearnerRegr] to pass a learner, possibly with specified parameters, for example `lrn(regr.cv_glmnet, s = "lambda.min")`.
4242
#' Alternatively, a `character(1)` specifying the name of a [mlr3 regression learner][mlr3::LearnerRegr] that is available in [mlr3](https://mlr3.mlr-org.com/index.html) or its extension packages [mlr3learners](https://mlr3learners.mlr-org.com/) or [mlr3extralearners](https://mlr3extralearners.mlr-org.com/), for example `"regr.cv_glmnet"`. \cr
43-
#' `ml_g` refers to the nuisance function \eqn{g_0(X) = \mathbb{E}[Y|X]}.
43+
#' `ml_g` refers to the nuisance function \eqn{g_0(X) = E[Y|X]}.
4444
#'
4545
#' @param ml_m ([`LearnerRegr`][mlr3::LearnerRegr], `character(1)`,) \cr
4646
#' An object of the class [mlr3 regression learner][mlr3::LearnerRegr] to pass a learner, possibly with specified parameters, for example `lrn(regr.cv_glmnet, s = "lambda.min")`. Alternatively, a `character(1)` specifying the name of a [mlr3 regression learner][mlr3::LearnerRegr] that is available in [mlr3](https://mlr3.mlr-org.com/index.html) or its extension packages [mlr3learners](https://mlr3learners.mlr-org.com/) or [mlr3extralearners](https://mlr3extralearners.mlr-org.com/), for example `"regr.cv_glmnet"`. \cr
47-
#' `ml_m` refers to the nuisance function \eqn{m_0(X) = \mathbb{E}[D|X]}.
47+
#' `ml_m` refers to the nuisance function \eqn{m_0(X) = E[D|X]}.
4848

4949
#'
5050
#' @param n_folds (`integer(1)`)\cr

man/DoubleMLIIVM.Rd

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)