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 ntad-based statistical tests. A ntad 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 correlations, int ess)
    Constructs an instance of NtadTest using the provided data matrix, whether to compute correlations, and the effective sample size (ESS).
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    allGreaterThanAlpha(List<int[][]> ntads, double alpha)
    Checks if all ntads in the provided list have a value greater than the specified alpha.
    abstract double
    ntad(int[][] ntad)
    Computes the value of a statistical test based on the input ntad configuration.
    abstract double
    ntad(int[][] ntad, boolean resample, double frac)
    Computes the value of a statistical test based on the given ntad configuration, with optional resampling.
    abstract double
    ntads(int[][]... ntads)
    Computes the statistical test results for multiple sets of ntad configurations.
    abstract double
    ntads(List<int[][]> ntads)
    Computes a statistical measure based on the input list of ntad 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 correlations, int ess)
      Constructs an instance of NtadTest using the provided data matrix, whether to compute correlations, and the effective sample size (ESS).
      Parameters:
      df - the input data matrix represented as a SimpleMatrix object, where each row is an observation and each column is a variable.
      correlations - a boolean flag indicating whether the provided data matrix should be interpreted directly as a correlation matrix. If false, correlations are computed from the data matrix.
      ess - the effective sample size, which must be -1 (to use the sample size from the data matrix) or greater than 1.
      Throws:
      IllegalArgumentException - if ess is not -1 and not greater than 1.
  • 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).
    • ntad

      public abstract double ntad(int[][] ntad, boolean resample, double frac)
      Computes the value of a statistical test based on the given ntad configuration, with optional resampling. An ntad is a set of indices representing structural relationships among variables. This method evaluates the statistical consistency of such configurations.
      Parameters:
      ntad - a 2D integer array where each inner array defines a ntad 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 ntd test.
    • ntad

      public abstract double ntad(int[][] ntad)
      Computes the value of a statistical test based on the input ntad configuration. A ntad is a set of indices specifying structural relationships between variables, and this method evaluates the statistical consistency of such configurations.
      Parameters:
      ntad - a 2D integer array where each inner array defines an ntad configuration. Each ntad specifies indices representing a structural relationship among variables.
      Returns:
      a double value representing the computed result of the statistical ntad test.
    • ntads

      public abstract double ntads(int[][]... ntads)
      Computes the statistical test results for multiple sets of ntad configurations. A ntad is a set of indices specifying structural relationships among variables, and this method evaluates the statistical consistency for each provided configuration.
      Parameters:
      ntads - a series of 2D integer arrays, where each array contains multiple ntad 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 ntad configurations.
    • ntads

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

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