Class Cca

java.lang.Object
edu.cmu.tetrad.search.ntad_test.NtadTest
edu.cmu.tetrad.search.ntad_test.Cca

public class Cca extends NtadTest
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

    Constructors
    Constructor
    Description
    Cca(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 Type
    Method
    Description
    double
    tetrad(int[][] tet)
    Computes the value of a statistical test based on the input tetrad configuration.
    double
    tetrad(int[][] tet, boolean resample, double frac)
    Computes the value of a statistical test based on the given tetrad configuration, with optional resampling.
    double
    tetrads(int[][]... tets)
    Returns the p-value for the tetrad.
    double
    tetrads(List<int[][]> tets)
    Returns the p-value for the tetrad.

    Methods inherited from class edu.cmu.tetrad.search.ntad_test.NtadTest

    allGreaterThanAlpha, variables

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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: NtadTest
      Computes 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:
      tetrad in class NtadTest
      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: NtadTest
      Computes 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:
      tetrad in class NtadTest
      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.
      Specified by:
      tetrads in class NtadTest
      Parameters:
      tets - A single tetrad.
      Returns:
      The p-value for the tetrad.
    • tetrads

      public double tetrads(List<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.
      Specified by:
      tetrads in class NtadTest
      Parameters:
      tets - A single tetrad.
      Returns:
      The p-value for the tetrad.