Class IndTestMultinomialLogisticRegressionWald

java.lang.Object
edu.pitt.csb.mgm.IndTestMultinomialLogisticRegressionWald
All Implemented Interfaces:
IndependenceTest

public class IndTestMultinomialLogisticRegressionWald 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

    • IndTestMultinomialLogisticRegressionWald

      public IndTestMultinomialLogisticRegressionWald(DataSet data, double alpha, boolean preferLinear)
      Constructs a new instance of IndTestMultinomialLogisticRegressionWald with the specified parameters.
      Parameters:
      data - The dataset to perform the independence test on.
      alpha - The significance level of the independence test. Must be in the range [0, 1].
      preferLinear - Whether to prefer the linear model for the logistic regression.
      Throws:
      IllegalArgumentException - if the alpha value is not in the range [0, 1].
  • Method Details

    • indTestSubset

      public IndependenceTest indTestSubset(List<Node> vars)
      Tests the conditional independence between two variables given a sublist of variables.
      Specified by:
      indTestSubset in interface IndependenceTest
      Parameters:
      vars - The sublist of variables.
      Returns:
      The result of the independence test.
    • checkIndependence

      public IndependenceResult checkIndependence(Node x, Node y, Set<Node> z)
      Determines the independence between two variables given a set of conditioning variables.
      Specified by:
      checkIndependence in interface IndependenceTest
      Parameters:
      x - the first variable
      y - the second variable
      z - the set of conditioning variables
      Returns:
      the result of the independence test
      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 the independence between a set of variables and a target variable.
      Parameters:
      z - The set of conditioning variables.
      y - The target variable to test for independence.
      Returns:
      True if the target variable y is independent of the set of conditioning variables z, false otherwise.
    • getAlpha

      public double getAlpha()

      Getter for the field alpha.

      Specified by:
      getAlpha in interface IndependenceTest
      Returns:
      the significance level of the independence test.
      Throws:
      UnsupportedOperationException - if there is no significance level.
    • setAlpha

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

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

      public String toString()
      Returns a string representation of the object. The returned string includes the type of the regression (Multinomial Logistic Regression) and the alpha value used.
      Specified by:
      toString in interface IndependenceTest
      Overrides:
      toString in class Object
      Returns:
      A string representation of the object.
    • isVerbose

      public boolean isVerbose()
      Checks if the program is in verbose mode.
      Specified by:
      isVerbose in interface IndependenceTest
      Returns:
      true if the program is in verbose mode, false otherwise
    • setVerbose

      public void setVerbose(boolean verbose)
      Sets the verbose mode of the program.
      Specified by:
      setVerbose in interface IndependenceTest
      Parameters:
      verbose - True if the program should be in verbose mode, false otherwise.