Package edu.cmu.tetrad.search.test
Class IndependenceResult
java.lang.Object
edu.cmu.tetrad.search.test.IndependenceResult
- All Implemented Interfaces:
TetradSerializable
,Serializable
Stores a single conditional independence result, e.g., whether X _||_ Y | Z1,...,Zn holds or does not, and the
p-value of the test.
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionIndependenceResult
(IndependenceFact fact, boolean indep, double pValue, double score) Constructor.IndependenceResult
(IndependenceFact fact, boolean indep, double pValue, double score, boolean isValid) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetFact()
Returns the independence fact being stored.double
Returns the p-value of the fact under the null hypothesis of independence.double
getScore()
Returns the score of the test, which is alpha - p if the test returns a p-value or else a bump if the test is based on a score.boolean
Returns whether the fact fails to hold--i.e.boolean
Returns true if the judgment is for independence, false if for dependence.boolean
isValid()
Returns whether the result is valid or not.static IndependenceResult
Generates a simple exemplar of this class to test serialization.toString()
Returns a string representation of this independence fact.
-
Constructor Details
-
IndependenceResult
Constructor. For this constructor, is it assumed that the test is valid.- Parameters:
fact
- The fact itself.indep
- The conditional independence result, true if the fact holds, false if not.pValue
- The p-values of the independence result, under the null (independence) hypothesis.score
- The score of the test, which is alpha - p if the test returns a p-value or else a bump if the test is based on a score.- See Also:
-
IndependenceResult
public IndependenceResult(IndependenceFact fact, boolean indep, double pValue, double score, boolean isValid) Constructor. For this constructor, the validity of the test is specified.- Parameters:
fact
- The fact itself.indep
- The conditional independence result, true if the fact holds, false if not.pValue
- The p-values of the independence result, under the null (independence) hypothesis.score
- The score of the test, which is alpha - p if the test returns a p-value or else a bump if the test is based on a score.isValid
- Whether the result is valid or not. A test is not valid if the test is not able to determine whether the fact holds or not.- See Also:
-
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization.- Returns:
- a
IndependenceResult
object - See Also:
-
getFact
Returns the independence fact being stored.- Returns:
- This fact
- See Also:
-
isIndependent
public boolean isIndependent()Returns true if the judgment is for independence, false if for dependence.- Returns:
- True if the fact holds, false if not.
- See Also:
-
isDependent
public boolean isDependent()Returns whether the fact fails to hold--i.e. if the judgment is for dependence. This is the negation of isIndependent().- Returns:
- True if the fact does not, false if it does.
- See Also:
-
getPValue
public double getPValue()Returns the p-value of the fact under the null hypothesis of independence. A special case obtains if this fact is being used to store a d-separation fact, in which case the "p-value" is deemed to be 0 if the fact holds and 1 if it does not.- Returns:
- The p-value of the result under the null hypothesis.
-
toString
-
getScore
public double getScore()Returns the score of the test, which is alpha - p if the test returns a p-value or else a bump if the test is based on a score.- Returns:
- The score of the test.
-
isValid
public boolean isValid()Returns whether the result is valid or not. A test is not valid if the test is not able to determine whether the fact holds or not.- Returns:
- True if the result is valid, false if not.
-