Package edu.cmu.tetrad.search
Class LvLite
java.lang.Object
edu.cmu.tetrad.search.LvLite
- All Implemented Interfaces:
IGraphSearch
The LV-Lite algorithm implements a search algorithm for learning the structure of a graphical model from
observational data with latent variables. The algorithm uses the BOSS or GRaSP algorithm to get an initial CPDAG.
Then it uses scoring steps to infer some unshielded colliders in the graph, then finishes with a testing step to
remove extra edges and orient more unshielded colliders. Finally, the final FCI orientation is applied to the graph.
- Author:
- josephramsey
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The ExtraEdgeRemovalStyle enum specifies the styles for removing extra edges.static enum
Enumeration representing different start options. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsearch()
Run the search and return s a PAG.void
setAblationLeaveOutScoringStep
(boolean ablationLeaveOutScoringStep) Sets whether the scoring step (BOSS or GRASP) should be left out during ablation.void
setAblationLeaveOutTestingStep
(boolean ablationLeaveOutTestingStep) Sets whether to the testing steps (extra edge removal and discriminating path steps) should be left out during ablation.void
setCompleteRuleSetUsed
(boolean completeRuleSetUsed) Sets whether the complete rule set should be used during the search algorithm.void
setDepth
(int depth) Sets the maximum size of the separating set used in the graph search algorithm.void
setDoDiscriminatingPathColliderRule
(boolean doDiscriminatingPathColliderRule) Sets whether the discriminating path collider rule should be used.void
setDoDiscriminatingPathTailRule
(boolean doDiscriminatingPathTailRule) Sets whether the discriminating path tail rule should be used.void
setExtraEdgeRemovalStyle
(LvLite.ExtraEdgeRemovalStyle extraEdgeRemovalStyle) Sets the style for removing extra edges.void
setGuaranteePag
(boolean guaranteePag) Sets whether to guarantee a PAG output by repairing a faulty PAG.void
setKnowledge
(Knowledge knowledge) Sets the knowledge used in search.void
setMaxBlockingPathLength
(int maxBlockingPathLength) Sets the maximum length of any discriminating path.void
setMaxDdpPathLength
(int maxDdpPathLength) Sets the maximum DDP path length.void
setNumStarts
(int numStarts) Sets the number of starts for BOSS.void
setRecursionDepth
(int recursionDepth) Sets the depth of the GRaSP if it is used.void
setStartWith
(LvLite.START_WITH startWith) Sets the algorithm to use to obtain the initial CPDAG.void
setTestTimeout
(long testTimeout) Sets the timeout for the testing steps, for the extra edge removal steps and the discriminating path steps.void
setUseBes
(boolean useBes) Sets whether to use the BES (Backward Elimination Search) algorithm during the search.void
setUseDataOrder
(boolean useDataOrder) Sets the flag indicating whether to use data order.void
setVerbose
(boolean verbose) Sets the verbosity level of the search algorithm.
-
Constructor Details
-
LvLite
LV-Lite constructor. Initializes a new object of LvLite search algorithm with the given IndependenceTest and Score object.- Parameters:
test
- The IndependenceTest object to be used for testing independence between variables.score
- The Score object to be used for scoring DAGs.- Throws:
NullPointerException
- if the score is null.
-
-
Method Details
-
search
Run the search and return s a PAG.- Specified by:
search
in interfaceIGraphSearch
- Returns:
- The PAG.
-
setMaxBlockingPathLength
public void setMaxBlockingPathLength(int maxBlockingPathLength) Sets the maximum length of any discriminating path.- Parameters:
maxBlockingPathLength
- the maximum length of any discriminating path, or -1 if unlimited.
-
setRecursionDepth
public void setRecursionDepth(int recursionDepth) Sets the depth of the GRaSP if it is used.- Parameters:
recursionDepth
- The depth of the GRaSP.
-
setGuaranteePag
public void setGuaranteePag(boolean guaranteePag) Sets whether to guarantee a PAG output by repairing a faulty PAG.- Parameters:
guaranteePag
- true if a faulty PAGs should be repaired, false otherwise
-
setStartWith
Sets the algorithm to use to obtain the initial CPDAG.- Parameters:
startWith
- the algorithm to use to obtain the initial CPDAG.
-
setKnowledge
Sets the knowledge used in search.- Parameters:
knowledge
- This knowledge.
-
setCompleteRuleSetUsed
public void setCompleteRuleSetUsed(boolean completeRuleSetUsed) Sets whether the complete rule set should be used during the search algorithm. By default, the complete rule set is not used.- Parameters:
completeRuleSetUsed
- true if the complete rule set should be used, false otherwise
-
setVerbose
public void setVerbose(boolean verbose) Sets the verbosity level of the search algorithm.- Parameters:
verbose
- true to enable verbose mode, false to disable it
-
setNumStarts
public void setNumStarts(int numStarts) Sets the number of starts for BOSS.- Parameters:
numStarts
- The number of starts.
-
setDoDiscriminatingPathTailRule
public void setDoDiscriminatingPathTailRule(boolean doDiscriminatingPathTailRule) Sets whether the discriminating path tail rule should be used.- Parameters:
doDiscriminatingPathTailRule
- True, if so.
-
setDoDiscriminatingPathColliderRule
public void setDoDiscriminatingPathColliderRule(boolean doDiscriminatingPathColliderRule) Sets whether the discriminating path collider rule should be used.- Parameters:
doDiscriminatingPathColliderRule
- True, if so.
-
setUseBes
public void setUseBes(boolean useBes) Sets whether to use the BES (Backward Elimination Search) algorithm during the search.- Parameters:
useBes
- true to use the BES algorithm, false otherwise
-
setUseDataOrder
public void setUseDataOrder(boolean useDataOrder) Sets the flag indicating whether to use data order.- Parameters:
useDataOrder
-true
if the data order should be used,false
otherwise.
-
setDepth
public void setDepth(int depth) Sets the maximum size of the separating set used in the graph search algorithm.- Parameters:
depth
- the maximum size of the separating set
-
setAblationLeaveOutScoringStep
public void setAblationLeaveOutScoringStep(boolean ablationLeaveOutScoringStep) Sets whether the scoring step (BOSS or GRASP) should be left out during ablation. If this step is left out, the algorithm will start with a completely connected nondirected (o-o) graph, since the subsequent steps require an initial graph that is Markov. This will make the algorithm slow.One cannot leave out both the testing and scoring steps of the algorithm; one or the other must be enabled.
- Parameters:
ablationLeaveOutScoringStep
- True iff the scoring step should be left out.
-
setAblationLeaveOutTestingStep
public void setAblationLeaveOutTestingStep(boolean ablationLeaveOutTestingStep) Sets whether to the testing steps (extra edge removal and discriminating path steps) should be left out during ablation. If these stepw are left out, the algorithm will not remove extra edges or do discriminating path steps.One cannot leave out both the testing and scoring steps of the algorithm; one or the other must be enabled.
- Parameters:
ablationLeaveOutTestingStep
- the flag indicating whether to enable the ablation leave-out testing step.
-
setMaxDdpPathLength
public void setMaxDdpPathLength(int maxDdpPathLength) Sets the maximum DDP path length.- Parameters:
maxDdpPathLength
- the maximum DDP path length to set
-
setExtraEdgeRemovalStyle
Sets the style for removing extra edges.- Parameters:
extraEdgeRemovalStyle
- the style for removing extra edges
-
setTestTimeout
public void setTestTimeout(long testTimeout) Sets the timeout for the testing steps, for the extra edge removal steps and the discriminating path steps.- Parameters:
testTimeout
- the timeout for the testing steps, for the extra edge removal steps and the discriminating path steps.
-