Class IcaLingam
Implements the ICA-LiNGAM algorithm. The reference is here:
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).
The focus for this implementation was to make a version of ICA-LiNGAM that would be compatible with LiNG-D (see). There are two parameters, one to choose whether an acyclic result will be guaranteed, and another to set a threshold on the lower bound of the absolute value of the coefficients in the B Hat matrix. The latter is used to find edges in the final graph.
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:
- The data are generated by a linear model with non-Gaussian noise.
- The noise is independent across variables.
- The noises for all but possibly one variable are non-Gaussian.
- 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.
There is an option to guarantee the acyclicity of the output, which will set small coefficients to zero until an acyclic model is achieved. If this option is not selected, coefficients below the selected threshold will be set to zero, which allows for certain cyclic structures to be recovered.
There are two methods for estimating W. The first is the default method, which is to use the ICA-LiNG-D algorithm to estimate W. The second is to provide a W matrix estimated by some other method. The latter method is useful for comparing the performance of ICA-LiNGAM to other methods.
There is an option to set a threshold on the coefficients in B Hat. This threshold is used to find edges in the final graph.
The method is implemented as follows:
- Estimate W using LiNG-D or using a user-provided W matrix.
- Find the strongest diagonal for W using a linear assignment process.
- Permute the matrix for this strongest diagonal and scale the matrix to produce B Hat
- Set entries in BHat less than the threshold in absolute value to zero.
- If acyclicity is guaranteed, set small coefficients to zero until an acyclic model is achieved.
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.
- 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.Searches given a W matrix is that is provided by the user (where WX = e).void
setAcyclicityGuaranteed
(boolean acyclicityGuaranteed) Whether the ICA-LiNGAM algorithm is guaranteed to produce an acyclic graph.void
setBThreshold
(double bThreshold) The threshold to use for set small elements to zero in the B Hat matrices.
-
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.
-
fitW
Searches given a W matrix is that is provided by the user (where WX = e).- Parameters:
W
- A W matrix estimated by the user, possibly by some other method.- Returns:
- The estimated B Hat matrix.
-
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.
-
setAcyclicityGuaranteed
public void setAcyclicityGuaranteed(boolean acyclicityGuaranteed) Whether the ICA-LiNGAM algorithm is guaranteed to produce an acyclic graph. This is implemented by setting small coefficients in B hat to zero until an acyclic model is found.- Parameters:
acyclicityGuaranteed
- True, if so.
-