Class IndTestConditionalGaussianLrt

java.lang.Object
edu.cmu.tetrad.search.test.IndTestConditionalGaussianLrt
All Implemented Interfaces:
IndependenceTest

public class IndTestConditionalGaussianLrt extends Object implements IndependenceTest
Performs a test of conditional independence X _||_ Y | Z1...Zn where all searchVariables are either continuous or discrete. This test is valid for both ordinal and non-ordinal discrete searchVariables.

Assumes a conditional Gaussian model and uses a likelihood ratio test.

Version:
$Id: $Id
Author:
josephramsey
  • Constructor Details

    • IndTestConditionalGaussianLrt

      public IndTestConditionalGaussianLrt(DataSet data, double alpha, boolean discretize)
      Constructor.
      Parameters:
      data - The data to analyze.
      alpha - The significance level.
      discretize - Whether discrete children of continuous parents should be discretized.
  • Method Details

    • indTestSubset

      public IndependenceTest indTestSubset(List<Node> vars)
      This method returns an instance of the IndependenceTest interface that can test the independence of a subset of variables.
      Specified by:
      indTestSubset in interface IndependenceTest
      Parameters:
      vars - The sublist of variables to test for independence.
      Returns:
      An instance of the IndependenceTest interface.
      See Also:
    • checkIndependence

      public IndependenceResult checkIndependence(Node x, Node y, Set<Node> _z)
      Returns and independence result that states whether x _||_y | z and what the p-value of the test is.
      Specified by:
      checkIndependence in interface IndependenceTest
      Parameters:
      x - a Node object
      y - a Node object
      _z - a Set object
      Returns:
      a IndependenceResult object
      See Also:
    • getVariables

      public List<Node> getVariables()
      Returns the list of variables over which this independence checker is capable of determining independence relations.
      Specified by:
      getVariables in interface IndependenceTest
      Returns:
      This list.
    • determines

      public boolean determines(List<Node> z, Node y)
      Determines whether a given list of nodes (z) determines a node (y).
      Parameters:
      z - The list of nodes to check if they determine y.
      y - The node to check if it is determined by z.
      Returns:
      True if z determines y, false otherwise.
      Throws:
      UnsupportedOperationException - if not implemented.
    • getAlpha

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

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

      public DataSet getData()
      Returns the data.
      Specified by:
      getData in interface IndependenceTest
      Returns:
      This data.
      See Also:
    • toString

      public String toString()
      Returns a string representation of this test.
      Specified by:
      toString in interface IndependenceTest
      Overrides:
      toString in class Object
      Returns:
      This string.
    • isVerbose

      public boolean isVerbose()
      Returns true iff verbose output should be printed.
      Specified by:
      isVerbose in interface IndependenceTest
      Returns:
      True if the case.
    • setVerbose

      public void setVerbose(boolean verbose)
      Sets whether verbose output should be printed.
      Specified by:
      setVerbose in interface IndependenceTest
      Parameters:
      verbose - True, if so.
    • setNumCategoriesToDiscretize

      public void setNumCategoriesToDiscretize(int numCategoriesToDiscretize)
      Sets the number of categories used to discretize variables.
      Parameters:
      numCategoriesToDiscretize - This number, by default 3.