diff --git a/.github/workflows/plr_sim.yml b/.github/workflows/plr_sim.yml index 20c61bfd..128f66cc 100644 --- a/.github/workflows/plr_sim.yml +++ b/.github/workflows/plr_sim.yml @@ -21,6 +21,7 @@ jobs: 'scripts/plm/plr_ate_sensitivity.py', 'scripts/plm/plr_cate.py', 'scripts/plm/plr_gate.py', + 'scripts/plm/lplr_ate.py', ] steps: diff --git a/.gitignore b/.gitignore index 24f7c5cc..93d4dfaf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ __pycache__/ +.idea/ # Logs monte-cover/logs/ diff --git a/doc/_quarto-dev.yml b/doc/_quarto-dev.yml index 5c3587ab..b73319b3 100644 --- a/doc/_quarto-dev.yml +++ b/doc/_quarto-dev.yml @@ -21,6 +21,7 @@ website: - plm/plr_gate.qmd - plm/plr_cate.qmd - plm/pliv.qmd + - plm/lplr.qmd # DID - did/did_pa.qmd - did/did_cs.qmd diff --git a/doc/_website.yml b/doc/_website.yml index 4bf06b85..b497b601 100644 --- a/doc/_website.yml +++ b/doc/_website.yml @@ -24,6 +24,7 @@ website: - plm/plr.qmd - plm/plr_gate.qmd - plm/plr_cate.qmd + - plm/lplr.qmd - plm/pliv.qmd - text: "DID" menu: diff --git a/doc/plm/lplr.qmd b/doc/plm/lplr.qmd new file mode 100644 index 00000000..b310ce17 --- /dev/null +++ b/doc/plm/lplr.qmd @@ -0,0 +1,113 @@ +--- +title: "Logistic PLR Models" + +jupyter: python3 +--- + +```{python} +#| echo: false + +import numpy as np +import pandas as pd +from itables import init_notebook_mode +import os +import sys + +doc_dir = os.path.abspath(os.path.join(os.getcwd(), "..")) +if doc_dir not in sys.path: + sys.path.append(doc_dir) + +from utils.style_tables import generate_and_show_styled_table + +init_notebook_mode(all_interactive=True) +``` + +## ATE Coverage + +The simulations are based on the the [make_lplr_LZZ2020](https://docs.doubleml.org/stable/api/generated/doubleml.plm.datasets.make_lplr_LZZ2020.html)-DGP with $500$ observations. + +::: {.callout-note title="Metadata" collapse="true"} + +```{python} +#| echo: false +metadata_file = '../../results/plm/lplr_ate_metadata.csv' +metadata_df = pd.read_csv(metadata_file) +print(metadata_df.T.to_string(header=False)) +``` + +::: + +```{python} +#| echo: false + +# set up data and rename columns +df_coverage = pd.read_csv("../../results/plm/lplr_ate_coverage.csv", index_col=None) + +if "repetition" in df_coverage.columns and df_coverage["repetition"].nunique() == 1: + n_rep_coverage = df_coverage["repetition"].unique()[0] +elif "n_rep" in df_coverage.columns and df_coverage["n_rep"].nunique() == 1: + n_rep_coverage = df_coverage["n_rep"].unique()[0] +else: + n_rep_coverage = "N/A" # Fallback if n_rep cannot be determined + +display_columns_coverage = ["Learner m", "Learner M", "Learner t", "Bias", "CI Length", "Coverage"] +``` + +### Nuisance space + +```{python} +# | echo: false + +generate_and_show_styled_table( + main_df=df_coverage, + filters={"level": 0.95, "Score": "nuisance_space"}, + display_cols=display_columns_coverage, + n_rep=n_rep_coverage, + level_col="level", +# rename_map={"Learner g": "Learner l"}, + coverage_highlight_cols=["Coverage"] +) +``` + +```{python} +#| echo: false + +generate_and_show_styled_table( + main_df=df_coverage, + filters={"level": 0.9, "Score": "nuisance_space"}, + display_cols=display_columns_coverage, + n_rep=n_rep_coverage, + level_col="level", +# rename_map={"Learner g": "Learner l"}, + coverage_highlight_cols=["Coverage"] +) +``` + +### Instrument + + +```{python} +#| echo: false + +generate_and_show_styled_table( + main_df=df_coverage, + filters={"level": 0.95, "Score": "instrument"}, + display_cols=display_columns_coverage, + n_rep=n_rep_coverage, + level_col="level", + coverage_highlight_cols=["Coverage"] +) +``` + +```{python} +#| echo: false + +generate_and_show_styled_table( + main_df=df_coverage, + filters={"level": 0.9, "Score": "instrument"}, + display_cols=display_columns_coverage, + n_rep=n_rep_coverage, + level_col="level", + coverage_highlight_cols=["Coverage"] +) +``` diff --git a/monte-cover/src/montecover/plm/__init__.py b/monte-cover/src/montecover/plm/__init__.py index 167b36d8..5d995c92 100644 --- a/monte-cover/src/montecover/plm/__init__.py +++ b/monte-cover/src/montecover/plm/__init__.py @@ -5,6 +5,7 @@ from montecover.plm.plr_ate_sensitivity import PLRATESensitivityCoverageSimulation from montecover.plm.plr_cate import PLRCATECoverageSimulation from montecover.plm.plr_gate import PLRGATECoverageSimulation +from montecover.plm.lplr_ate import LPLRATECoverageSimulation __all__ = [ "PLRATECoverageSimulation", @@ -12,4 +13,5 @@ "PLRGATECoverageSimulation", "PLRCATECoverageSimulation", "PLRATESensitivityCoverageSimulation", + "LPLRATECoverageSimulation", ] diff --git a/monte-cover/src/montecover/plm/lplr_ate.py b/monte-cover/src/montecover/plm/lplr_ate.py new file mode 100644 index 00000000..da962e32 --- /dev/null +++ b/monte-cover/src/montecover/plm/lplr_ate.py @@ -0,0 +1,126 @@ +import warnings +from typing import Any, Dict, Optional + +import doubleml as dml +from doubleml.plm.datasets import make_lplr_LZZ2020 + +from montecover.base import BaseSimulation +from montecover.utils import create_learner_from_config + + +class LPLRATECoverageSimulation(BaseSimulation): + """Simulation class for coverage properties of DoubleMLPLR for ATE estimation.""" + + def __init__( + self, + config_file: str, + suppress_warnings: bool = True, + log_level: str = "INFO", + log_file: Optional[str] = None, + use_failed_scores: bool = False, + ): + super().__init__( + config_file=config_file, + suppress_warnings=suppress_warnings, + log_level=log_level, + log_file=log_file, + ) + + # Calculate oracle values + self._calculate_oracle_values() + + self._use_failed_scores = use_failed_scores + + def _process_config_parameters(self): + """Process simulation-specific parameters from config""" + # Process ML models in parameter grid + assert "learners" in self.dml_parameters, "No learners specified in the config file" + + required_learners = ["ml_m", "ml_M", "ml_t"] + for learner in self.dml_parameters["learners"]: + for ml in required_learners: + assert ml in learner, f"No {ml} specified in the config file" + + def _calculate_oracle_values(self): + """Calculate oracle values for the simulation.""" + self.logger.info("Calculating oracle values") + + self.oracle_values = dict() + self.oracle_values["theta"] = self.dgp_parameters["theta"] + + def run_single_rep(self, dml_data, dml_params) -> Dict[str, Any]: + """Run a single repetition with the given parameters.""" + # Extract parameters + learner_config = dml_params["learners"] + learner_m_name, ml_m = create_learner_from_config(learner_config["ml_m"]) + learner_M_name, ml_M = create_learner_from_config(learner_config["ml_M"]) + learner_t_name, ml_t = create_learner_from_config(learner_config["ml_t"]) + score = dml_params["score"] + + # Model + dml_model = dml.DoubleMLLPLR( + obj_dml_data=dml_data, + ml_m=ml_m, + ml_M=ml_M, + ml_t=ml_t, + score=score, + error_on_convergence_failure= not self._use_failed_scores,) + + try: + dml_model.fit() + except RuntimeError as e: + self.logger.info(f"Exception during fit: {e}") + return None + + result = { + "coverage": [], + } + for level in self.confidence_parameters["level"]: + level_result = dict() + level_result["coverage"] = self._compute_coverage( + thetas=dml_model.coef, + oracle_thetas=self.oracle_values["theta"], + confint=dml_model.confint(level=level), + joint_confint=None, + ) + + # add parameters to the result + for res in level_result.values(): + res.update( + { + "Learner m": learner_m_name, + "Learner M": learner_M_name, + "Learner t": learner_t_name, + "Score": score, + "level": level, + } + ) + for key, res in level_result.items(): + result[key].append(res) + + return result + + def summarize_results(self): + """Summarize the simulation results.""" + self.logger.info("Summarizing simulation results") + + # Group by parameter combinations + groupby_cols = ["Learner m", "Learner M", "Learner t", "Score", "level"] + aggregation_dict = { + "Coverage": "mean", + "CI Length": "mean", + "Bias": "mean", + "repetition": "count", + } + + # Aggregate results (possibly multiple result dfs) + result_summary = dict() + for result_name, result_df in self.results.items(): + result_summary[result_name] = result_df.groupby(groupby_cols).agg(aggregation_dict).reset_index() + self.logger.debug(f"Summarized {result_name} results") + + return result_summary + + def _generate_dml_data(self, dgp_params) -> dml.DoubleMLData: + """Generate data for the simulation.""" + return make_lplr_LZZ2020(**dgp_params) diff --git a/results/plm/lplr_ate_config.yml b/results/plm/lplr_ate_config.yml new file mode 100644 index 00000000..c7cf40d2 --- /dev/null +++ b/results/plm/lplr_ate_config.yml @@ -0,0 +1,55 @@ +simulation_parameters: + repetitions: 500 + max_runtime: 19800 + random_seed: 42 + n_jobs: -2 +dgp_parameters: + theta: + - 0.5 + n_obs: + - 500 + dim_x: + - 20 +learner_definitions: + lasso: &id001 + name: LassoCV + logistic: &id002 + name: Logistic + rf: &id003 + name: RF Regr. + params: + n_estimators: 100 + max_features: sqrt + rf-class: &id004 + name: RF Clas. + params: + n_estimators: 100 + max_features: sqrt + lgbm: &id005 + name: LGBM Regr. + params: + n_estimators: 500 + learning_rate: 0.01 + lgbm-class: &id006 + name: LGBM Clas. + params: + n_estimators: 500 + learning_rate: 0.01 +dml_parameters: + learners: + - ml_m: *id001 + ml_M: *id002 + ml_t: *id001 + - ml_m: *id003 + ml_M: *id004 + ml_t: *id003 + - ml_m: *id005 + ml_M: *id006 + ml_t: *id005 + score: + - nuisance_space + - instrument +confidence_parameters: + level: + - 0.95 + - 0.9 diff --git a/results/plm/lplr_ate_coverage.csv b/results/plm/lplr_ate_coverage.csv new file mode 100644 index 00000000..29c3a423 --- /dev/null +++ b/results/plm/lplr_ate_coverage.csv @@ -0,0 +1,13 @@ +Learner m,Learner M,Learner t,Score,level,Coverage,CI Length,Bias,repetition +LGBM Regr.,LGBM Clas.,LGBM Regr.,instrument,0.9,0.872,0.6540916267945179,0.17501445022837125,500 +LGBM Regr.,LGBM Clas.,LGBM Regr.,instrument,0.95,0.928,0.7793982455949509,0.17501445022837125,500 +LGBM Regr.,LGBM Clas.,LGBM Regr.,nuisance_space,0.9,0.88,0.598241346108922,0.15586913796966942,500 +LGBM Regr.,LGBM Clas.,LGBM Regr.,nuisance_space,0.95,0.946,0.7128485314583201,0.15586913796966942,500 +LassoCV,Logistic,LassoCV,instrument,0.9,0.856,0.5890452894815547,0.16482024691605957,500 +LassoCV,Logistic,LassoCV,instrument,0.95,0.924,0.7018907541253692,0.16482024691605957,500 +LassoCV,Logistic,LassoCV,nuisance_space,0.9,0.868,0.5820699058557912,0.1507959338822808,500 +LassoCV,Logistic,LassoCV,nuisance_space,0.95,0.93,0.6935790718815301,0.1507959338822808,500 +RF Regr.,RF Clas.,RF Regr.,instrument,0.9,0.884,0.39484117997902796,0.09883032061915417,500 +RF Regr.,RF Clas.,RF Regr.,instrument,0.95,0.95,0.4704822846799266,0.09883032061915417,500 +RF Regr.,RF Clas.,RF Regr.,nuisance_space,0.9,0.886,0.38499391911236014,0.09772003875711463,500 +RF Regr.,RF Clas.,RF Regr.,nuisance_space,0.95,0.94,0.45874854963578754,0.09772003875711463,500 diff --git a/results/plm/lplr_ate_metadata.csv b/results/plm/lplr_ate_metadata.csv new file mode 100644 index 00000000..52735907 --- /dev/null +++ b/results/plm/lplr_ate_metadata.csv @@ -0,0 +1,2 @@ +DoubleML Version,Script,Date,Total Runtime (minutes),Python Version,Config File +0.11.dev0,LPLRATECoverageSimulation,2025-11-18 03:13,39.79484195311864,3.12.9,scripts/plm/lplr_ate_config.yml diff --git a/results/plm/plr_ate_coverage.csv b/results/plm/plr_ate_coverage.csv index 3c1b8166..3472d852 100644 --- a/results/plm/plr_ate_coverage.csv +++ b/results/plm/plr_ate_coverage.csv @@ -1,29 +1,29 @@ Learner g,Learner m,Score,level,Coverage,CI Length,Bias,repetition -LGBM Regr.,LGBM Regr.,IV-type,0.9,0.901,0.1600886964717691,0.03825459741300921,1000 -LGBM Regr.,LGBM Regr.,IV-type,0.95,0.954,0.1907574475171759,0.03825459741300921,1000 -LGBM Regr.,LGBM Regr.,partialling out,0.9,0.852,0.1472338725724203,0.04033882206093188,1000 -LGBM Regr.,LGBM Regr.,partialling out,0.95,0.907,0.17543998007964826,0.04033882206093188,1000 -LGBM Regr.,LassoCV,IV-type,0.9,0.897,0.14893931259851462,0.03581322542672391,1000 -LGBM Regr.,LassoCV,IV-type,0.95,0.944,0.17747213721154637,0.03581322542672391,1000 -LGBM Regr.,LassoCV,partialling out,0.9,0.919,0.15954274114692812,0.036771169423404644,1000 -LGBM Regr.,LassoCV,partialling out,0.95,0.965,0.1901069016228039,0.036771169423404644,1000 -LassoCV,LGBM Regr.,IV-type,0.9,0.909,0.15087501797235597,0.03579426387662549,1000 -LassoCV,LGBM Regr.,IV-type,0.95,0.962,0.17977867242856824,0.03579426387662549,1000 -LassoCV,LGBM Regr.,partialling out,0.9,0.5,0.13938134605639943,0.0716306212080508,1000 -LassoCV,LGBM Regr.,partialling out,0.95,0.637,0.16608311761671207,0.0716306212080508,1000 -LassoCV,LassoCV,IV-type,0.9,0.903,0.14017731757203095,0.03335306344342395,1000 -LassoCV,LassoCV,IV-type,0.95,0.949,0.16703157617727646,0.03335306344342395,1000 -LassoCV,LassoCV,partialling out,0.9,0.913,0.1470503863434512,0.03311342390288956,1000 -LassoCV,LassoCV,partialling out,0.95,0.962,0.1752213427525658,0.03311342390288956,1000 -LassoCV,RF Regr.,IV-type,0.9,0.872,0.13067781887808327,0.03371461104404601,1000 -LassoCV,RF Regr.,IV-type,0.95,0.929,0.15571222532061083,0.03371461104404601,1000 -LassoCV,RF Regr.,partialling out,0.9,0.779,0.1433760406549323,0.04587343436600307,1000 -LassoCV,RF Regr.,partialling out,0.95,0.879,0.17084308981975366,0.04587343436600307,1000 -RF Regr.,LassoCV,IV-type,0.9,0.906,0.1414322610744008,0.03340307522412499,1000 -RF Regr.,LassoCV,IV-type,0.95,0.95,0.16852693359204907,0.03340307522412499,1000 -RF Regr.,LassoCV,partialling out,0.9,0.91,0.15082186132541758,0.03461629259435052,1000 -RF Regr.,LassoCV,partialling out,0.95,0.963,0.17971533237700918,0.03461629259435052,1000 -RF Regr.,RF Regr.,IV-type,0.9,0.87,0.13172986702290923,0.03443723399705047,1000 -RF Regr.,RF Regr.,IV-type,0.95,0.931,0.15696581800513595,0.03443723399705047,1000 -RF Regr.,RF Regr.,partialling out,0.9,0.917,0.1427041207685971,0.03381092461795716,1000 -RF Regr.,RF Regr.,partialling out,0.95,0.955,0.1700424478926333,0.03381092461795716,1000 +LGBM Regr.,LGBM Regr.,IV-type,0.9,0.863,0.1596875004155196,0.04190692285022562,1000 +LGBM Regr.,LGBM Regr.,IV-type,0.95,0.927,0.19027939293036994,0.04190692285022562,1000 +LGBM Regr.,LGBM Regr.,partialling out,0.9,0.82,0.14673790477408832,0.04274003558423509,1000 +LGBM Regr.,LGBM Regr.,partialling out,0.95,0.882,0.1748489979969301,0.04274003558423509,1000 +LGBM Regr.,LassoCV,IV-type,0.9,0.864,0.14850767996959235,0.039302736245328145,1000 +LGBM Regr.,LassoCV,IV-type,0.95,0.927,0.176957815211474,0.039302736245328145,1000 +LGBM Regr.,LassoCV,partialling out,0.9,0.882,0.15900684464932308,0.04075159325722853,1000 +LGBM Regr.,LassoCV,partialling out,0.95,0.932,0.189468341560354,0.04075159325722853,1000 +LassoCV,LGBM Regr.,IV-type,0.9,0.868,0.15035462431781724,0.03885008673020529,1000 +LassoCV,LGBM Regr.,IV-type,0.95,0.937,0.17915858514300867,0.03885008673020529,1000 +LassoCV,LGBM Regr.,partialling out,0.9,0.492,0.13884592445719834,0.0709498471401035,1000 +LassoCV,LGBM Regr.,partialling out,0.95,0.612,0.16544512343061302,0.0709498471401035,1000 +LassoCV,LassoCV,IV-type,0.9,0.869,0.13981178087085014,0.03694061273543505,1000 +LassoCV,LassoCV,IV-type,0.95,0.93,0.16659601233280855,0.03694061273543505,1000 +LassoCV,LassoCV,partialling out,0.9,0.883,0.14670738716893747,0.03669884399866198,1000 +LassoCV,LassoCV,partialling out,0.95,0.944,0.17481263402751057,0.03669884399866198,1000 +LassoCV,RF Regr.,IV-type,0.9,0.835,0.1302896143924338,0.03725192920475538,1000 +LassoCV,RF Regr.,IV-type,0.95,0.904,0.15524965114498646,0.03725192920475538,1000 +LassoCV,RF Regr.,partialling out,0.9,0.777,0.14256373927301522,0.046784627261935774,1000 +LassoCV,RF Regr.,partialling out,0.95,0.862,0.1698751730233513,0.046784627261935774,1000 +RF Regr.,LassoCV,IV-type,0.9,0.871,0.14106017506402294,0.036864349901817875,1000 +RF Regr.,LassoCV,IV-type,0.95,0.938,0.1680835657643333,0.036864349901817875,1000 +RF Regr.,LassoCV,partialling out,0.9,0.884,0.15071292176789794,0.03856536256116802,1000 +RF Regr.,LassoCV,partialling out,0.95,0.934,0.1795855228877442,0.03856536256116802,1000 +RF Regr.,RF Regr.,IV-type,0.9,0.83,0.13156454943211618,0.037590451309181865,1000 +RF Regr.,RF Regr.,IV-type,0.95,0.902,0.15676882994573899,0.037590451309181865,1000 +RF Regr.,RF Regr.,partialling out,0.9,0.875,0.14232152273160326,0.037118739561801554,1000 +RF Regr.,RF Regr.,partialling out,0.95,0.934,0.1695865542126264,0.037118739561801554,1000 diff --git a/results/plm/plr_ate_metadata.csv b/results/plm/plr_ate_metadata.csv index 5e6a9eab..50efb048 100644 --- a/results/plm/plr_ate_metadata.csv +++ b/results/plm/plr_ate_metadata.csv @@ -1,2 +1,2 @@ DoubleML Version,Script,Date,Total Runtime (minutes),Python Version,Config File -0.11.dev0,PLRATECoverageSimulation,2025-09-08 09:49,191.29596571127573,3.12.3,scripts/plm/plr_ate_config.yml +0.11.dev0,PLRATECoverageSimulation,2025-11-17 11:56,194.01051502227784,3.12.3,scripts/plm/plr_ate_config.yml diff --git a/results/plm/plr_ate_sensitivity_coverage.csv b/results/plm/plr_ate_sensitivity_coverage.csv index 43da6710..e37ff825 100644 --- a/results/plm/plr_ate_sensitivity_coverage.csv +++ b/results/plm/plr_ate_sensitivity_coverage.csv @@ -1,29 +1,29 @@ Learner g,Learner m,Score,level,Coverage,CI Length,Bias,Coverage (Lower),Coverage (Upper),RV,RVa,Bias (Lower),Bias (Upper),repetition -LGBM Regr.,LGBM Regr.,IV-type,0.9,0.368,1.4130276149295062,0.7776955695629277,1.0,0.982,0.10569278411287723,0.03437123296145821,1.4768525799432917,0.2832048367486087,1000 -LGBM Regr.,LGBM Regr.,IV-type,0.95,0.563,1.6837262532321802,0.7776955695629277,1.0,0.998,0.10569278411287723,0.019957945209223452,1.4768525799432917,0.2832048367486087,1000 -LGBM Regr.,LGBM Regr.,partialling out,0.9,0.197,1.1036170641107683,0.7533205172861593,1.0,0.958,0.10286020512445486,0.04477468564587913,1.4517378970695347,0.2701072971745142,1000 -LGBM Regr.,LGBM Regr.,partialling out,0.95,0.328,1.3150408418953825,0.7533205172861593,1.0,0.99,0.10286020512445486,0.03092531289089865,1.4517378970695347,0.2701072971745142,1000 -LGBM Regr.,LassoCV,IV-type,0.9,0.014,1.5210602294429545,1.4722376739129348,1.0,0.342,0.187052732232324,0.11154145891103627,2.206841524080496,0.739838040136095,1000 -LGBM Regr.,LassoCV,IV-type,0.95,0.04,1.8124550532497785,1.4722376739129348,1.0,0.575,0.187052732232324,0.09125786643830988,2.206841524080496,0.739838040136095,1000 -LGBM Regr.,LassoCV,partialling out,0.9,0.034,1.5172192685496437,1.3331950868658557,1.0,0.531,0.17262748934729075,0.09662159553237581,2.0626429964650645,0.6088611336020913,1000 -LGBM Regr.,LassoCV,partialling out,0.95,0.078,1.8078782660551218,1.3331950868658557,1.0,0.762,0.17262748934729075,0.07659278737534501,2.0626429964650645,0.6088611336020913,1000 -LassoCV,LGBM Regr.,IV-type,0.9,0.727,2.5003353511715347,1.0260691972678968,1.0,1.0,0.06857830803361809,0.011046690191865164,2.5350733610969094,0.5855739867516375,1000 -LassoCV,LGBM Regr.,IV-type,0.95,0.914,2.979333332322765,1.0260691972678968,1.0,1.0,0.06857830803361809,0.0035042749813071943,2.5350733610969094,0.5855739867516375,1000 -LassoCV,LGBM Regr.,partialling out,0.9,0.615,1.973225997239198,0.9037599801630222,1.0,1.0,0.06019148976457814,0.012246879030501567,2.4255092285847315,0.6577299295472866,1000 -LassoCV,LGBM Regr.,partialling out,0.95,0.843,2.3512437973674243,0.9037599801630222,1.0,1.0,0.06019148976457814,0.004551378899486863,2.4255092285847315,0.6577299295472866,1000 -LassoCV,LassoCV,IV-type,0.9,0.0,2.5820016214137116,4.838779530934393,1.0,0.0,0.28187825138701833,0.22320708072953266,6.368225438871106,3.30933362299768,1000 -LassoCV,LassoCV,IV-type,0.95,0.0,3.0766446953545254,4.838779530934393,1.0,0.003,0.28187825138701833,0.206643225402766,6.368225438871106,3.30933362299768,1000 -LassoCV,LassoCV,partialling out,0.9,0.0,2.5944192749771635,4.839449418123379,1.0,0.0,0.28195693686484097,0.22305576047709652,6.368580044140921,3.310318792105836,1000 -LassoCV,LassoCV,partialling out,0.95,0.0,3.0914412422071287,4.839449418123379,1.0,0.002,0.28195693686484097,0.20641944500724754,6.368580044140921,3.310318792105836,1000 -LassoCV,RF Regr.,IV-type,0.9,0.034,2.2222779007979443,1.7226837360974696,1.0,0.995,0.10364150401296536,0.05138172074220209,3.374968636682733,0.32715566226404,1000 -LassoCV,RF Regr.,IV-type,0.95,0.103,2.64800744445314,1.7226837360974696,1.0,1.0,0.10364150401296536,0.037132422693584015,3.374968636682733,0.32715566226404,1000 -LassoCV,RF Regr.,partialling out,0.9,0.035,2.2533857956321035,1.6792356777739657,1.0,1.0,0.09954267183056487,0.047435746708649605,3.3588540806778853,0.30700691066074626,1000 -LassoCV,RF Regr.,partialling out,0.95,0.11,2.6850747874135052,1.6792356777739657,1.0,1.0,0.09954267183056487,0.0333052565732053,3.3588540806778853,0.30700691066074626,1000 -RF Regr.,LassoCV,IV-type,0.9,0.0,1.9800532348609368,2.5041605666150644,1.0,0.144,0.18842514397775142,0.13205735930879128,3.7588870533546057,1.2494340798755232,1000 -RF Regr.,LassoCV,IV-type,0.95,0.005,2.3593789527595215,2.5041605666150644,1.0,0.294,0.18842514397775142,0.11595339829359219,3.7588870533546057,1.2494340798755232,1000 -RF Regr.,LassoCV,partialling out,0.9,0.005,1.9561724875919793,2.209385831886938,1.0,0.325,0.16805094604382914,0.11184890983268013,3.467500132832606,0.9528194804323791,1000 -RF Regr.,LassoCV,partialling out,0.95,0.015,2.330923287280151,2.209385831886938,1.0,0.522,0.16805094604382914,0.09578872123641222,3.467500132832606,0.9528194804323791,1000 -RF Regr.,RF Regr.,IV-type,0.9,0.018,1.7756936336340403,1.638643743950897,1.0,0.895,0.1205058848458396,0.07010915091220656,2.969811795319561,0.4176089431455293,1000 -RF Regr.,RF Regr.,IV-type,0.95,0.051,2.115869468549653,1.638643743950897,1.0,0.975,0.1205058848458396,0.05597430765776451,2.969811795319561,0.4176089431455293,1000 -RF Regr.,RF Regr.,partialling out,0.9,0.021,1.7681560091268151,1.6030275360920991,1.0,0.928,0.11767370266913284,0.06767629996605996,2.93989420524225,0.37430263781731266,1000 -RF Regr.,RF Regr.,partialling out,0.95,0.061,2.106887834973826,1.6030275360920991,1.0,0.984,0.11767370266913284,0.05366553030606561,2.93989420524225,0.37430263781731266,1000 +LGBM Regr.,LGBM Regr.,IV-type,0.9,0.359,1.3755861250755959,0.7533817675308617,1.0,0.983,0.10444003719792545,0.03319588065777179,1.4454211498085776,0.26049409728823314,1000 +LGBM Regr.,LGBM Regr.,IV-type,0.95,0.566,1.6391119663201015,0.7533817675308617,1.0,0.999,0.10444003719792545,0.018658743299259112,1.4454211498085776,0.26049409728823314,1000 +LGBM Regr.,LGBM Regr.,partialling out,0.9,0.197,1.0680881308927423,0.7347354428810158,1.0,0.964,0.10198131802798086,0.0443414010278968,1.4282242316249965,0.25229952777929987,1000 +LGBM Regr.,LGBM Regr.,partialling out,0.95,0.324,1.2727055067777409,0.7347354428810158,1.0,0.992,0.10198131802798086,0.030840462791778402,1.4282242316249965,0.25229952777929987,1000 +LGBM Regr.,LassoCV,IV-type,0.9,0.015,1.4891617522492961,1.4488819159319037,1.0,0.378,0.18561743623652635,0.11029731701869455,2.1807608786019643,0.7221920339148978,1000 +LGBM Regr.,LassoCV,IV-type,0.95,0.042,1.7744456733044545,1.4488819159319037,1.0,0.601,0.18561743623652635,0.090030878628444,2.1807608786019643,0.7221920339148978,1000 +LGBM Regr.,LassoCV,partialling out,0.9,0.024,1.4917502052656801,1.3221204315783734,1.0,0.541,0.17228087019571867,0.09619454723796686,2.049489609674191,0.5997556153052517,1000 +LGBM Regr.,LassoCV,partialling out,0.95,0.073,1.7775300053110592,1.3221204315783734,1.0,0.761,0.17228087019571867,0.07583850420764672,2.049489609674191,0.5997556153052517,1000 +LassoCV,LGBM Regr.,IV-type,0.9,0.73,2.479560595815695,1.0346426864763705,1.0,1.0,0.06920738865206702,0.011540810801436563,2.5443047864136346,0.5569471732424347,1000 +LassoCV,LGBM Regr.,IV-type,0.95,0.893,2.954578684481825,1.0346426864763705,1.0,1.0,0.06920738865206702,0.0038983537654415056,2.5443047864136346,0.5569471732424347,1000 +LassoCV,LGBM Regr.,partialling out,0.9,0.632,1.9605167535420611,0.8992111659887163,1.0,1.0,0.05998295861547946,0.012000973566668068,2.4210030177077586,0.6440835936658005,1000 +LassoCV,LGBM Regr.,partialling out,0.95,0.835,2.336099799440206,0.8992111659887163,1.0,1.0,0.05998295861547946,0.004434166638410146,2.4210030177077586,0.6440835936658005,1000 +LassoCV,LassoCV,IV-type,0.9,0.0,2.5703372661953776,4.865260754822335,1.0,0.0,0.2830286662624298,0.22439945551293977,6.395774925585079,3.334746584059591,1000 +LassoCV,LassoCV,IV-type,0.95,0.0,3.062745758843568,4.865260754822335,1.0,0.0,0.2830286662624298,0.2078827373214068,6.395774925585079,3.334746584059591,1000 +LassoCV,LassoCV,partialling out,0.9,0.0,2.58639958016462,4.867314618361354,1.0,0.0,0.28309171431147057,0.22417951908385741,6.398064076377938,3.336565160344769,1000 +LassoCV,LassoCV,partialling out,0.95,0.0,3.0818851864329013,4.867314618361354,1.0,0.0,0.28309171431147057,0.2075756117099462,6.398064076377938,3.336565160344769,1000 +LassoCV,RF Regr.,IV-type,0.9,0.03,2.201968880538331,1.7117879345092915,1.0,0.994,0.10304348206977468,0.05118734638448726,3.365492564732171,0.3138790534461325,1000 +LassoCV,RF Regr.,IV-type,0.95,0.099,2.623807754208416,1.7117879345092915,1.0,1.0,0.10304348206977468,0.0369081382284807,3.365492564732171,0.3138790534461325,1000 +LassoCV,RF Regr.,partialling out,0.9,0.033,2.2330906910397963,1.656734265754782,1.0,0.998,0.0982817284966058,0.04650603557240649,3.3380373315922904,0.30299233007013754,1000 +LassoCV,RF Regr.,partialling out,0.95,0.13,2.6608916787091044,1.656734265754782,1.0,0.999,0.0982817284966058,0.032237308880055986,3.3380373315922904,0.30299233007013754,1000 +RF Regr.,LassoCV,IV-type,0.9,0.001,1.951602488934002,2.496369543889771,1.0,0.149,0.1882495178000821,0.13226664609458022,3.749193574131233,1.2443559351590099,1000 +RF Regr.,LassoCV,IV-type,0.95,0.004,2.325477798008481,2.496369543889771,1.0,0.283,0.1882495178000821,0.11629352945863138,3.749193574131233,1.2443559351590099,1000 +RF Regr.,LassoCV,partialling out,0.9,0.002,1.9227923312991766,2.18289621236076,1.0,0.321,0.16667394665087393,0.11098639679899193,3.4384927296936114,0.928664433523872,1000 +RF Regr.,LassoCV,partialling out,0.95,0.01,2.291148377792633,2.18289621236076,1.0,0.566,0.16667394665087393,0.09505438614556037,3.4384927296936114,0.928664433523872,1000 +RF Regr.,RF Regr.,IV-type,0.9,0.015,1.7421619533890125,1.6093123421586957,1.0,0.903,0.1189984467466679,0.06912583869905706,2.9380563428464184,0.3931839897902748,1000 +RF Regr.,RF Regr.,IV-type,0.95,0.051,2.0759140071368507,1.6093123421586957,1.0,0.967,0.1189984467466679,0.05511967656630338,2.9380563428464184,0.3931839897902748,1000 +RF Regr.,RF Regr.,partialling out,0.9,0.013,1.7368870337302156,1.5939873207774409,1.0,0.931,0.1174689960814369,0.06795129356233286,2.9287971865967988,0.37330009521026997,1000 +RF Regr.,RF Regr.,partialling out,0.95,0.047,2.0696285526847444,1.5939873207774409,1.0,0.976,0.1174689960814369,0.05405509596164712,2.9287971865967988,0.37330009521026997,1000 diff --git a/results/plm/plr_ate_sensitivity_metadata.csv b/results/plm/plr_ate_sensitivity_metadata.csv index 64f7e15d..ba728b1b 100644 --- a/results/plm/plr_ate_sensitivity_metadata.csv +++ b/results/plm/plr_ate_sensitivity_metadata.csv @@ -1,2 +1,2 @@ DoubleML Version,Script,Date,Total Runtime (minutes),Python Version,Config File -0.11.dev0,PLRATESensitivityCoverageSimulation,2025-09-08 10:23,225.26507600943248,3.12.3,scripts/plm/plr_ate_sensitivity_config.yml +0.11.dev0,PLRATESensitivityCoverageSimulation,2025-11-17 12:27,224.5860997915268,3.12.3,scripts/plm/plr_ate_sensitivity_config.yml diff --git a/results/plm/plr_cate_coverage.csv b/results/plm/plr_cate_coverage.csv index 48144c2e..c7c635f5 100644 --- a/results/plm/plr_cate_coverage.csv +++ b/results/plm/plr_cate_coverage.csv @@ -1,29 +1,29 @@ Learner g,Learner m,Score,level,Coverage,CI Length,Bias,Uniform Coverage,Uniform CI Length,repetition -LGBM Regr.,LGBM Regr.,IV-type,0.9,0.81768,0.34823828039948385,0.10387882894377355,0.98,0.877536279711683,1000 -LGBM Regr.,LGBM Regr.,IV-type,0.95,0.88452,0.41495150476467624,0.10387882894377355,0.978,0.8755885557745791,1000 -LGBM Regr.,LGBM Regr.,partialling out,0.9,0.74497,0.4554797344783618,0.15685530804089212,0.98,1.1478638491759583,1000 -LGBM Regr.,LGBM Regr.,partialling out,0.95,0.8289,0.5427375789783838,0.15685530804089212,0.975,1.1461134314143238,1000 -LGBM Regr.,LassoCV,IV-type,0.9,0.87676,0.3654066819193057,0.09298925250332173,0.996,0.918570960342981,1000 -LGBM Regr.,LassoCV,IV-type,0.95,0.9305,0.43540891696209993,0.09298925250332173,0.998,0.9146633243328387,1000 -LGBM Regr.,LassoCV,partialling out,0.9,0.85076,0.6443958775932414,0.17786339324035,0.995,1.619401982358085,1000 -LGBM Regr.,LassoCV,partialling out,0.95,0.9138999999999999,0.7678450478354303,0.17786339324035,0.995,1.6169505074092843,1000 -LassoCV,LGBM Regr.,IV-type,0.9,0.78798,0.3564411077318671,0.11330573847372374,0.981,0.8967708526498701,1000 -LassoCV,LGBM Regr.,IV-type,0.95,0.86123,0.42472577639556236,0.11330573847372374,0.979,0.8951556638983089,1000 -LassoCV,LGBM Regr.,partialling out,0.9,0.11785999999999999,0.5624549054410738,0.520981993530588,0.256,1.4155635446728412,1000 -LassoCV,LGBM Regr.,partialling out,0.95,0.17375,0.6702063572887813,0.520981993530588,0.24,1.4141490939664967,1000 -LassoCV,LassoCV,IV-type,0.9,0.8915599999999999,0.36218624440931035,0.08891034982525507,0.997,0.9143791468774882,1000 -LassoCV,LassoCV,IV-type,0.95,0.94252,0.4315715289838449,0.08891034982525507,0.999,0.9097650128507542,1000 -LassoCV,LassoCV,partialling out,0.9,0.8849199999999999,0.377579333278092,0.09415271292259303,1.0,0.9476231917862463,1000 -LassoCV,LassoCV,partialling out,0.95,0.93728,0.44991352568147963,0.09415271292259303,0.999,0.9502179674293983,1000 -LassoCV,RF Regr.,IV-type,0.9,0.8889,0.3598606578601841,0.0882100995962088,0.998,0.9050777977331306,1000 -LassoCV,RF Regr.,IV-type,0.95,0.93929,0.4288004216922703,0.0882100995962088,0.998,0.9069174628488212,1000 -LassoCV,RF Regr.,partialling out,0.9,0.7726799999999999,0.4313687781659662,0.13994748702556353,0.987,1.0840879654944249,1000 -LassoCV,RF Regr.,partialling out,0.95,0.8509099999999999,0.5140076025046119,0.13994748702556353,0.987,1.0858563731119826,1000 -RF Regr.,LassoCV,IV-type,0.9,0.87934,0.34754930114103977,0.08873103739147503,0.997,0.8735631483319488,1000 -RF Regr.,LassoCV,IV-type,0.95,0.9341900000000001,0.41413053534191474,0.08873103739147503,0.996,0.8744577440640638,1000 -RF Regr.,LassoCV,partialling out,0.9,0.86793,0.4437729101158724,0.11739481291738822,0.994,1.1156963101203323,1000 -RF Regr.,LassoCV,partialling out,0.95,0.92559,0.5287880373609081,0.11739481291738822,0.994,1.1160214264978439,1000 -RF Regr.,RF Regr.,IV-type,0.9,0.87642,0.3432087450555705,0.08816969817335361,0.997,0.8637829663181292,1000 -RF Regr.,RF Regr.,IV-type,0.95,0.93063,0.4089584437582015,0.08816969817335361,0.996,0.8617899864405818,1000 -RF Regr.,RF Regr.,partialling out,0.9,0.8794299999999999,0.3835286791736148,0.09806292631011773,0.998,0.9641686388193965,1000 -RF Regr.,RF Regr.,partialling out,0.95,0.93136,0.45700260856139946,0.09806292631011773,0.995,0.9640860543159346,1000 +LGBM Regr.,LGBM Regr.,IV-type,0.9,0.82905,0.34859934457061187,0.10269066968736434,0.986,0.8788694707117327,1000 +LGBM Regr.,LGBM Regr.,IV-type,0.95,0.89328,0.41538173926087907,0.10269066968736434,0.986,0.8765365613685849,1000 +LGBM Regr.,LGBM Regr.,partialling out,0.9,0.7487699999999999,0.4562033822396419,0.15530020302736622,0.973,1.1461116868127335,1000 +LGBM Regr.,LGBM Regr.,partialling out,0.95,0.8297899999999999,0.5435998584702256,0.15530020302736622,0.971,1.1476869846192674,1000 +LGBM Regr.,LassoCV,IV-type,0.9,0.88228,0.3665735738309043,0.09237124180359486,0.998,0.9203983723665325,1000 +LGBM Regr.,LassoCV,IV-type,0.95,0.93635,0.436799354435143,0.09237124180359486,0.997,0.9195555991848416,1000 +LGBM Regr.,LassoCV,partialling out,0.9,0.84415,0.6446703702300751,0.18063600645569744,0.993,1.6102346810221977,1000 +LGBM Regr.,LassoCV,partialling out,0.95,0.9068200000000001,0.7681721259859722,0.18063600645569744,0.991,1.6197708088395464,1000 +LassoCV,LGBM Regr.,IV-type,0.9,0.78462,0.35820003669569267,0.11367456664699994,0.977,0.9022806080230871,1000 +LassoCV,LGBM Regr.,IV-type,0.95,0.86042,0.42682166952792083,0.11367456664699994,0.983,0.9028292164077011,1000 +LassoCV,LGBM Regr.,partialling out,0.9,0.11332,0.5635001570275089,0.5253287834841598,0.257,1.4151506337590742,1000 +LassoCV,LGBM Regr.,partialling out,0.95,0.16911,0.6714518513744726,0.5253287834841598,0.246,1.4217510537602984,1000 +LassoCV,LassoCV,IV-type,0.9,0.89467,0.3638287468934425,0.088964144313276,0.999,0.9149966883358348,1000 +LassoCV,LassoCV,IV-type,0.95,0.9472999999999999,0.4335286914089192,0.088964144313276,0.998,0.9154935052029363,1000 +LassoCV,LassoCV,partialling out,0.9,0.88946,0.3783305434334964,0.0937660325206101,0.998,0.9527467197251451,1000 +LassoCV,LassoCV,partialling out,0.95,0.94586,0.4508086477916106,0.0937660325206101,0.999,0.9523664378421313,1000 +LassoCV,RF Regr.,IV-type,0.9,0.89402,0.36133940754837507,0.08742978566108492,0.998,0.9102557308429199,1000 +LassoCV,RF Regr.,IV-type,0.95,0.9471499999999999,0.4305624606260176,0.08742978566108492,0.997,0.9103412832643125,1000 +LassoCV,RF Regr.,partialling out,0.9,0.76742,0.4333802817413689,0.14145970305557048,0.989,1.0911406471440919,1000 +LassoCV,RF Regr.,partialling out,0.95,0.8513,0.5164044568495605,0.14145970305557048,0.984,1.090270069893263,1000 +RF Regr.,LassoCV,IV-type,0.9,0.8809199999999999,0.3488601215296179,0.08868809382454168,0.996,0.8712649919759498,1000 +RF Regr.,LassoCV,IV-type,0.95,0.9355399999999999,0.41569247417325955,0.08868809382454168,0.998,0.87648182402068,1000 +RF Regr.,LassoCV,partialling out,0.9,0.8620399999999999,0.4453600356514868,0.11971854257293388,0.993,1.1194369351513875,1000 +RF Regr.,LassoCV,partialling out,0.95,0.92079,0.5306792140819111,0.11971854257293388,0.994,1.1126580820916288,1000 +RF Regr.,RF Regr.,IV-type,0.9,0.8773500000000001,0.34471572299390735,0.08798679363788052,0.996,0.8651769659880062,1000 +RF Regr.,RF Regr.,IV-type,0.95,0.93284,0.41075411872662454,0.08798679363788052,0.996,0.8664637796214006,1000 +RF Regr.,RF Regr.,partialling out,0.9,0.8784500000000001,0.3846648443860267,0.09849944709058014,0.996,0.9691346097579039,1000 +RF Regr.,RF Regr.,partialling out,0.95,0.93471,0.45835643291411227,0.09849944709058014,0.999,0.9675297074982309,1000 diff --git a/results/plm/plr_cate_metadata.csv b/results/plm/plr_cate_metadata.csv index 7d45473c..3527c916 100644 --- a/results/plm/plr_cate_metadata.csv +++ b/results/plm/plr_cate_metadata.csv @@ -1,2 +1,2 @@ DoubleML Version,Script,Date,Total Runtime (minutes),Python Version,Config File -0.11.dev0,PLRCATECoverageSimulation,2025-09-08 09:40,182.2720296104749,3.12.3,scripts/plm/plr_cate_config.yml +0.11.dev0,PLRCATECoverageSimulation,2025-11-17 11:47,185.29402711788813,3.12.3,scripts/plm/plr_cate_config.yml diff --git a/results/plm/plr_gate_coverage.csv b/results/plm/plr_gate_coverage.csv index a67c5963..a32ab6dd 100644 --- a/results/plm/plr_gate_coverage.csv +++ b/results/plm/plr_gate_coverage.csv @@ -1,29 +1,29 @@ Learner g,Learner m,Score,level,Coverage,CI Length,Bias,Uniform Coverage,Uniform CI Length,repetition -LGBM Regr.,LGBM Regr.,IV-type,0.9,0.794,0.34039097989929323,0.10996244021435428,0.992,0.7985363445318471,1000 -LGBM Regr.,LGBM Regr.,IV-type,0.95,0.8646666666666666,0.40560086948368634,0.10996244021435428,0.988,0.7989497121363136,1000 -LGBM Regr.,LGBM Regr.,partialling out,0.9,0.7403333333333333,0.4121990949361976,0.14000136984606248,0.98,0.9732951637644821,1000 -LGBM Regr.,LGBM Regr.,partialling out,0.95,0.8226666666666667,0.49116551606618364,0.14000136984606248,0.979,0.970490906555309,1000 -LGBM Regr.,LassoCV,IV-type,0.9,0.875,0.35821915738907717,0.0926838853161814,1.0,0.8415239536002534,1000 -LGBM Regr.,LassoCV,IV-type,0.95,0.9343333333333333,0.42684445323935816,0.0926838853161814,0.998,0.8396643304710062,1000 -LGBM Regr.,LassoCV,partialling out,0.9,0.8573333333333334,0.5544776734850916,0.15109645763906593,1.0,1.3029617117268792,1000 -LGBM Regr.,LassoCV,partialling out,0.95,0.9206666666666666,0.6607008991289419,0.15109645763906593,0.997,1.2998315248240804,1000 -LassoCV,LGBM Regr.,IV-type,0.9,0.7163333333333333,0.353651976819609,0.12795329417339824,0.986,0.8307718361994854,1000 -LassoCV,LGBM Regr.,IV-type,0.95,0.812,0.4214023219272613,0.12795329417339824,0.986,0.8299509093514186,1000 -LassoCV,LGBM Regr.,partialling out,0.9,0.153,0.48227061524945375,0.47705751440082,0.186,1.1293996780513653,1000 -LassoCV,LGBM Regr.,partialling out,0.95,0.19666666666666666,0.5746608824049421,0.47705751440082,0.2,1.1331501847151988,1000 -LassoCV,LassoCV,IV-type,0.9,0.894,0.3567909805774525,0.08720030959955781,1.0,0.8379481107440971,1000 -LassoCV,LassoCV,IV-type,0.95,0.9443333333333334,0.425142675604878,0.08720030959955781,0.999,0.8372526073211394,1000 -LassoCV,LassoCV,partialling out,0.9,0.8903333333333334,0.36794475532392246,0.09196794783532097,1.0,0.8651972935534187,1000 -LassoCV,LassoCV,partialling out,0.95,0.943,0.4384332179586496,0.09196794783532097,0.999,0.8653275873310468,1000 -LassoCV,RF Regr.,IV-type,0.9,0.888,0.35565076241770976,0.08801288004439413,0.999,0.836428639272237,1000 -LassoCV,RF Regr.,IV-type,0.95,0.9436666666666667,0.42378402186755043,0.08801288004439413,0.999,0.8380334103705674,1000 -LassoCV,RF Regr.,partialling out,0.9,0.755,0.40437308174199216,0.13257587113478758,0.984,0.9528722463750902,1000 -LassoCV,RF Regr.,partialling out,0.95,0.84,0.4818402461747792,0.13257587113478758,0.987,0.9530223996886317,1000 -RF Regr.,LassoCV,IV-type,0.9,0.8786666666666666,0.34683779869312964,0.08863943282865501,0.999,0.8129069985927083,1000 -RF Regr.,LassoCV,IV-type,0.95,0.9363333333333334,0.4132827278835693,0.08863943282865501,0.999,0.8106200280369072,1000 -RF Regr.,LassoCV,partialling out,0.9,0.876,0.41229188635555847,0.1063156469979095,0.998,0.9697196791996823,1000 -RF Regr.,LassoCV,partialling out,0.95,0.9336666666666666,0.4912760838620298,0.1063156469979095,1.0,0.9678399719243883,1000 -RF Regr.,RF Regr.,IV-type,0.9,0.879,0.34379508384897806,0.08882882234430942,0.997,0.8077113920377728,1000 -RF Regr.,RF Regr.,IV-type,0.95,0.932,0.40965710952334156,0.08882882234430942,0.998,0.8115195081784735,1000 -RF Regr.,RF Regr.,partialling out,0.9,0.885,0.3683217729276454,0.0915713260351349,1.0,0.8652487630115112,1000 -RF Regr.,RF Regr.,partialling out,0.95,0.9386666666666666,0.438882462142282,0.0915713260351349,1.0,0.8665925848261755,1000 +LGBM Regr.,LGBM Regr.,IV-type,0.9,0.8053333333333333,0.3409114324357686,0.10830011848130718,0.991,0.8017592987199822,1000 +LGBM Regr.,LGBM Regr.,IV-type,0.95,0.875,0.4062210269314008,0.10830011848130718,0.988,0.799796307936306,1000 +LGBM Regr.,LGBM Regr.,partialling out,0.9,0.7383333333333334,0.4124415095407824,0.1366399549532388,0.984,0.9697388963048222,1000 +LGBM Regr.,LGBM Regr.,partialling out,0.95,0.8283333333333334,0.49145437088373556,0.1366399549532388,0.984,0.9665687910235732,1000 +LGBM Regr.,LassoCV,IV-type,0.9,0.8936666666666666,0.35821185324988614,0.08767343268627296,0.999,0.8442099807695619,1000 +LGBM Regr.,LassoCV,IV-type,0.95,0.9493333333333334,0.4268357498206965,0.08767343268627296,0.999,0.8418490502463957,1000 +LGBM Regr.,LassoCV,partialling out,0.9,0.8396666666666667,0.5553838841615836,0.15655208513456628,0.995,1.3020013862133748,1000 +LGBM Regr.,LassoCV,partialling out,0.95,0.9026666666666666,0.6617807157516657,0.15655208513456628,0.996,1.3068899330904447,1000 +LassoCV,LGBM Regr.,IV-type,0.9,0.7393333333333334,0.35377029877119814,0.1253820270670297,0.986,0.8278870895082657,1000 +LassoCV,LGBM Regr.,IV-type,0.95,0.8236666666666667,0.42154331122861627,0.1253820270670297,0.983,0.8318320743030287,1000 +LassoCV,LGBM Regr.,partialling out,0.9,0.144,0.48091195717862995,0.4806335238545862,0.154,1.1322758027985098,1000 +LassoCV,LGBM Regr.,partialling out,0.95,0.191,0.5730419414593854,0.4806335238545862,0.156,1.1291510461071579,1000 +LassoCV,LassoCV,IV-type,0.9,0.9043333333333333,0.3571755626965762,0.0846962632601286,1.0,0.8373681252041506,1000 +LassoCV,LassoCV,IV-type,0.95,0.951,0.4256009334645622,0.0846962632601286,0.999,0.842347593014819,1000 +LassoCV,LassoCV,partialling out,0.9,0.8886666666666666,0.36826827935260703,0.08969215106833642,0.997,0.8647058876249634,1000 +LassoCV,LassoCV,partialling out,0.95,0.944,0.43881872061612937,0.08969215106833642,0.997,0.8654820471522434,1000 +LassoCV,RF Regr.,IV-type,0.9,0.8986666666666666,0.35592501324799986,0.08510323311217904,0.999,0.8366218670463145,1000 +LassoCV,RF Regr.,IV-type,0.95,0.9483333333333334,0.42411081188782424,0.08510323311217904,0.999,0.8366949606336201,1000 +LassoCV,RF Regr.,partialling out,0.9,0.7383333333333334,0.4030595445326118,0.13187581900072584,0.99,0.9493412021611323,1000 +LassoCV,RF Regr.,partialling out,0.95,0.833,0.48027507005177655,0.13187581900072584,0.991,0.9490391291628868,1000 +RF Regr.,LassoCV,IV-type,0.9,0.8883333333333334,0.3469399138393356,0.08520954380177768,1.0,0.8161804056188466,1000 +RF Regr.,LassoCV,IV-type,0.95,0.9433333333333334,0.413404405585196,0.08520954380177768,0.998,0.8113422076955483,1000 +RF Regr.,LassoCV,partialling out,0.9,0.867,0.41304588013208265,0.10868702662568211,0.998,0.9703778734057933,1000 +RF Regr.,LassoCV,partialling out,0.95,0.926,0.4921745228613064,0.10868702662568211,0.998,0.9699783780272438,1000 +RF Regr.,RF Regr.,IV-type,0.9,0.8883333333333334,0.34434350122208923,0.08569474479321623,0.998,0.808725225751662,1000 +RF Regr.,RF Regr.,IV-type,0.95,0.9463333333333334,0.410310589129175,0.08569474479321623,0.997,0.8079739610497064,1000 +RF Regr.,RF Regr.,partialling out,0.9,0.8866666666666666,0.36881414918104743,0.09303338687448989,0.999,0.8697573903122439,1000 +RF Regr.,RF Regr.,partialling out,0.95,0.9396666666666667,0.4394691646352566,0.09303338687448989,0.998,0.8652094967951268,1000 diff --git a/results/plm/plr_gate_metadata.csv b/results/plm/plr_gate_metadata.csv index 7f003424..44ab86c4 100644 --- a/results/plm/plr_gate_metadata.csv +++ b/results/plm/plr_gate_metadata.csv @@ -1,2 +1,2 @@ DoubleML Version,Script,Date,Total Runtime (minutes),Python Version,Config File -0.11.dev0,PLRGATECoverageSimulation,2025-09-08 09:41,182.90292783578238,3.12.3,scripts/plm/plr_gate_config.yml +0.11.dev0,PLRGATECoverageSimulation,2025-11-17 11:46,184.07251759767533,3.12.3,scripts/plm/plr_gate_config.yml diff --git a/scripts/plm/lplr_ate.py b/scripts/plm/lplr_ate.py new file mode 100644 index 00000000..7640c67e --- /dev/null +++ b/scripts/plm/lplr_ate.py @@ -0,0 +1,14 @@ +from montecover.plm import LPLRATECoverageSimulation + +# Create and run simulation with config file +sim = LPLRATECoverageSimulation( + config_file="scripts/plm/lplr_ate_config.yml", + log_level="INFO", + log_file="logs/plm/lplr_ate_sim.log", +) +print("Calling file") +sim.run_simulation() +sim.save_results(output_path="results/plm/", file_prefix="lplr_ate") + +# Save config file for reproducibility +sim.save_config("results/plm/lplr_ate_config.yml") diff --git a/scripts/plm/lplr_ate_config.yml b/scripts/plm/lplr_ate_config.yml new file mode 100644 index 00000000..78c930a8 --- /dev/null +++ b/scripts/plm/lplr_ate_config.yml @@ -0,0 +1,61 @@ +# Simulation parameters for LPLR ATE Coverage + +simulation_parameters: + repetitions: 500 + max_runtime: 19800 # 5.5 hours in seconds + random_seed: 42 + n_jobs: -2 + +dgp_parameters: + theta: [0.5] # Treatment effect + n_obs: [500] # Sample size + dim_x: [20] # Number of covariates + +# Define reusable learner configurations +learner_definitions: + lasso: &lasso + name: "LassoCV" + + logistic: &logistic + name: "Logistic" + + rf: &rf + name: "RF Regr." + params: + n_estimators: 100 + max_features: "sqrt" + + rf-class: &rf-class + name: "RF Clas." + params: + n_estimators: 100 + max_features: "sqrt" + + lgbm: &lgbm + name: "LGBM Regr." + params: + n_estimators: 500 + learning_rate: 0.01 + + lgbm-class: &lgbm-class + name: "LGBM Clas." + params: + n_estimators: 500 + learning_rate: 0.01 + +dml_parameters: + learners: + - ml_m: *lasso + ml_M: *logistic + ml_t: *lasso + - ml_m: *rf + ml_M: *rf-class + ml_t: *rf + - ml_m: *lgbm + ml_M: *lgbm-class + ml_t: *lgbm + + score: ["nuisance_space", "instrument"] + +confidence_parameters: + level: [0.95, 0.90] # Confidence levels