Welcome to MeDIL’s documentation!
MeDIL is a Python package for causal factor analysis, using the measurement dependence inducing latent (MeDIL) causal model framework [MGW20].
The package is under active development—see the develop branch of the repository on GitLab or its Github mirror.
- Version:
- 1.1.0 
- Date:
- Apr 25, 2025 
Installation:
You can install the package from PyPI with the command pip install medil.
Features:
- scikit-learn-style API 
- estimation of sparse causal factor structure and loadings in the linear Gaussian setting or more generally using a deep generative model [MLAS23] 
- \(\ell_0\)-penalized maximum likelihood estimation (BIC score-based search) for minimum MeDIL causal graphs in the linear Gaussian setting, as well as nonparametric constraint-based search using distance covariance or xi correlation 
- random generation of and sampling from linear Gaussian causal factor models 
- exact search for minimum edge clique cover (ECC) [GGfN09] as well as polynomial time heuristic using the one-pure-child assumption [MLAS23]