Package edu.cmu.tetrad.search.utils
Class PreserveMarkov
java.lang.Object
edu.cmu.tetrad.search.utils.PreserveMarkov
A helper class to encapsulate logic for preserving a Markov property for subsequent testing after an initial local
Markov graph has been found.
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPreserveMarkov(Graph graph, IndependenceTest test, boolean preserveMarkov) Constructs an PreserveMarkov class for a given Markov graph.PreserveMarkov(PreserveMarkov preserveMarkov) Creates a new instance of the PreserveMarkov class by copying the fields from another PreserveMarkov object. -
Method Summary
Modifier and TypeMethodDescriptionmarkovAdjustPValues(Graph graph, boolean preserveMarkov, IndependenceTest test, Map<org.apache.commons.lang3.tuple.Pair<Node, Node>, Set<Double>> pValues, org.apache.commons.lang3.tuple.Pair<Node, Node> withoutPair) Adjusts the p-values for a local Markov condition in a given constraint-based partially directed acyclic graph (CPDAG).booleanmarkovIndependence(Node x, Node y, Set<Node> z) Checks the independence of two nodes given a set of conditioning nodes, and if Markov is to be preserved, checks to make sure the additional independence does not generate p-values that violate the Markov property.
-
Constructor Details
-
PreserveMarkov
Constructs an PreserveMarkov class for a given Markov graph.- Parameters:
graph- The initial Markov graph. This graph should pass a local Markov check.test- The independence test to use.preserveMarkov- True if Markov should be preserved.
-
PreserveMarkov
Creates a new instance of the PreserveMarkov class by copying the fields from another PreserveMarkov object.- Parameters:
preserveMarkov- The PreserveMarkov object to be copied. Must not be null.
-
-
Method Details
-
markovAdjustPValues
public static Map<org.apache.commons.lang3.tuple.Pair<Node,Node>, markovAdjustPValuesSet<Double>> (Graph graph, boolean preserveMarkov, IndependenceTest test, Map<org.apache.commons.lang3.tuple.Pair<Node, Node>, throws InterruptedExceptionSet<Double>> pValues, org.apache.commons.lang3.tuple.Pair<Node, Node> withoutPair) Adjusts the p-values for a local Markov condition in a given constraint-based partially directed acyclic graph (CPDAG).- Parameters:
graph- the constraint-based partially directed acyclic graph (CPDAG) to adjust p-values forpreserveMarkov- a boolean flag indicating if the Markov condition should be preserved; should be truetest- the independence test to be used; must not be null and not an instance of MsepTestpValues- a map of node pairs to sets of p-values used for adjustmentwithoutPair- a pair of nodes for which adjustments are calculated without considering the edge between them- Returns:
- a map of node pairs to sets of adjusted p-values
- Throws:
IllegalArgumentException- if preserveMarkov is false or if the test is null or an instance of MsepTestInterruptedException- if any
-
markovIndependence
Checks the independence of two nodes given a set of conditioning nodes, and if Markov is to be preserved, checks to make sure the additional independence does not generate p-values that violate the Markov property. Returns the independence-result, marked as 'true' if the nodes are independent or if the Markov property is preserved and the nodes are independent and the Markov property wouldn't be violated by the additional independence.- Parameters:
x- The first node.y- The second node.z- The set of conditioning nodes.- Returns:
- True if the nodes are independent.
- Throws:
InterruptedException- if any.
-