# LiNGAM - Discovery of non-gaussian linear causal models
[](https://github.com/cdt15/lingam/blob/master/LICENSE)
[](https://lingam.readthedocs.io/)
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.
* [The LiNGAM Project](https://sites.google.com/view/sshimizu06/lingam)
## Requirements
* Python3
* numpy
* scipy
* scikit-learn
* graphviz
* statsmodels
- networkx
- pandas
- itertools
- semopy
## Installation
To install lingam package, use `pip` as follows:
```sh
pip install lingam
```
## Usage
```python
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
[Tutorial and API reference](https://lingam.readthedocs.io/)
[Tutorial slides](https://speakerdeck.com/sshimizu2006/lingam-python-package)
## Examples
We provide several examples of running the LiNGAM algorithm in Jupyter Notebook.
[lingam/examples](./examples)
## License
This project is licensed under the terms of the [MIT license](./LICENSE).
## Contribution
For guidelines how to contribute to lingam package, take a look at [CONTRIBUTING.md](./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]](https://jmlr.org/papers/v24/21-0321.html)
### 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]](http://www.jmlr.org/papers/volume7/shimizu06a/shimizu06a.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]](http://www.jmlr.org/papers/volume12/shimizu11a/shimizu11a.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]](http://www.jmlr.org/papers/volume14/hyvarinen13a/hyvarinen13a.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]](http://www.jmlr.org/papers/volume15/peters14a/peters14a.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]](http://www.jmlr.org/papers/volume11/hyvarinen10a/hyvarinen10a.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]](http://dx.doi.org/10.1016/j.neucom.2011.02.008)
### 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]](http://dx.doi.org/10.1016/j.neucom.2011.11.005)
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]](https://doi.org/10.1109/MLSP.2013.6661912)
### 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]](https://ieeexplore.ieee.org/abstract/document/6797648)
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]](http://proceedings.mlr.press/v108/maeda20a.html)
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](https://www.ijcai.org/proceedings/2021/289)]
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]](https://proceedings.mlr.press/v161/maeda21a.html)
### 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]](https://doi.org/10.1109/MLSP.2017.8168175)
### 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]](https://proceedings.mlr.press/v177/zeng22a.html)
Raw data
{
"_id": null,
"home_page": "https://github.com/cdt15/lingam",
"name": "lingam",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "T.Ikeuchi, G.Haraoka, M.Ide, Y.Zeng, T.N.Maeda, W.Kurebayashi, S.Shimizu",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/0c/de/63a7d01f863303e5caff6b4cc42006d8ad4c5f09338549d6008a93ff8ef2/lingam-1.9.0.tar.gz",
"platform": null,
"description": "# LiNGAM - Discovery of non-gaussian linear causal models\n\n[](https://github.com/cdt15/lingam/blob/master/LICENSE)\n[](https://lingam.readthedocs.io/)\n\nLiNGAM is a new method for estimating structural equation models or linear Bayesian networks. It is based on using the non-Gaussianity of the data.\n\n* [The LiNGAM Project](https://sites.google.com/view/sshimizu06/lingam)\n\n## Requirements\n\n* Python3\n\n* numpy\n\n* scipy\n\n* scikit-learn\n\n* graphviz\n\n* statsmodels\n\n- networkx\n\n- pandas\n\n- itertools\n\n- semopy\n\n\n## Installation\n\nTo install lingam package, use `pip` as follows:\n\n```sh\npip install lingam\n```\n\n## Usage\n\n```python\nimport numpy as np\nimport pandas as pd\nimport lingam\n\n# To run causal discovery, we create a DirectLiNGAM object and call the fit method.\nmodel = lingam.DirectLiNGAM()\nmodel.fit(X)\n\n# Using the causal_order_ properties, \n# we can see the causal ordering as a result of the causal discovery.\nprint(model.causal_order_)\n\n# Also, using the adjacency_matrix_ properties, \n# we can see the adjacency matrix as a result of the causal discovery.\nprint(model.adjacency_matrix_)\n```\n\n## Documentation\n\n[Tutorial and API reference](https://lingam.readthedocs.io/)\n\n[Tutorial slides](https://speakerdeck.com/sshimizu2006/lingam-python-package)\n\n## Examples\n\nWe provide several examples of running the LiNGAM algorithm in Jupyter Notebook.\n [lingam/examples](./examples)\n\n## License\n\nThis project is licensed under the terms of the [MIT license](./LICENSE).\n\n## Contribution\n\nFor guidelines how to contribute to lingam package, take a look at [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## References\n\n### Package\n\nIf you find our package useful, please cite the following paper:\n\n* 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\u22128, 2023. [[PDF]](https://jmlr.org/papers/v24/21-0321.html)\n\n\n### Basic DAG model\n\nShould you use this package for performing **ICA-based LiNGAM algorithm**, we kindly request you to cite the following paper:\n\n* S. Shimizu, P. O. Hoyer, A. Hyv\u00e4rinen, and A. Kerminen. **A linear non-gaussian acyclic model for causal discovery**. *Journal of Machine Learning Research*, 7: 2003--2030, 2006. [[PDF]](http://www.jmlr.org/papers/volume7/shimizu06a/shimizu06a.pdf)\n\nShould you use this package for performing **DirectLiNGAM algorithm**, we kindly request you to cite the following two papers:\n\n* S. Shimizu, T. Inazumi, Y. Sogawa, A. Hyv\u00e4rinen, 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]](http://www.jmlr.org/papers/volume12/shimizu11a/shimizu11a.pdf)\n* A. Hyv\u00e4rinen 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]](http://www.jmlr.org/papers/volume14/hyvarinen13a/hyvarinen13a.pdf)\n\nShould you use this package for performing **RESIT algorithm**, we kindly request you to cite the following paper:\n\n* J. Peters, J. M. Mooij, D. Janzing, and B. Sch\u00f6lkopf. **Causal Discovery with Continuous Additive Noise Models**. *Journal of Machine Learning Research*, 15(58): 2009--2053, 2014. [[PDF]](http://www.jmlr.org/papers/volume15/peters14a/peters14a.pdf)\n\n### Time series\n\nShould you use this package for performing **VAR-LiNGAM**, we kindly request you to cite the following paper:\n\n* A. Hyv\u00e4rinen, 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]](http://www.jmlr.org/papers/volume11/hyvarinen10a/hyvarinen10a.pdf)\n\nShould you use this package for performing **VARMA-LiNGAM**, we kindly request you to cite the following paper:\n\n* 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]](http://dx.doi.org/10.1016/j.neucom.2011.02.008)\n\n\n### Multiple datasets\n\nShould you use this package for performing **DirectLiNGAM for multiple groups**, we kindly request you to cite the following paper:\n\n* S. Shimizu. **Joint estimation of linear non-Gaussian acyclic models**. *Neurocomputing*, 81: 104-107, 2012. [[PDF]](http://dx.doi.org/10.1016/j.neucom.2011.11.005)\n\nShould you use this package for performing **LiNGAM for longitudinal data**, we kindly request you to cite the following paper:\n\n* 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]](https://doi.org/10.1109/MLSP.2013.6661912)\n\n\n### Latent confounders and latent factors\n\nShould 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:\n\n* T. Tashiro, S. Shimizu, A. Hyv\u00e4rinen, T. Washio. **ParceLiNGAM: a causal ordering method robust against latent confounders**. Neural computation, 26(1): 57-83, 2014. [[PDF]](https://ieeexplore.ieee.org/abstract/document/6797648)\n\nShould you use this package for performing **RCD algorithm**, we kindly request you to cite the following paper:\n\n* 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]](http://proceedings.mlr.press/v108/maeda20a.html)\n\nShould you use this package for performing **LiNA algorithm**, we kindly request you to cite the following paper:\n\n* 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](https://www.ijcai.org/proceedings/2021/289)]\n\nShould you use this package for performing **CAM-UV algorithm**, we kindly request you to cite the following paper:\n\n* 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]](https://proceedings.mlr.press/v161/maeda21a.html)\n\n### Causality and prediction\n\nShould you use this package for performing **estimation of intervention effects on prediction**, we kindly request you to cite the following paper:\n\n* P. Bl\u00f6baum 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]](https://doi.org/10.1109/MLSP.2017.8168175)\n\n### Mixed data\n\nShould you use this package for performing **LiM algorithm**, we kindly request you to cite the following paper:\n\n* 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]](https://proceedings.mlr.press/v177/zeng22a.html)\n\n \n",
"bugtrack_url": null,
"license": null,
"summary": "LiNGAM Python Package",
"version": "1.9.0",
"project_urls": {
"Homepage": "https://github.com/cdt15/lingam"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2461505128a0763eb45eb30262637ab7d67d739248ca12e96cdba2dc4fdd4b12",
"md5": "801957a128ce0c39712111ec0e94ac98",
"sha256": "2ebe890f17ff2ef5d78a3f9954a7a0517e109de906b6481136d72a5663e6f48b"
},
"downloads": -1,
"filename": "lingam-1.9.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "801957a128ce0c39712111ec0e94ac98",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 100740,
"upload_time": "2024-07-07T13:14:58",
"upload_time_iso_8601": "2024-07-07T13:14:58.311739Z",
"url": "https://files.pythonhosted.org/packages/24/61/505128a0763eb45eb30262637ab7d67d739248ca12e96cdba2dc4fdd4b12/lingam-1.9.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0cde63a7d01f863303e5caff6b4cc42006d8ad4c5f09338549d6008a93ff8ef2",
"md5": "22be355992c6f7929085799da2d9f781",
"sha256": "aa550ece1a0ff7853a22f310586e1479e32dca07a378086d0ed6d31617bbc0ba"
},
"downloads": -1,
"filename": "lingam-1.9.0.tar.gz",
"has_sig": false,
"md5_digest": "22be355992c6f7929085799da2d9f781",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 99582,
"upload_time": "2024-07-07T13:15:00",
"upload_time_iso_8601": "2024-07-07T13:15:00.272424Z",
"url": "https://files.pythonhosted.org/packages/0c/de/63a7d01f863303e5caff6b4cc42006d8ad4c5f09338549d6008a93ff8ef2/lingam-1.9.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-07 13:15:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cdt15",
"github_project": "lingam",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "lingam"
}