Class Bpc

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

public class Bpc extends Object
BuildPureClusters (BPC) inspired by Silva, Scheines, Glymour, Spirtes (JMLR 2006).

This implementation follows the spirit of the paper: 1) Identify candidate pure groups using tetrads (quartets) and within-group dependence. 2) Grow each seed to a local maximal pure group, but DO NOT mark variables as used. 3) Perform global purification/merging passes: - Merge groups when their union remains pure. - Resolve overlaps by globally assigning shared variables to the most compatible group. - Iterate until convergence. 4) Drop groups with fewer than 3 indicators (paper’s Step: remove latents with < 3 children).

Notes: - We keep pairwise dependence as a simple Fisher-Z check on correlations. - Purification/overlap resolution uses correlation-based tie-breaking; the paper gives several logically equivalent global rules—this is a practical, deterministic variant.

  • Constructor Details

    • Bpc

      public Bpc(CovarianceMatrix cov, double alpha, int ess)
      Constructor for the Bpc class.
      Parameters:
      cov - A CovarianceMatrix containing the data to be used for clustering and correlation analysis.
      alpha - The significance level for tetrad tests, used to determine the tolerance for statistical independence.
      ess - The effective sample size (ESS) which can be set to -1 (indicating sample size) or a positive integer. The chosen ESS impacts statistical decisions during the analysis.
      Throws:
      IllegalArgumentException - if the ess parameter is not -1 or a positive integer.
  • Method Details

    • getClusters

      public List<List<Integer>> getClusters()
      Identifies clusters of variables based on tetrad purity and pairwise dependence. Constructs initial clusters as locally maximal pure groups and refines them using global purification, merging, and overlap resolution until convergence.
      Returns:
      A list of clusters where each cluster is represented as a list of variable indices. Each cluster satisfies purity and pairwise dependence constraints, and all groups are disjoint after resolving overlaps. Returns an empty list if no valid clusters exist.
    • setVerbose

      public void setVerbose(boolean verbose)
      Enables or disables verbose logging for the Bpc instance.
      Parameters:
      verbose - A boolean indicating whether verbose logging should be enabled (true) or disabled (false).