Class IndTestBlocksWilkes

java.lang.Object
edu.cmu.tetrad.search.test.IndTestBlocksWilkes
All Implemented Interfaces:
BlockTest, IndependenceTest, EffectiveSampleSizeSettable

public class IndTestBlocksWilkes extends Object implements IndependenceTest, BlockTest, EffectiveSampleSizeSettable
Block-level CI test using Wilks-rank. Robust to |Y| < |X| by padding Y from the leftover observed pool and, if needed, by subsetting X to |Y|. Thread-safe LRU caches preserved.
  • Constructor Details

    • IndTestBlocksWilkes

      public IndTestBlocksWilkes(BlockSpec blockSpec)
      Constructs an instance of IndTestBlocks using the provided block specification. This class is used for conducting independence tests based on a dataset's block structure.
      Parameters:
      blockSpec - the block specification containing metadata about blocks, variables, and the associated dataset. Must not be null. Throws IllegalArgumentException if blockSpec is null or invalid.
  • Method Details

    • checkIndependence

      public IndependenceResult checkIndependence(Node x, Node y, Set<Node> z)
      Description copied from interface: IndependenceTest
      Checks the independence between two variables x and y given a conditioning set z.
      Specified by:
      checkIndependence in interface IndependenceTest
      Parameters:
      x - The first variable to test, represented as a Node object.
      y - The second variable to test, represented as a Node object.
      z - The set of conditioning variables, represented as a Set of Node objects.
      Returns:
      An IndependenceResult object representing the outcome of the independence test.
    • getVariables

      public List<Node> getVariables()
      Description copied from interface: IndependenceTest
      Retrieves the list of variables associated with this independence test.
      Specified by:
      getVariables in interface IndependenceTest
      Returns:
      A list of Node objects representing the variables.
    • getData

      public DataModel getData()
      Description copied from interface: IndependenceTest
      Retrieves the data model associated with this test.
      Specified by:
      getData in interface IndependenceTest
      Returns:
      A DataModel object representing the data model.
    • isVerbose

      public boolean isVerbose()
      Description copied from interface: IndependenceTest
      Returns true if the test prints verbose output.
      Specified by:
      isVerbose in interface IndependenceTest
      Returns:
      True if the case.
    • setVerbose

      public void setVerbose(boolean verbose)
      Description copied from interface: IndependenceTest
      Sets whether this test will print verbose output.
      Specified by:
      setVerbose in interface IndependenceTest
      Parameters:
      verbose - True, if so.
    • getAlpha

      public double getAlpha()
      Description copied from interface: IndependenceTest
      Returns the significance level of the independence test.
      Specified by:
      getAlpha in interface IndependenceTest
      Returns:
      This level.
    • setAlpha

      public void setAlpha(double alpha)
      Description copied from interface: IndependenceTest
      Sets the significance level.
      Specified by:
      setAlpha in interface IndependenceTest
      Parameters:
      alpha - This level.
    • getBlockSpec

      public BlockSpec getBlockSpec()
      Retrieves the block specification associated with this instance of IndTestBlocks.
      Specified by:
      getBlockSpec in interface BlockTest
      Returns:
      the block specification containing metadata about blocks, variables, and the associated dataset.
    • getEffectiveSampleSize

      public int getEffectiveSampleSize()
      Description copied from interface: EffectiveSampleSizeSettable
      Returns the effective sample size.
      Specified by:
      getEffectiveSampleSize in interface EffectiveSampleSizeSettable
      Returns:
      the effective sample size
    • setEffectiveSampleSize

      public void setEffectiveSampleSize(int effectiveSampleSize)
      Description copied from interface: EffectiveSampleSizeSettable
      Sets the effective sample size, or -1 if the actual sample size should be used.
      Specified by:
      setEffectiveSampleSize in interface EffectiveSampleSizeSettable
      Parameters:
      effectiveSampleSize - the effective sample size