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.booleandetermines(List<Node> z, Node y) Determines the independence between a set of variables and a target variable.doublegetAlpha()Getter for the fieldalpha.getData()Retrieves the original dataset used for the independence test.doublegetPValue.getVariables.indTestSubset(List<Node> vars) Tests the conditional independence between two variables given a sublist of variables.booleanChecks if the program is in verbose mode.voidsetAlpha(double alpha) Sets the significance level of the independence test.voidsetVerbose(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, waitMethods inherited from interface edu.cmu.tetrad.search.test.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:
indTestSubsetin 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:
checkIndependencein interfaceIndependenceTest- Parameters:
x- the first variabley- the second variablez- the set of conditioning variables- Returns:
- the result of the independence test
-
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:
getVariablesin 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:
getAlphain 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:
setAlphain interfaceIndependenceTest- Parameters:
alpha- This level.
-
getData
Retrieves the original dataset used for the independence test.- Specified by:
getDatain interfaceIndependenceTest- Returns:
- The original dataset used for the independence test.
-
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:
toStringin interfaceIndependenceTest- Overrides:
toStringin classObject- Returns:
- A string representation of the object.
-
isVerbose
public boolean isVerbose()Checks if the program is in verbose mode.- Specified by:
isVerbosein 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:
setVerbosein interfaceIndependenceTest- Parameters:
verbose- True if the program should be in verbose mode, false otherwise.
-