Class IndTestMultinomialLogisticRegression

java.lang.Object
edu.cmu.tetrad.search.work_in_progress.IndTestMultinomialLogisticRegression
All Implemented Interfaces:
IndependenceTest

public class IndTestMultinomialLogisticRegression 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.

This logisticRegression makes multiple assumptions: 1. IIA 2. Large sample size (multiple regressions needed on subsets of sample)

Version:
$Id: $Id
Author:
josephramsey, Augustus Mayo.
  • Constructor Details

    • IndTestMultinomialLogisticRegression

      public IndTestMultinomialLogisticRegression(DataSet data, double alpha)

      Constructor for IndTestMultinomialLogisticRegression.

      Parameters:
      data - a DataSet object
      alpha - a double
  • Method Details

    • indTestSubset

      public IndependenceTest indTestSubset(List<Node> vars)
      Performs an independence test for a sublist of variables.
      Specified by:
      indTestSubset in interface IndependenceTest
      Parameters:
      vars - The sublist of variables.
      Returns:
      An object of type IndependenceTest.
      Throws:
      UnsupportedOperationException - if the independence subset feature is not implemented.
    • checkIndependence

      public IndependenceResult checkIndependence(Node x, Node y, Set<Node> z)
      Checks for independence between two nodes, given a set of conditioning nodes.
      Specified by:
      checkIndependence in interface IndependenceTest
      Parameters:
      x - The first node.
      y - The second node.
      z - The set of conditioning nodes.
      Returns:
      An object of type IndependenceResult indicating the independence relationship between x and y, given z.
      See Also:
    • getPValue

      public double getPValue()

      getPValue.

      Returns:
      the probability associated with the most recently executed independence test, of Double.NaN if p value is not meaningful for tis test.
    • getVariables

      public List<Node> getVariables()

      getVariables.

      Specified by:
      getVariables in interface IndependenceTest
      Returns:
      the list of searchVariables over which this independence checker is capable of determinining independence relations.
    • determines

      public boolean determines(List<Node> z, Node y)
      Determines if Node y is determined by the given list of Nodes z.
      Parameters:
      z - The list of Nodes to condition on.
      y - The Node to be determined.
      Returns:
      True if y is determined by z, false otherwise.
    • getAlpha

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

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

      public DataSet getData()
      Retrieves the original data used for the independence test.
      Specified by:
      getData in interface IndependenceTest
      Returns:
      The original DataSet object used for the independence test.
      See Also:
    • toString

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

      public boolean isVerbose()
      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)
      Sets whether this test will print verbose output.
      Specified by:
      setVerbose in interface IndependenceTest
      Parameters:
      verbose - True, if so.