Package edu.cmu.tetrad.search
Class Gin
java.lang.Object
edu.cmu.tetrad.search.Gin
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
ConstructorsConstructorDescriptionGin(double alpha, RawMarginalIndependenceTest test) Constructs a Gin instance with the specified significance level and independence test. -
Method Summary
Modifier and TypeMethodDescriptionSearches and constructs a causal graph representation using the provided dataset.voidsetRidge(double r) Sets the ridge value for regularization.voidsetVerbose(boolean v) Sets the verbose mode for logging or output.voidsetWhitenBeforeSVD(boolean w) Sets whether whitening should be applied before performing Singular Value Decomposition (SVD).
-
Constructor Details
-
Gin
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
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.
-