LiNGAM is a new method for estimating structural equation models or linear Bayesian networks. It is based on using the non-Gaussianity of the data.
📦 Requirements
- Python3
- numpy
- scipy
- scikit-learn
- graphviz
- statsmodels
- networkx
- pandas
- itertools
- semopy
- autograd
🛠️ Installation
To install lingam package, use pip as follows:
pip install lingam
🚀 Usage
import numpy as np
import pandas as pd
import lingam
# To run causal discovery, we create a DirectLiNGAM object and call the fit method.
model = lingam.DirectLiNGAM()
model.fit(X)
# Using the causal_order_ properties,
# we can see the causal ordering as a result of the causal discovery.
print(model.causal_order_)
# Also, using the adjacency_matrix_ properties,
# we can see the adjacency matrix as a result of the causal discovery.
print(model.adjacency_matrix_)
📚 Documentation
💡 Examples
We provide several examples of running the LiNGAM algorithm in Jupyter Notebook. lingam/examples
📄 License
This project is licensed under the terms of the MIT license.
🤝 Contribution
For guidelines how to contribute to lingam package, take a look at CONTRIBUTING.md.
📖 References
Package
If you find our package useful, please cite the following paper:
- T. Ikeuchi, M. Ide, Y. Zeng, T. N. Maeda, and S. Shimizu. Python package for causal discovery based on LiNGAM. Journal of Machine Learning Research, 24(14): 1−8, 2023. [PDF]
Basic DAG model
Should you use this package for performing ICA-based LiNGAM algorithm, we kindly request you to cite the following paper:
- S. Shimizu, P. O. Hoyer, A. Hyvärinen, and A. Kerminen. A linear non-gaussian acyclic model for causal discovery. Journal of Machine Learning Research, 7: 2003--2030, 2006. [PDF]
Should you use this package for performing DirectLiNGAM algorithm, we kindly request you to cite the following two papers:
- S. Shimizu, T. Inazumi, Y. Sogawa, A. Hyvärinen, Y. Kawahara, T. Washio, P. O. Hoyer and K. Bollen. DirectLiNGAM: A direct method for learning a linear non-Gaussian structural equation model. Journal of Machine Learning Research, 12(Apr): 1225--1248, 2011. [PDF]
- A. Hyvärinen and S. M. Smith. Pairwise likelihood ratios for estimation of non-Gaussian structural equation models. Journal of Machine Learning Research, 14(Jan): 111--152, 2013. [PDF]
Should you use this package for performing RESIT algorithm, we kindly request you to cite the following paper:
- J. Peters, J. M. Mooij, D. Janzing, and B. Schölkopf. Causal Discovery with Continuous Additive Noise Models. Journal of Machine Learning Research, 15(58): 2009--2053, 2014. [PDF]
Should you use this package for performing GroupDirectLiNGAM algorithm, we kindly request you to cite the following paper:
- D. Entner and P. O. Hoyer. Estimating a causal order among groups of variables in linear models. In Proc. 22nd International Conference on Artificial Neural Networks (ICANN2012), pp. 83--90, Lausanne, Switzerland, 2012. [PDF]
Time series
Should you use this package for performing VAR-LiNGAM, we kindly request you to cite the following paper:
- A. Hyvärinen, K. Zhang, S. Shimizu, and P. O. Hoyer. Estimation of a structural vector autoregression model using non-Gaussianity. Journal of Machine Learning Research, 11: 1709-1731, 2010. [PDF]
Should you use this package for performing VARMA-LiNGAM, we kindly request you to cite the following paper:
- Y. Kawahara, S. Shimizu and T. Washio. Analyzing relationships among ARMA processes based on non-Gaussianity of external influences. Neurocomputing, 74(12-13): 2212-2221, 2011. [PDF]
Multiple datasets
Should you use this package for performing DirectLiNGAM for multiple groups, we kindly request you to cite the following paper:
- S. Shimizu. Joint estimation of linear non-Gaussian acyclic models. Neurocomputing, 81: 104-107, 2012. [PDF]
Should you use this package for performing LiNGAM for longitudinal data, we kindly request you to cite the following paper:
- K. Kadowaki, S. Shimizu, and T. Washio. Estimation of causal structures in longitudinal data using non-Gaussianity. In Proc. 23rd IEEE International Workshop on Machine Learning for Signal Processing (MLSP2013), pp. 1--6, Southampton, United Kingdom, 2013. [PDF]
Latent confounders and latent factors
Should you use this package for performing BottomUpParceLiNGAM with Algorithm 1 of the paper below except Step 2 for estimating causal orders, we kindly request you to cite the following paper:
- T. Tashiro, S. Shimizu, A. Hyvärinen, T. Washio. ParceLiNGAM: a causal ordering method robust against latent confounders. Neural computation, 26(1): 57-83, 2014. [PDF]
Should you use this package for performing RCD algorithm, we kindly request you to cite the following paper:
- T. N. Maeda and S. Shimizu. RCD: Repetitive causal discovery of linear non-Gaussian acyclic models with latent confounders. In Proc. 23rd International Conference on Artificial Intelligence and Statistics (AISTATS2020), Palermo, Sicily, Italy. PMLR 108:735-745, 2020. [PDF]
Should you use this package for performing LiNA algorithm, we kindly request you to cite the following paper:
- Y. Zeng, S. Shimizu, R. Cai, F. Xie, M. Yamamoto and Z. Hao. Causal Discovery with Multi-Domain LiNGAM for Latent Factors. In Proc. of the Thirtieth International Joint Conference on Artificial Intelligence (IJCAI-21), 2021: 2097--2103. [PDF]
Should you use this package for performing CAM-UV algorithm, we kindly request you to cite the following paper:
- T. N. Maeda and S. Shimizu. Causal additive models with unobserved variables. In Proc. 37th Conference on Uncertainty in Artificial Intelligence (UAI). PMLR 161:97-106, 2021. [PDF]
Should you use this package for performing GroupLiNGAM algorithm, we kindly request you to cite the following paper:
- Y. Kawahara, K. Bollen, S. Shimizu and T. Washio. GroupLiNGAM: Linear non-Gaussian acyclic models for sets of variables. Arxiv preprint arXiv:1006.5041, 2010. [PDF]
Should you use this package for performing ABIC-LiNGAM algorithm, we kindly request you to cite the following paper:
- Y. Morinishi and S. Shimizu. Differentiable causal discovery of linear non-Gaussian acyclic models under unmeasured confounding. Transactions on Machine Learning Research (TMLR), 2025. [PDF]
Causality and prediction
Should you use this package for performing estimation of intervention effects on prediction, we kindly request you to cite the following paper:
- P. Blöbaum and S. Shimizu. Estimation of interventional effects of features on prediction. In Proc. 2017 IEEE International Workshop on Machine Learning for Signal Processing (MLSP2017), pp. 1--6, Tokyo, Japan, 2017. [PDF]
Mixed data
Should you use this package for performing LiM algorithm, we kindly request you to cite the following paper:
- Y. Zeng, S. Shimizu, H. Matsui, F. Sun. Causal discovery for linear mixed data. In Proc. First Conference on Causal Learning and Reasoning (CLeaR2022). PMLR 177, pp. 994-1009, 2022. [PDF]
Missing data
Should you use this package for performing the Missingness-LiNGAM algorithm, we kindly request you to cite the following paper:
- M. Ceriscioli, S. Shimizu, and K. Mohan. Discovering Linear Non-Gaussian Models for All Categories of Missing Data (Student Abstract). The 40th Annual AAAI Conference on Artificial Intelligence (AAAI-26) Student Abstract and Poster Program, 2026. [PDF]
Metadata
Release files for lingam 1.13.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| lingam-1.13.0.tar.gz | 151.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lingam-1.13.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 307.3 kB
Release files / lingam-1.13.0.tar.gz
| Download URL | lingam-1.13.0.tar.gz |
|---|---|
| Size | 151.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cf9145e0d716f0156fbdff3908f84f654a2c9e637a517cdcb0b733a685e930aa
|
|
BLAKE2b-256 checksum How to use checksums |
64f3ad84146be4b3c41e063b5498a52ab3caec29ce437f695488046e5543ab0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / lingam-1.13.0-py3-none-any.whl
| Download URL | lingam-1.13.0-py3-none-any.whl |
|---|---|
| Size | 155.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
82d58aef085d667c72121f08f5b3eee87b4c95a972951d051cfbfc79dffcb57a
|
|
BLAKE2b-256 checksum How to use checksums |
b69fd4f2404dfb4f45ebc259925e58eb2a3f81f4a1fc4ba6946e8465e7bcd9fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Security for lingam 1.13.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.