Package edu.cmu.tetrad.search.ntad_test
Class Cca
java.lang.Object
edu.cmu.tetrad.search.ntad_test.NtadTest
edu.cmu.tetrad.search.ntad_test.Cca
The Cca class extends the NtadTest class and provides a mechanism to perform Canonical Correlation Analysis (CCA) as
a rank-based way of getting a p-value for a tetrad.
Anderson, T. W., Anderson, T. W., Anderson, T. W., & Anderson, T. W. (1958). An introduction to multivariate statistical analysis (Vol. 2, pp. 3-5). New York: Wiley.
Huang, B., Low, C. J. H., Xie, F., Glymour, C., & Zhang, K. (2022). Latent hierarchical causal structure discovery with rank constraints. Advances in neural information processing systems, 35, 5549-5561.
- Author:
- bryanandrews
-
Constructor Summary
ConstructorsConstructorDescriptionCca(org.ejml.simple.SimpleMatrix df, boolean covariances) Constructs a new Cca object based on the provided data matrix and covariance option. -
Method Summary
Modifier and TypeMethodDescriptiondoubletetrad(int[][] tet) Computes the value of a statistical test based on the input tetrad configuration.doubletetrad(int[][] tet, boolean resample, double frac) Computes the value of a statistical test based on the given tetrad configuration, with optional resampling.doubletetrads(int[][]... tets) Returns the p-value for the tetrad.doubleReturns the p-value for the tetrad.Methods inherited from class edu.cmu.tetrad.search.ntad_test.NtadTest
allGreaterThanAlpha, variables
-
Constructor Details
-
Cca
public Cca(org.ejml.simple.SimpleMatrix df, boolean covariances) Constructs a new Cca object based on the provided data matrix and covariance option.- Parameters:
df- the input data matrix as a SimpleMatrix object, where each row represents an observation and each column represents a variable.covariances- a boolean indicating whether the provided data matrix represents covariances (true) or raw data (false). If false, the covariance matrix will be computed from the raw data.
-
-
Method Details
-
tetrad
public double tetrad(int[][] tet, boolean resample, double frac) Description copied from class:NtadTestComputes the value of a statistical test based on the given tetrad configuration, with optional resampling. A tetrad is a set of indices representing structural relationships among variables. This method evaluates the statistical consistency of such configurations.- Specified by:
tetradin classNtadTest- Parameters:
tet- a 2D integer array where each inner array defines a tetrad configuration. Each configuration specifies indices representing structural relationships among variables.resample- a boolean indicating whether resampling should be applied to the data matrix for the computation.frac- a double value representing the fraction of data to use during resampling, ignored if resample is false.- Returns:
- a double value representing the computed result of the statistical tetrad test.
-
tetrad
public double tetrad(int[][] tet) Description copied from class:NtadTestComputes the value of a statistical test based on the input tetrad configuration. A tetrad is a set of indices specifying structural relationships between variables, and this method evaluates the statistical consistency of such configurations.- Specified by:
tetradin classNtadTest- Parameters:
tet- a 2D integer array where each inner array defines a tetrad configuration. Each tetrad specifies indices representing a structural relationship among variables.- Returns:
- a double value representing the computed result of the statistical tetrad test.
-
tetrads
public double tetrads(int[][]... tets) Returns the p-value for the tetrad. This constructor is required by the interface, though in truth it will throw and exception if more than one tetrad is provided. -
tetrads
Returns the p-value for the tetrad. This constructor is required by the interface, though in truth it will throw and exception if more than one tetrad is provided.
-