Class Gin

java.lang.Object
edu.cmu.tetrad.search.Gin

public class Gin extends Object
Minimal GIN: 1) Get clusters from TSC. 2) Add one latent per cluster, connect to its observed children. 3) For each unordered latent pair {i,j}: - Compute smallest-σ projection for i->j (Y=j, Z=i) and for j->i (Y=i, Z=j) - p_ij = p(e(Y|Z) ⟂ Z) via RawMarginalIndependenceTest - If max(p_ij, p_ji) >= alpha, add ONLY the better direction.

Notes: • Allows cliques/cycles intentionally (no gates, no acyclicity checks). • Uses covariance (matches centering). • Whitening enabled by default; small ridge helps stability.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Gin(double alpha, RawMarginalIndependenceTest test)
    Constructs a Gin instance with the specified significance level and independence test.
  • Method Summary

    Modifier and Type
    Method
    Description
    Searches and constructs a causal graph representation using the provided dataset.
    void
    setRidge(double r)
    Sets the ridge value for regularization.
    void
    setVerbose(boolean v)
    Sets the verbose mode for logging or output.
    void
    setWhitenBeforeSVD(boolean w)
    Sets whether whitening should be applied before performing Singular Value Decomposition (SVD).

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Gin

      public Gin(double alpha, RawMarginalIndependenceTest test)
      Constructs a Gin instance with the specified significance level and independence test.
      Parameters:
      alpha - the significance level to be used for statistical tests, typically in the range [0, 1]
      test - the raw marginal independence test instance, used to compute p-values for independence testing
      Throws:
      NullPointerException - if the provided test is null
  • Method Details

    • setVerbose

      public void setVerbose(boolean v)
      Sets the verbose mode for logging or output. When enabled, additional details may be provided for debugging or informational purposes.
      Parameters:
      v - true to enable verbose mode, false to disable it
    • setWhitenBeforeSVD

      public void setWhitenBeforeSVD(boolean w)
      Sets whether whitening should be applied before performing Singular Value Decomposition (SVD).
      Parameters:
      w - true if whitening should be applied before SVD, false otherwise
    • setRidge

      public void setRidge(double r)
      Sets the ridge value for regularization. The ridge value is used as a regularization parameter to ensure numerical stability in computations. It is constrained to be non-negative.
      Parameters:
      r - the ridge value to set. If the provided value is negative, it will be set to 0.0.
    • search

      public Graph search(DataSet data)
      Searches and constructs a causal graph representation using the provided dataset. The method identifies clusters, builds the latent measurement structure, and performs basic GIN (Generalized Independent Noise) orientation.
      Parameters:
      data - the dataset containing variables and their covariance information, used to construct the graph.
      Returns:
      a graphical representation (Graph) that includes both observed and latent variables with directed edges based on relationships derived from the analysis.