Code for Skewness-Robust Causal Discovery in Location-Scale Noise Models
In the following, we provide the general project structure.
skewd/
├── data # benchmark datasets
├── example_plots # exemplary plots of skew-noise pairs
├── experiments # skewd experimental code: scripts and results for all benchmarks
├── skewDGP
│ └── generate_skewed_LSNMs.R # generates skew-LSNM benchmarks
├── src # source code for skewd
├── environment.yaml # .yaml for environment generation
├── full_kde_dict.pkl # prevent repeated computation in KDE_analysis.ipynb
├── KDE_analysis.ipynb # KDE evaluation
├── MV_analysis.ipynb # multivariate evaluation
├── MV_F1.ipynb # multivariate F1 metrics
├── plot_examples.ipynb # generates figures in example_plots
└── requirements.txt # requirements file
To ensure compatibility, use the ``environment.yaml'' file to create an environment:
conda env create -f environment.yaml
To run our code, activate the Conda environment:
conda activate skewd-env
Alternatively, we provide the ``requirements.txt'' file for environment creation.
For replicating the experiments, see the README.md inside the experiments folder.
Run SKEWD with a randomly generated dataset:
import numpy as np
from src.skewd import skewd
from sklearn.preprocessing import StandardScaler
np.random.seed(42)
x = np.random.randn(300).reshape(-1, 1)
eps = np.random.randn(300).reshape(-1, 1)
y = x**3 + (x**2) * eps
indep_score, indep_dir, lik_score, lik_dir, _, _, _, _ = skewd(x, y, cma_iter=200, ecm_max_iter=200)
print(f"SKEWD-IT infers direction {indep_dir}")
print(f"SKEWD-LL infers direction {lik_dir}")The inferred direction is given by indep_dir and lik_dir for independence testing and likelihood scoring, respectively. If the direction is 1 x -> y is inferred, while if it is 0 y-> x is inferred. Another example for a single pair is provided in "src/example.py", showing how to execute SKEWD on a skew-noise pair.
@inproceedings{klippert:26:skewness-robust,
title={Skewness-Robust Causal Discovery in Location-Scale Noise Models},
author={Anonymous},
booktitle={Forty-third International Conference on Machine Learning},
year={2026},
url={https://openreview.net/forum?id=mXn4ueFKnQ}
}