med_bench.estimation.mediation_coefficient_product.CoefficientProduct#

Usage examples at the bottom of this page.

class CoefficientProduct(regularize: bool, **kwargs)[source]#

Coefficient Product estimatation method class

cross_fit_estimate(t, m, x, y, n_splits=1)#

Estimate causal effect on data with cross-fitting

Parameters:
  • array-like (y) – treatment value for each unit, binary

  • (n_samples) (shape) – treatment value for each unit, binary

  • array-like – mediator value for each unit, here m is necessary binary and uni- dimensional

  • (n_samples) – mediator value for each unit, here m is necessary binary and uni- dimensional

  • array-like – covariates (potential confounders) values

  • (n_samples (shape) – covariates (potential confounders) values

  • n_features_covariates) – covariates (potential confounders) values

  • array-like – outcome value for each unit, continuous

  • (n_samples) – outcome value for each unit, continuous

fit(t, m, x, y)[source]#

Fits nuisance parameters to data

Parameters:
  • array-like (y) – treatment value for each unit, binary

  • (n_samples) (shape) – treatment value for each unit, binary

  • array-like – mediator value for each unit, here m is necessary binary and uni- dimensional

  • (n_samples) – mediator value for each unit, here m is necessary binary and uni- dimensional

  • array-like – covariates (potential confounders) values

  • (n_samples (shape) – covariates (potential confounders) values

  • n_features_covariates) – covariates (potential confounders) values

  • array-like – outcome value for each unit, continuous

  • (n_samples) – outcome value for each unit, continuous