Skip to main content

LiNGAM Python Package

Project description

LiNGAM - Discovery of non-gaussian linear causal models

License Read the Docs

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

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

Tutrial and API reference

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

Basic

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]

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]

Causality and prediction

Should you use this package for performing estimation of intervension 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]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lingam-1.5.5.tar.gz (46.3 kB view hashes)

Uploaded source

Built Distribution

lingam-1.5.5-py3-none-any.whl (67.3 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page