nnpiv.semiparametrics.DML_mediated

class nnpiv.semiparametrics.DML_mediated(Y, D, M, W, Z, X1=None, V=None, v_values=None, include_V=True, ci_type='pointwise', loc_kernel='gau', bw_loc='silverman', estimator='MR', estimand='ATE', model1=<nnpiv.rkhs.rkhs2iv.RKHS2IVL2 object>, nn_1=False, modelq1=<nnpiv.rkhs.rkhs2iv.RKHS2IVL2 object>, nn_q1=False, model_y=<nnpiv.rkhs.rkhsiv.ApproxRKHSIVCV object>, nn_y=False, model_a=<nnpiv.rkhs.rkhsiv.ApproxRKHSIVCV object>, nn_a=False, alpha=0.05, n_folds=5, n_rep=1, inner_n_jobs=None, random_seed=123, prop_score=sklearn.linear_model.LogisticRegression, CHIM=False, verbose=True, fitargs1=None, fitargsq1=None, fitargsy=None, fitargsa=None, opts=None)[source]

Debiased Machine Learning for mediation analysis (DML-mediation) class with joint/sequential model fitting.

Parameters
  • Y (array-like) – Outcome variable.

  • D (array-like) – Treatment variable.

  • M (array-like) – Mediator variable.

  • W (array-like) – Negative control outcome.

  • Z (array-like) – Instrumental variable.

  • X1 (array-like, optional) – Additional covariates.

  • V (array-like, optional) – Localization covariates.

  • v_values (array-like, optional) – Values for localization.

  • include_V (bool, optional) – Include localization covariates in the model.

  • ci_type (str, optional) – Type of confidence interval (‘pointwise’, ‘uniform’).

  • loc_kernel (str, optional) – Kernel for localization. Options include ‘gau’, ‘epa’, ‘uni’, ‘tri’, etc.

  • bw_loc (str, optional) – Bandwidth for localization.

  • estimator (str, optional) – Estimator type (‘MR’, ‘OR’, ‘hybrid’, ‘IPW’).

  • estimand (str, optional) – Type of estimand (‘ATE’, ‘Indirect’, ‘Direct’, ‘E[Y1]’, ‘E[Y0]’, ‘E[Y(1,M(0))]’).

  • model1 (estimator /(list), optional) – Model for the outcome stage - Can be a joint or sequential estimator; if the latter a list must be given

  • nn_1 (bool /(list), optional) – Use neural network for the outcome stage.

  • modelq1 (estimator /(list), optional) – Model for the q1 stage - Can be a joint or sequential estimator; if the latter a list must be given

  • nn_q1 (bool /(list), optional) – Use neural network for the q1 stage.

  • model_y (estimator, optional) – Model for the outcome - for use with ‘E[Y1]’, ‘E[Y0]’, ‘Direct’, ‘Indirect’, and ‘ATE’ estimands.

  • nn_y (bool, optional) – Use neural network for the outcome model.

  • model_a (estimator, optional) – Model for the action - for use with ‘E[Y1]’, ‘E[Y0]’, ‘Direct’, ‘Indirect’, and ‘ATE’ estimands.

  • nn_a (bool, optional) – Use neural network for the action model.

  • alpha (float, optional) – Significance level for confidence intervals.

  • n_folds (int, optional) – Number of folds for estimation.

  • n_rep (int, optional) – Number of repetitions for estimation.

  • inner_n_jobs (int, optional) – Number of parallel jobs for inner fold processing. If None, defaults to min(n_folds, available_cores).

  • random_seed (int, optional) – Seed for random number generator.

  • prop_score (estimator, optional) – Model for propensity score.

  • CHIM (bool, optional) – Use CHIM method: Dropping observations with extreme values of the propensity score - CHIM (2009)

  • verbose (bool, optional) – Print progress information.

  • fitargs1 (dict, optional) – Arguments for fitting the outcome stage model.

  • fitargsq1 (dict, optional) – Arguments for fitting the q1 stage model.

  • fitargsy (dict, optional) – Arguments for fitting the one stage outcome model.

  • fitargsa (dict, optional) – Arguments for fitting the one stage action model.

  • opts (dict, optional) – Additional options.