Class NtadTest

java.lang.Object
edu.cmu.tetrad.search.ntad_test.NtadTest
Direct Known Subclasses:
Ark, BollenTing, Cca, Wishart

public abstract class NtadTest extends Object
NtadTest is an abstract base class for implementing tetrad-based statistical tests. A tetrad specifies structural relationships among variables, and this class provides methods to compute covariance matrices, generate combinations, and perform resampling for such tests.
Author:
bryanandrews
  • Constructor Summary

    Constructors
    Constructor
    Description
    NtadTest(org.ejml.simple.SimpleMatrix df, boolean covariances)
    Constructs an NtadTest object with the provided data matrix and a flag indicating whether the input matrix represents covariances or raw data.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    allGreaterThanAlpha(List<int[][]> tets, double alpha)
    Checks if all tetrads in the provided list have a value greater than the specified alpha.
    abstract double
    tetrad(int[][] tet)
    Computes the value of a statistical test based on the input tetrad configuration.
    abstract double
    tetrad(int[][] tet, boolean resample, double frac)
    Computes the value of a statistical test based on the given tetrad configuration, with optional resampling.
    abstract double
    tetrads(int[][]... tets)
    Computes the statistical test results for multiple sets of tetrad configurations.
    abstract double
    tetrads(List<int[][]> tets)
    Computes a statistical measure based on the input list of tetrad configurations.
    Generates a list of strings representing the variable indices from 0 to p-1.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NtadTest

      public NtadTest(org.ejml.simple.SimpleMatrix df, boolean covariances)
      Constructs an NtadTest object with the provided data matrix and a flag indicating whether the input matrix represents covariances or raw data.
      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 flag indicating whether the provided matrix is a covariance matrix (true) or raw data requiring covariance computation (false)
  • Method Details

    • variables

      public List<String> variables()
      Generates a list of strings representing the variable indices from 0 to p-1.
      Returns:
      a list of strings where each string represents a variable index in the range from 0 (inclusive) to p (exclusive).
    • tetrad

      public abstract double tetrad(int[][] tet, boolean resample, double frac)
      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.
      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 abstract double tetrad(int[][] tet)
      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.
      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 abstract double tetrads(int[][]... tets)
      Computes the statistical test results for multiple sets of tetrad configurations. A tetrad is a set of indices specifying structural relationships among variables, and this method evaluates the statistical consistency for each provided configuration.
      Parameters:
      tets - a series of 2D integer arrays, where each array contains multiple tetrad configurations. Each configuration specifies a set of indices representing structural relationships among variables.
      Returns:
      a double value representing the aggregated or combined result of the statistical tests applied to the provided tetrad configurations.
    • tetrads

      public abstract double tetrads(List<int[][]> tets)
      Computes a statistical measure based on the input list of tetrad configurations. Each tetrad configuration represents a set of structural relationships among variables. This method evaluates and combines the statistical results of all provided configurations.
      Parameters:
      tets - a list of 2D integer arrays where each array contains multiple tetrad configurations. Each configuration is a set of integer indices representing structural relationships.
      Returns:
      a double value representing the combined statistical measure for the provided tetrad configurations.
    • allGreaterThanAlpha

      public boolean allGreaterThanAlpha(List<int[][]> tets, double alpha)
      Checks if all tetrads in the provided list have a value greater than the specified alpha.
      Parameters:
      tets - The list of tetrads to check.
      alpha - The threshold value.
      Returns:
      true if all tetrads are greater than alpha, false otherwise.