Class Bridges2

java.lang.Object
edu.cmu.tetrad.search.Bridges2
All Implemented Interfaces:
GraphScorer, GraphSearch

public final class Bridges2 extends Object implements GraphSearch, GraphScorer
GesSearch is an implementation of the GES algorithm, as specified in Chickering (2002) "Optimal structure identification with greedy search" Journal of Machine Learning Research. It works for both BayesNets and SEMs.

Some code optimization could be done for the scoring part of the graph for discrete models (method scoreGraphChange). Some of Andrew Moore's approaches for caching sufficient statistics, for instance.

To speed things up, it has been assumed that variables X and Y with zero correlation do not correspond to edges in the graph. This is a restricted form of the heuristicSpeedup assumption, something GES does not assume. This the graph. This is a restricted form of the heuristicSpeedup assumption, something GES does not assume. This heuristicSpeedup assumption needs to be explicitly turned on using setHeuristicSpeedup(true).

A number of other optimizations were added 5/2015. See code for details.

Author:
Ricardo Silva, Summer 2003, Joseph Ramsey, Revisions 5/2015
  • Constructor Details

    • Bridges2

      public Bridges2(Score score)
      Construct a Score and pass it in here. The totalScore should return a positive value in case of conditional dependence and a negative values in case of conditional independence. See Chickering (2002), locally consistent scoring criterion. This by default uses all of the processors on the machine.
  • Method Details

    • search

      public Graph search()
      Specified by:
      search in interface GraphSearch
    • getKnowledge

      public Knowledge getKnowledge()
      Returns:
      the background knowledge.
    • setKnowledge

      public void setKnowledge(Knowledge knowledge)
      Sets the background knowledge.
      Parameters:
      knowledge - the knowledge object, specifying forbidden and required edges.
    • getOut

      public PrintStream getOut()
      Returns:
      the output stream that output (except for log output) should be sent to.
    • setOut

      public void setOut(PrintStream out)
      Sets the output stream that output (except for log output) should be sent to. By detault System.out.
    • getAdjacencies

      public Graph getAdjacencies()
      Returns:
      the set of preset adjacenies for the algorithm; edges not in this adjacencies graph will not be added.
    • setAdjacencies

      public void setAdjacencies(Graph adjacencies)
      Sets the set of preset adjacenies for the algorithm; edges not in this adjacencies graph will not be added.
    • getPenaltyDiscount

      public double getPenaltyDiscount()
      Deprecated.
      Use the getters on the individual scores instead.
      For BIC totalScore, a multiplier on the penalty term. For continuous searches.
    • setPenaltyDiscount

      public void setPenaltyDiscount(double penaltyDiscount)
      Deprecated.
      Use the setters on the individual scores instead.
      For BIC totalScore, a multiplier on the penalty term. For continuous searches.
    • setSamplePrior

      public void setSamplePrior(double samplePrior)
      Deprecated.
      Use the setters on the individual scores instead.
    • setStructurePrior

      public void setStructurePrior(double expectedNumParents)
      Deprecated.
      Use the setters on the individual scores instead.
    • getMaxDegree

      public int getMaxDegree()
      The maximum of parents any nodes can have in output pattern.
      Returns:
      -1 for unlimited.
    • setMaxDegree

      public void setMaxDegree(int maxDegree)
      The maximum of parents any nodes can have in output pattern.
      Parameters:
      maxDegree - -1 for unlimited.
    • scoreDag

      public double scoreDag(Graph dag)
      Specified by:
      scoreDag in interface GraphScorer