Package edu.pitt.csb.mgm
Class IndTestMultinomialLogisticRegressionWald
java.lang.Object
edu.pitt.csb.mgm.IndTestMultinomialLogisticRegressionWald
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionIndTestMultinomialLogisticRegressionWald
(DataSet data, double alpha, boolean preferLinear) Constructs a new instance of IndTestMultinomialLogisticRegressionWald with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptioncheckIndependence
(Node x, Node y, Set<Node> z) Determines the independence between two variables given a set of conditioning variables.boolean
determines
(List<Node> z, Node y) Determines the independence between a set of variables and a target variable.double
getAlpha()
Getter for the fieldalpha
.getData()
Retrieves the original dataset used for the independence test.double
getPValue.getVariables.indTestSubset
(List<Node> vars) Tests the conditional independence between two variables given a sublist of variables.boolean
Checks if the program is in verbose mode.void
setAlpha
(double alpha) Sets the significance level of the independence test.void
setVerbose
(boolean verbose) Sets the verbose mode of the program.toString()
Returns a string representation of the object.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface edu.cmu.tetrad.search.IndependenceTest
checkIndependence, determines, getCov, getDataSets, getSampleSize, getVariable, getVariableNames
-
Constructor Details
-
IndTestMultinomialLogisticRegressionWald
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
Tests the conditional independence between two variables given a sublist of variables.- Specified by:
indTestSubset
in interfaceIndependenceTest
- Parameters:
vars
- The sublist of variables.- Returns:
- The result of the independence test.
-
checkIndependence
Determines the independence between two variables given a set of conditioning variables.- Specified by:
checkIndependence
in interfaceIndependenceTest
- Parameters:
x
- the first variabley
- the second variablez
- 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
getVariables.
- Specified by:
getVariables
in interfaceIndependenceTest
- Returns:
- the list of searchVariables over which this independence checker is capable of determinining independence relations.
-
determines
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 interfaceIndependenceTest
- 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 interfaceIndependenceTest
- Parameters:
alpha
- This level.
-
getData
Retrieves the original dataset used for the independence test.- Specified by:
getData
in interfaceIndependenceTest
- Returns:
- The original dataset used for the independence test.
- See Also:
-
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 interfaceIndependenceTest
- Overrides:
toString
in classObject
- Returns:
- A string representation of the object.
-
isVerbose
public boolean isVerbose()Checks if the program is in verbose mode.- Specified by:
isVerbose
in interfaceIndependenceTest
- 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 interfaceIndependenceTest
- Parameters:
verbose
- True if the program should be in verbose mode, false otherwise.
-