Class LvLite
- All Implemented Interfaces:
IGraphSearch
- 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
ConstructorsConstructorDescriptionLvLite
(Graph cpdag, IndependenceTest test) Alternative LV-Lite constructor.LvLite
(IndependenceTest test, Score score) LV-Lite constructor. -
Method Summary
Modifier and TypeMethodDescriptionsearch()
Run the search and return s a PAG.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
setDoDdpEdgeRemovalStep
(boolean doDdpEdgeRemovalStep) Sets whether to perform DDP edge removal step.void
setEnsureMarkov
(boolean ensureMarkov) Sets the value indicating whether the process should ensure Markov property.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 LV-Lite search algorithm with the given IndependenceTest and Score object.In this constructor, we will use BOSS or GRaSP internally to infer an initial CPDAG and valid order of the variables. This is the default behavior of the LV-Lite algorithm.
- 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.
-
LvLite
Alternative LV-Lite constructor. Initializes a new object of LV-Lite search algorithm with the given initial CPDAG, along with the IndependenceTest. These should all be over variables with the same names as the variables in the supplied test.This constructor allows the user to employ an external algorithm to find this initial CPDAG (and an implied order of the variables). This is useful when the user has a preferred algorithm for this task. In this case, the algorithm will perform only the steps after the CPDAG initialization step.
It is important here that the CPDAG be obtained from an algorithm like BOSS or GRaSP that yields a high-quality DAG or CPDAG over the variables, with a valid order, under the (possibly false) assumption that the data model is causally sufficient. The CPDAG is used to establish the initial structure of the estimated PAG and to copy unshielded colliders from the CPDAG into the estimated PAG. This step is justified in the GFCI algorithm. Ogarrio, J. M., Spirtes, P., & Ramsey, J. (2016, August). A hybrid causal search algorithm for latent variable models. In Conference on probabilistic graphical models (pp. 368-379). PMLR. The idea is we start with this initial estimated of the PAG, with edges reoriented as o-o edges. Then we use the scorer to copy unshielded colliders from the CPDAG into the estimated PAG, as an initial step of converting the initial CPDAG into a PAG.
- Parameters:
cpdag
- The initial CPDAG.test
- The independence test.
-
-
Method Details
-
search
Run the search and return s a PAG.- Specified by:
search
in interfaceIGraphSearch
- Returns:
- The PAG.
- Throws:
InterruptedException
- if any.
-
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.
-
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
-
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.
-
setDoDdpEdgeRemovalStep
public void setDoDdpEdgeRemovalStep(boolean doDdpEdgeRemovalStep) Sets whether to perform DDP edge removal step. This step may be computationally expensive for large models and addresses a relatively rare condition in the search space. By default the step is done, since it is needed for correctness.- Parameters:
doDdpEdgeRemovalStep
- a boolean indicating if the DDP edge removal step should be executed
-
setEnsureMarkov
public void setEnsureMarkov(boolean ensureMarkov) Sets the value indicating whether the process should ensure Markov property.- Parameters:
ensureMarkov
- a boolean value, true to ensure Markov property, false otherwise.
-