Class SepsetMap

java.lang.Object
edu.cmu.tetrad.search.utils.SepsetMap
All Implemented Interfaces:
TetradSerializable, Serializable

public final class SepsetMap extends Object implements TetradSerializable

Stores a map from pairs of nodes to separating sets--that is, for each unordered pair of nodes {node1, node2} in a graph, stores a set of nodes conditional on which node1 and node2 are independent (where the nodes are considered as variables) or stores null if the pair was not judged to be independent. (Note that if a sepset is non-null and empty, that should mean that the compared nodes were found to be independent conditional on the empty set, whereas if a sepset is null, that should mean that no set was found yet conditional on which the compared nodes are independent. So at the end of the search, a null sepset carries different information from an empty sepset.)> 0

We cast the variable-like objects to Node to allow them either to be variables explicitly or else to be graph nodes that in some model could be considered as variables. This allows us to use d-separation as a graphical indicator of what independence in models ideally should be.> 0

Author:
josephramsey
See Also:
  • Constructor Details

    • SepsetMap

      public SepsetMap()
      Constructor.
    • SepsetMap

      public SepsetMap(SepsetMap map)
      Copy constructor.
      Parameters:
      map - A given sepset map.
  • Method Details

    • serializableInstance

      public static SepsetMap serializableInstance()
      Generates a simple exemplar of this class to test serialization.
    • set

      public void set(Node x, Node y, Set<Node> z)
      Sets the sepset for {x, y} to be z. Note that {x, y} is unordered.
    • get

      public Set<Node> get(Node a, Node b)
      Retrieves the sepset previously set for {a, b}, or null if no such set was previously set.
    • getPValue

      public double getPValue(Node x, Node y)
      Looks up the p-value for {x, y}
    • set

      public void set(Node x, LinkedHashSet<Node> z)
      Sets the parents of x to the (ordered) set z.
    • get

      public HashSet<Node> get(Node x)
      Returns the parents of the node x.
    • equals

      public boolean equals(Object o)
      Checks equality of this to another sepset map.
      Overrides:
      equals in class Object
    • size

      public int size()
      Returns the number of {x, y} in the key set of the map.
    • toString

      public String toString()
      Returns a string representation of this sepset map.
      Overrides:
      toString in class Object
    • addAll

      public void addAll(SepsetMap newSepsets)
      Adds all entries in the given sepset map to the current one.