Package edu.cmu.tetrad.search
Class PcMb
java.lang.Object
edu.cmu.tetrad.search.PcMb
- All Implemented Interfaces:
IGraphSearch
,IMbSearch
Searches for a CPDAG representing all the Markov blankets for a given target T consistent with the given independence
information. This CPDAG may be used to generate the actual list of DAG's that might be Markov blankets. Note that
this code has been converted to be consistent with the CPC algorithm. The reference is here:
Bai, X., Padman, R., Ramsey, J., & Spirtes, P. (2008). Tabu search-enhanced graphical models for classification in high dimensions. INFORMS Journal on Computing, 20(3), 423-437.
This class is configured to respect knowledge of forbidden and required edges, including knowledge of temporal tiers.
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGiven the target, this returns all the nodes in the Markov Blanket.Returns "PC-MB."Returns the set of triples identified as ambiguous by the CPC algorithm during the most recent search.int
getDepth()
Returns the depth of the search--that is, the maximum number of variables conditioned on in any conditional independence test.long
Returns the elapsed time of the most recent search.Returns The knowledge used in search.int
Returns the number of independence tests performed during the most recent search.Return the targets of the most recent search.getTest()
Returns the test used in search.Returns the result graph.search()
Searches for the Markov blanket CPDAG for the given targets.Searches for the MB CPDAG for the given targets.void
setDepth
(int depth) Sets the maximum number of conditioning variables for any conditional independence test.void
setFindMb
(boolean findMb) Setter for the fieldfindMb
.void
setKnowledge
(Knowledge knowledge) Sets knowledge, to which the algorithm is in fact sensitive.void
setMeekPreventCycles
(boolean meekPreventCycles) Sets whether cycles should be prevented, using a cycle checker.void
setVariables
(List<Node> variables) Setter for the fieldvariables
.void
setVerbose
(boolean verbose) Sets the verbosity level of the search.
-
Constructor Details
-
PcMb
Constructs a new search.- Parameters:
test
- The source of conditional independence information for the search.depth
- The maximum number of variables conditioned on for any
-
-
Method Details
-
setMeekPreventCycles
public void setMeekPreventCycles(boolean meekPreventCycles) Sets whether cycles should be prevented, using a cycle checker.- Parameters:
meekPreventCycles
- True, if so.
-
search
Searches for the MB CPDAG for the given targets.- Parameters:
targets
- The targets variable.- Returns:
- a
Graph
object - Throws:
InterruptedException
-
search
Searches for the Markov blanket CPDAG for the given targets.- Specified by:
search
in interfaceIGraphSearch
- Returns:
- The Markov blanket CPDAG as a Graph object.
- Throws:
InterruptedException
- if any.
-
getAmbiguousTriples
-
getNumIndependenceTests
public int getNumIndependenceTests()Returns the number of independence tests performed during the most recent search.- Specified by:
getNumIndependenceTests
in interfaceIMbSearch
- Returns:
- This number.
-
getTargets
-
getElapsedTime
public long getElapsedTime()Returns the elapsed time of the most recent search.- Returns:
- This time.
-
getAlgorithmName
Returns "PC-MB."- Specified by:
getAlgorithmName
in interfaceIMbSearch
- Returns:
- This string.
-
getDepth
public int getDepth()Returns the depth of the search--that is, the maximum number of variables conditioned on in any conditional independence test.- Returns:
- This depth.
-
setDepth
public void setDepth(int depth) Sets the maximum number of conditioning variables for any conditional independence test.- Parameters:
depth
- This depth.
-
resultGraph
-
findMb
Given the target, this returns all the nodes in the Markov Blanket.Returns the Markov blanket variables (not the Markov blanket DAG).
- Specified by:
findMb
in interfaceIMbSearch
- Parameters:
target
- aNode
object- Returns:
- a
Set
object - Throws:
InterruptedException
-
getTest
-
getKnowledge
-
setKnowledge
Sets knowledge, to which the algorithm is in fact sensitive.- Parameters:
knowledge
- This knowledge.- See Also:
-
setVariables
-
setFindMb
public void setFindMb(boolean findMb) Setter for the field
findMb
.- Parameters:
findMb
- a boolean
-
setVerbose
public void setVerbose(boolean verbose) Sets the verbosity level of the search.- Parameters:
verbose
- true if verbose output should be enabled, false otherwise
-