Class IcaLingam
Shimizu, S., Hoyer, P. O., Hyvärinen, A., Kerminen, A., & Jordan, M. (2006). A linear non-Gaussian acyclic model for causal discovery. Journal of Machine Learning Research, 7(10).
ICA-LiNGAM is a method for estimating a causal graph from a dataset. It is based on the assumption that the data are generated by a linear model with non-Gaussian noise. The method is based on the following assumptions: (1) The data are generated by a linear model with non-Gaussian noise. (2) The noise is independent across variables. (3) The noises for all but possibly one variable are non-Gaussian. (4) There is no unobserved confounding.
Under these assumptions, the method estimates a matrix W such that WX = e, where X is the data matrix, e is a matrix of noise, and W is a matrix of coefficients. The matrix W is then used to estimate a matrix B Hat, where B Hat is the matrix of coefficients in the linear model that generated the data. The graph is then estimated by finding edges in B Hat.
We guarantee acyclicity of the output using one of the algorithms in the paper--i.e. we set small coefficients to zero until an acyclic model is achieved, setting any coefficients below threshold to zero as well.
We are using the Hungarian Algorithm to solve the linear assignment problem for finding the best diagonal for W.
This class is not configured to respect knowledge of forbidden and required edges.
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFits an ICA-LiNGAM model to the given dataset using a default method for estimating W.Calculates and returns the trimmed BHat matrix in an acyclic form using the given matrix W.boolean
Determines whether a BHat matrix parses to an acyclic graph.void
setBThreshold
(double bThreshold) The threshold to use for set small elements to zero in the B Hat matrices.void
setVerbose
(boolean verbose) A boolean indicating whether to print verbose output.
-
Constructor Details
-
IcaLingam
public IcaLingam()Constructor.
-
-
Method Details
-
fit
Fits an ICA-LiNGAM model to the given dataset using a default method for estimating W.- Parameters:
D
- A continuous dataset.- Returns:
- The BHat matrix, where B[i][j] gives the coefficient of j->i if nonzero.
-
getAcyclicTrimmedBHat
Calculates and returns the trimmed BHat matrix in an acyclic form using the given matrix W.- Parameters:
W
- The input matrix. The BHat matrix is derived from this matrix.- Returns:
- The trimmed BHat matrix in an acyclic form.
-
isAcyclic
Determines whether a BHat matrix parses to an acyclic graph.- Parameters:
scaledBHat
- The BHat matrix.- Returns:
- a boolean
-
setBThreshold
public void setBThreshold(double bThreshold) The threshold to use for set small elements to zero in the B Hat matrices.- Parameters:
bThreshold
- Some value >= 0.
-
setVerbose
public void setVerbose(boolean verbose) A boolean indicating whether to print verbose output.- Parameters:
verbose
- a boolean
-