Package edu.cmu.tetrad.search.test
Class IndTestBlocksWilkes
java.lang.Object
edu.cmu.tetrad.search.test.IndTestBlocksWilkes
- All Implemented Interfaces:
BlockTest,IndependenceTest,EffectiveSampleSizeSettable
public class IndTestBlocksWilkes
extends Object
implements IndependenceTest, BlockTest, EffectiveSampleSizeSettable
Block-level CI test using Wilks-rank. Robust to |Y| < |X| by padding Y from the leftover observed pool and, if
needed, by subsetting X to |Y|. Thread-safe LRU caches preserved.
-
Constructor Summary
ConstructorsConstructorDescriptionIndTestBlocksWilkes(BlockSpec blockSpec) Constructs an instance of IndTestBlocks using the provided block specification. -
Method Summary
Modifier and TypeMethodDescriptioncheckIndependence(Node x, Node y, Set<Node> z) Checks the independence between two variables x and y given a conditioning set z.doublegetAlpha()Returns the significance level of the independence test.Retrieves the block specification associated with this instance of IndTestBlocks.getData()Retrieves the data model associated with this test.intReturns the effective sample size.Retrieves the list of variables associated with this independence test.booleanReturns true if the test prints verbose output.voidsetAlpha(double alpha) Sets the significance level.voidsetEffectiveSampleSize(int effectiveSampleSize) Sets the effective sample size, or -1 if the actual sample size should be used.voidsetVerbose(boolean verbose) Sets whether this test will print verbose output.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.cmu.tetrad.search.test.IndependenceTest
checkIndependence, determines, getCov, getDataSets, getSampleSize, getVariable, getVariableNames, indTestSubset, toString
-
Constructor Details
-
IndTestBlocksWilkes
Constructs an instance of IndTestBlocks using the provided block specification. This class is used for conducting independence tests based on a dataset's block structure.- Parameters:
blockSpec- the block specification containing metadata about blocks, variables, and the associated dataset. Must not be null. Throws IllegalArgumentException if blockSpec is null or invalid.
-
-
Method Details
-
checkIndependence
Description copied from interface:IndependenceTestChecks the independence between two variables x and y given a conditioning set z.- Specified by:
checkIndependencein interfaceIndependenceTest- Parameters:
x- The first variable to test, represented as a Node object.y- The second variable to test, represented as a Node object.z- The set of conditioning variables, represented as a Set of Node objects.- Returns:
- An IndependenceResult object representing the outcome of the independence test.
-
getVariables
Description copied from interface:IndependenceTestRetrieves the list of variables associated with this independence test.- Specified by:
getVariablesin interfaceIndependenceTest- Returns:
- A list of
Nodeobjects representing the variables.
-
getData
Description copied from interface:IndependenceTestRetrieves the data model associated with this test.- Specified by:
getDatain interfaceIndependenceTest- Returns:
- A
DataModelobject representing the data model.
-
isVerbose
public boolean isVerbose()Description copied from interface:IndependenceTestReturns true if the test prints verbose output.- Specified by:
isVerbosein interfaceIndependenceTest- Returns:
- True if the case.
-
setVerbose
public void setVerbose(boolean verbose) Description copied from interface:IndependenceTestSets whether this test will print verbose output.- Specified by:
setVerbosein interfaceIndependenceTest- Parameters:
verbose- True, if so.
-
getAlpha
public double getAlpha()Description copied from interface:IndependenceTestReturns the significance level of the independence test.- Specified by:
getAlphain interfaceIndependenceTest- Returns:
- This level.
-
setAlpha
public void setAlpha(double alpha) Description copied from interface:IndependenceTestSets the significance level.- Specified by:
setAlphain interfaceIndependenceTest- Parameters:
alpha- This level.
-
getBlockSpec
Retrieves the block specification associated with this instance of IndTestBlocks.- Specified by:
getBlockSpecin interfaceBlockTest- Returns:
- the block specification containing metadata about blocks, variables, and the associated dataset.
-
getEffectiveSampleSize
public int getEffectiveSampleSize()Description copied from interface:EffectiveSampleSizeSettableReturns the effective sample size.- Specified by:
getEffectiveSampleSizein interfaceEffectiveSampleSizeSettable- Returns:
- the effective sample size
-
setEffectiveSampleSize
public void setEffectiveSampleSize(int effectiveSampleSize) Description copied from interface:EffectiveSampleSizeSettableSets the effective sample size, or -1 if the actual sample size should be used.- Specified by:
setEffectiveSampleSizein interfaceEffectiveSampleSizeSettable- Parameters:
effectiveSampleSize- the effective sample size
-