Class GraphoidAxioms

java.lang.Object
edu.cmu.tetrad.search.utils.GraphoidAxioms

public class GraphoidAxioms extends Object
Checks the graphoid axioms for a set of Independence Model statements.
Version:
$Id: $Id
Author:
josephramsey
  • Constructor Details

  • Method Details

    • main

      public static void main(String... args)
      The main methods.
      Parameters:
      args - E.g., "java -cp tetrad-gui-7.1.3-SNAPSHOT-launch.jar edu.cmu.tetrad.search.utils.GraphoidAxioms udags5.txt 5" Here, udgas5.txt is a file containing independence models, one per line, where each independence fast is specified by, e.g., "1:23|56", indicating that 1 is independence of 2 and 3 conditional on 5 and 6. No more than 9 variables can be handled this way. If you need more, let us know and we'll change the format.
    • semigraphoid

      public boolean semigraphoid()
      Checked whether the IM is a semigraphoid.
      Returns:
      True, if so.
    • graphoid

      public boolean graphoid()
      Checks whether teh IM is a semigraphoid.
      Returns:
      True, if so.
    • compositionalGraphoid

      public boolean compositionalGraphoid()
      Checks whether the IM is a compositional graphoid.
      Returns:
      True, if so.
    • getIndependenceFacts

      public IndependenceFacts getIndependenceFacts()
      Returns the independence facts in the form 1:2|3 for use in various Tetrad algorithms. Assumes decomposition and compositios, so that there are no complex independence facts.
      Returns:
      a IndependenceFacts object
    • symmetry

      public boolean symmetry()
      Checks if symmetry holds--i.e., X ⊥⊥ Y | Z ==> Y ⊥⊥ X | Z
      Returns:
      a boolean
    • decomposition

      public boolean decomposition()
      Checks if decomposition holds, e.g., X _||_ (Y ∪ W) | Z ==> (X _||_ Y | Z) ∧ (X _||_ W | Z)
      Returns:
      a boolean
    • weakUnion

      public boolean weakUnion()
      Checks if weak union holds, e.g., X _||_ Y ∪ W | Z ==> X _||_ Y | Z ∪ W
      Returns:
      a boolean
    • contraction

      public boolean contraction()
      Checks if contraction holds--e.g., (X _||_ Y | Z) ∧ (X _||_ W | Z ∪ Y) ==> X _||_ (Y ∪ W) | Z
      Returns:
      a boolean
    • intersection

      public boolean intersection()
      Checks if intersection holds--e.g., (X _||_ Y | (Z ∪ W)) ∧ (X _||_ W | (Z ∪ Y)) ==> X _||_ (Y ∪ W) | Z
      Returns:
      a boolean
    • composition

      public boolean composition()
      Checks if composition holds--e.g., (X _||_ Y | Z) ∧ (X _||_ W | Z) ==> X _||_ (Y ∪ W) | Z
      Returns:
      a boolean
    • ensureTriviality

      public void ensureTriviality()
      Sets whether triviality as assumed.
    • ensureSymmetry

      public void ensureSymmetry()
      Checks if symmetry holds--i.e., X _||_ Y | Z ==> Y _||_ X | Z
    • closure

      public Set<GraphoidAxioms.GraphoidIndFact> closure(String type)
      Returns the closure of the current fact set under the semigraphoid axioms (symmetry, decomposition, weak union, contraction), the graphoid axioms (semigraphoid + intersection), or the compositional graphoid axioms (graphoid + composition). Iterates to fixpoint.
      Parameters:
      type - One of "semigraphoid", "graphoid", or "compositional graphoid".
      Returns:
      The closure set of GraphoidIndFacts.
    • singletonClosureWithComposition

      public Set<GraphoidAxioms.GraphoidIndFact> singletonClosureWithComposition(Set<GraphoidAxioms.GraphoidIndFact> phase1Closure)
      Computes the singleton closure of independence facts using the composition rule, starting from an initial set of singleton independence facts. The composition rule allows the derivation of new independence facts from existing ones, specifically combining facts with the same X and Z sets but different Y sets.
      Parameters:
      phase1Closure - The initial set of singleton conditional independence facts of the form {x} ⊥⊥ {y} | Z.
      Returns:
      A set of GraphoidIndFact objects representing the newly derived singleton independence facts obtained by applying the composition rule to the input set.
    • singletonFacts

      public static Set<GraphoidAxioms.GraphoidIndFact> singletonFacts(Set<GraphoidAxioms.GraphoidIndFact> facts)
      Returns the subset of a given set of GraphoidIndFacts where both X and Y are singleton sets--i.e., facts of the form {x} ⊥⊥ {y} | Z.
      Parameters:
      facts - The set of facts to filter.
      Returns:
      The filtered set containing only singleton CI facts.