Package edu.cmu.tetrad.search.test
Class IndTestTrekSep
java.lang.Object
edu.cmu.tetrad.search.test.IndTestTrekSep
- All Implemented Interfaces:
IndependenceTest
Checks d-separations in structural model using t-separations over indicators.
- Author:
- Adam Brodie
-
Constructor Summary
ConstructorsConstructorDescriptionIndTestTrekSep
(ICovarianceMatrix covMatrix, double alpha, List<List<Node>> clustering, List<Node> latents) Constructs a new independence test that will determine conditional independence facts using the given correlation matrix and the given significance level. -
Method Summary
Modifier and TypeMethodDescriptioncheckIndependence
(Node x, Node y, List<Node> z) Determines whether variable x is independent of variable y given a list of conditioning variables z.boolean
determines
(List<Node> z, Node x) IfisDeterminismAllowed()
, defers to IndTestFisherZD; otherwise throws UnsupportedOperationException.double
getAlpha()
Gets the model significance level.getCov()
Returns the covariance matrix.getData()
Returns the data set being analyzed.Returns a singleton list consisting just of the dataset for this test.double
Returns the probability associated with the most recently computed independence test.int
Returns the sample size.double
getScore()
Returns alpha - p.getVariable
(String name) Returns the variable with the given name.Returns the list of variables over which this independence checker is capable of determinine independence relations-- that is, all the variables in the given graph or the given data set.indTestSubset
(List<Node> vars) Creates a new independence test instance for a sublist of the variables.boolean
Returns true if verbose output should be printed.void
setAlpha
(double alpha) Sets the significance level at which independence judgments should be made.void
setVariables
(List<Node> variables) Sets the varialbe to this list (of the same length).void
setVerbose
(boolean verbose) Sets whether verbose output should be printed.toString()
Returns a string representation of this test.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface edu.cmu.tetrad.search.test.IndependenceTest
checkIndependence, getVariableNames
-
Constructor Details
-
IndTestTrekSep
public IndTestTrekSep(ICovarianceMatrix covMatrix, double alpha, List<List<Node>> clustering, List<Node> latents) Constructs a new independence test that will determine conditional independence facts using the given correlation matrix and the given significance level.- Parameters:
covMatrix
- The covariance over the measures.alpha
- The significance level.clustering
- The clustering of the measured variables. In each cluster, all measured variable in the cluster are explained by a single latent.latents
- The list of latent variables for the clusters, in order.
-
-
Method Details
-
indTestSubset
Creates a new independence test instance for a sublist of the variables.- Specified by:
indTestSubset
in interfaceIndependenceTest
- Parameters:
vars
- The sublist.
-
checkIndependence
Determines whether variable x is independent of variable y given a list of conditioning variables z.- Specified by:
checkIndependence
in interfaceIndependenceTest
- Parameters:
x
- the one variable being compared.y
- the second variable being compared.z
- the list of conditioning variables.- Returns:
- True iff x _||_ y | z.
- Throws:
org.apache.commons.math3.linear.SingularMatrixException
- if a matrix singularity is encountered.- See Also:
-
getPValue
public double getPValue()Returns the probability associated with the most recently computed independence test.- Returns:
- This p-value.
-
setAlpha
public void setAlpha(double alpha) Sets the significance level at which independence judgments should be made. Affects the cutoff for partial correlations to be considered statistically equal to zero.- Specified by:
setAlpha
in interfaceIndependenceTest
- Parameters:
alpha
- This significance level.
-
getAlpha
public double getAlpha()Gets the model significance level.- Specified by:
getAlpha
in interfaceIndependenceTest
- Returns:
- This alpha.
-
getVariables
Returns the list of variables over which this independence checker is capable of determinine independence relations-- that is, all the variables in the given graph or the given data set.- Specified by:
getVariables
in interfaceIndependenceTest
- Returns:
- This list.
-
getVariable
Returns the variable with the given name.- Specified by:
getVariable
in interfaceIndependenceTest
- Returns:
- This variable.
-
determines
IfisDeterminismAllowed()
, defers to IndTestFisherZD; otherwise throws UnsupportedOperationException.- Specified by:
determines
in interfaceIndependenceTest
- Returns:
- True if so
- Throws:
UnsupportedOperationException
- If the above condition is not met.
-
getData
Returns the data set being analyzed.- Specified by:
getData
in interfaceIndependenceTest
- Returns:
- This data.
- See Also:
-
toString
Returns a string representation of this test.- Specified by:
toString
in interfaceIndependenceTest
- Overrides:
toString
in classObject
- Returns:
- This string.
-
setVariables
Sets the varialbe to this list (of the same length). Useful is multiple test are used that need the same object-identical lists of variables.- Parameters:
variables
- This list.
-
getCov
Returns the covariance matrix.- Specified by:
getCov
in interfaceIndependenceTest
- Returns:
- This matrix.
-
getDataSets
Returns a singleton list consisting just of the dataset for this test.- Specified by:
getDataSets
in interfaceIndependenceTest
- Returns:
- This lsit.
-
getSampleSize
public int getSampleSize()Returns the sample size.- Specified by:
getSampleSize
in interfaceIndependenceTest
- Returns:
- This size.
-
getScore
public double getScore()Returns alpha - p.- Specified by:
getScore
in interfaceIndependenceTest
- Returns:
- This nubmer.
-
isVerbose
public boolean isVerbose()Returns true if verbose output should be printed.- Specified by:
isVerbose
in interfaceIndependenceTest
- Returns:
- True if so.
-
setVerbose
public void setVerbose(boolean verbose) Sets whether verbose output should be printed.- Specified by:
setVerbose
in interfaceIndependenceTest
- Parameters:
verbose
- True if so.
-