Double machine learning for partially linear regression models.

Format

R6::R6Class object inheriting from DoubleML.

Details

Partially linear regression (PLR) models take the form

\(Y = D\theta_0 + g_0(X) + \zeta,\)

\(D = m_0(X) + V,\)

with \(E[\zeta|D,X]=0\) and \(E[V|X] = 0\). \(Y\) is the outcome variable variable and \(D\) is the policy variable of interest. The high-dimensional vector \(X = (X_1, \ldots, X_p)\) consists of other confounding covariates, and \(\zeta\) and \(V\) are stochastic errors.

See also

Super class

DoubleML::DoubleML -> DoubleMLPLR

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.

Usage

DoubleMLPLR$new(
  data,
  ml_g,
  ml_m,
  n_folds = 5,
  n_rep = 1,
  score = "partialling out",
  dml_procedure = "dml2",
  draw_sample_splitting = TRUE,
  apply_cross_fitting = TRUE
)

Arguments

data

(DoubleMLData)
The DoubleMLData object providing the data and specifying the variables of the causal model.

ml_g

(LearnerRegr, character(1),)
An object of the class mlr3 regression learner 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 that is available in mlr3 or its extension packages mlr3learners or mlr3extralearners, for example "regr.cv_glmnet".
ml_g refers to the nuisance function \(g_0(X) = E[Y|X]\).

ml_m

(LearnerRegr, LearnerClassif, character(1),)
An object of the class mlr3 regression learner to pass a learner, possibly with specified parameters, for example lrn("regr.cv_glmnet", s = "lambda.min"). For binary treatment variables, an object of the class LearnerClassif can be passed, for example lrn("classif.cv_glmnet", s = "lambda.min"). Alternatively, a character(1) specifying the name of a mlr3 regression learner that is available in mlr3 or its extension packages mlr3learners or mlr3extralearners, for example "regr.cv_glmnet".
ml_m refers to the nuisance function \(m_0(X) = E[D|X]\).

n_folds

(integer(1))
Number of folds. Default is 5.

n_rep

(integer(1))
Number of repetitions for the sample splitting. Default is 1.

score

(character(1), function())
A character(1) ("partialling out" or IV-type) or a function() specifying the score function. If a function() is provided, it must be of the form function(y, d, g_hat, m_hat, smpls) and the returned output must be a named list() with elements psi_a and psi_b. Default is "partialling out".

dml_procedure

(character(1))
A character(1) ("dml1" or "dml2") specifying the double machine learning algorithm. Default is "dml2".

draw_sample_splitting

(logical(1))
Indicates whether the sample splitting should be drawn during initialization of the object. Default is TRUE.

apply_cross_fitting

(logical(1))
Indicates whether cross-fitting should be applied. Default is TRUE.


Method clone()

The objects of this class are cloneable with this method.

Usage

DoubleMLPLR$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# \donttest{ library(DoubleML) library(mlr3) library(mlr3learners) library(data.table) set.seed(2) ml_g = lrn("regr.ranger", num.trees = 10, max.depth = 2) ml_m = ml_g$clone() obj_dml_data = make_plr_CCDDHNR2018(alpha = 0.5) dml_plr_obj = DoubleMLPLR$new(obj_dml_data, ml_g, ml_m) dml_plr_obj$fit() dml_plr_obj$summary()
#> Estimates and significance testing of the effect of target variables #> Estimate. Std. Error t value Pr(>|t|) #> d 0.49142 0.03768 13.04 <2e-16 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #>
# } if (FALSE) { library(DoubleML) library(mlr3) library(mlr3learners) library(mlr3tuning) library(data.table) set.seed(2) ml_g = lrn("regr.rpart") ml_m = ml_g$clone() obj_dml_data = make_plr_CCDDHNR2018(alpha = 0.5) dml_plr_obj = DoubleMLPLR$new(obj_dml_data, ml_g, ml_m) param_grid = list( "ml_g" = paradox::ParamSet$new(list( paradox::ParamDbl$new("cp", lower = 0.01, upper = 0.02), paradox::ParamInt$new("minsplit", lower = 1, upper = 2))), "ml_m" = paradox::ParamSet$new(list( paradox::ParamDbl$new("cp", lower = 0.01, upper = 0.02), paradox::ParamInt$new("minsplit", lower = 1, upper = 2)))) # minimum requirements for tune_settings tune_settings = list( terminator = mlr3tuning::trm("evals", n_evals = 5), algorithm = mlr3tuning::tnr("grid_search", resolution = 5)) dml_plr_obj$tune(param_set = param_grid, tune_settings = tune_settings) dml_plr_obj$fit() dml_plr_obj$summary() }