causalis.scenarios.cuped.dgp¶
Module Contents¶
Functions¶
Gold standard Tweedie-like DGP with mixed marginals and structured HTE. Features many zeros and a heavy right tail. Includes two pre-period covariates by default: ‘y_pre’ and ‘y_pre_2’. Wrapper for make_tweedie(). |
|
Binary CUPED benchmark with richer confounders and structured HTE. Includes a calibrated pre-period covariate ‘y_pre’ by default. Wrapper for generate_cuped_binary(). |
API¶
- causalis.scenarios.cuped.dgp.generate_cuped_tweedie_26(n: int = 20000, seed: int = 42, add_pre: bool = True, pre_name: str = 'y_pre', pre_name_2: Optional[str] = None, pre_target_corr: float = 0.82, pre_target_corr_2: Optional[float] = None, pre_spec: Optional[causalis.dgp.causaldata.preperiod.PreCorrSpec] = None, include_oracle: bool = False, return_causal_data: bool = True, theta_log: float = 0.38) Union[pandas.DataFrame, causalis.dgp.causaldata.CausalData]¶
Gold standard Tweedie-like DGP with mixed marginals and structured HTE. Features many zeros and a heavy right tail. Includes two pre-period covariates by default: ‘y_pre’ and ‘y_pre_2’. Wrapper for make_tweedie().
Parameters
n : int, default=10000 Number of samples to generate. seed : int, default=42 Random seed. add_pre : bool, default=True Whether to add pre-period covariates. pre_name : str, default=”y_pre” Name of the first pre-period covariate column. pre_name_2 : str, optional Name of the second pre-period covariate column. Defaults to
f"{pre_name}_2". pre_target_corr : float, default=0.82 Target correlation between the first pre covariate and post-outcome y in control group. pre_target_corr_2 : float, optional Target correlation for the second pre covariate. Defaults to a moderate value based onpre_target_corrto reduce collinearity. pre_spec : PreCorrSpec, optional Detailed specification for pre-period calibration (transform, method, etc.). include_oracle : bool, default=False Whether to include oracle ground-truth columns like ‘cate’, ‘propensity’, etc. return_causal_data : bool, default=True Whether to return a CausalData object. theta_log : float, default=0.38 The log-uplift theta parameter for the treatment effect.Returns
pd.DataFrame or CausalData
- causalis.scenarios.cuped.dgp.make_cuped_binary_26(n: int = 10000, seed: int = 42, add_pre: bool = True, pre_name: str = 'y_pre', pre_target_corr: float = 0.65, pre_spec: Optional[causalis.dgp.causaldata.preperiod.PreCorrSpec] = None, include_oracle: bool = True, return_causal_data: bool = True, theta_logit: float = 0.38) Union[pandas.DataFrame, causalis.dgp.causaldata.CausalData]¶
Binary CUPED benchmark with richer confounders and structured HTE. Includes a calibrated pre-period covariate ‘y_pre’ by default. Wrapper for generate_cuped_binary().
Parameters
n : int, default=10000 Number of samples to generate. seed : int, default=42 Random seed. add_pre : bool, default=True Whether to add a pre-period covariate ‘y_pre’. pre_name : str, default=”y_pre” Name of the pre-period covariate column. pre_target_corr : float, default=0.65 Target correlation between y_pre and post-outcome y in the control group. pre_spec : PreCorrSpec, optional Detailed specification for pre-period calibration (transform, method, etc.). include_oracle : bool, default=True Whether to include oracle columns like ‘cate’, ‘g0’, and ‘g1’. return_causal_data : bool, default=True Whether to return a CausalData object. theta_logit : float, default=0.38 Baseline log-odds uplift scale for heterogeneous treatment effects.
Returns
pd.DataFrame or CausalData