Class TestCausalUnmixer

java.lang.Object
edu.cmu.tetrad.search.unmix.TestCausalUnmixer

public class TestCausalUnmixer extends Object
Better-targeted unmixing tests with ground-truth labels + ARI. - params-only test (pooled initializer, no residual scaling, Laplace reassignment) - small topology difference test (parent-superset initializer, residual scaling) - EM-on-residuals baseline (parent-superset, diagonal covariance), with ARI
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Represents labeled data consisting of a dataset and corresponding labels.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor for the TestCausalUnmixer class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    This test evaluates the performance of a causal unmixing algorithm in a semi-synthetic setting.

    Methods inherited from class java.lang.Object

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

    • TestCausalUnmixer

      public TestCausalUnmixer()
      Default constructor for the TestCausalUnmixer class. This constructor initializes an instance of the TestCausalUnmixer, a class designed to test the performance of a causal unmixing algorithm in semi-synthetic scenarios. The class provides methods for generating datasets with structural differences, running the causal unmixing algorithm, and evaluating the results using various performance metrics.
  • Method Details

    • phase3_semisynthetic

      public void phase3_semisynthetic()
      This test evaluates the performance of a causal unmixing algorithm in a semi-synthetic setting. The process involves generating data from two regimes that share a common backbone structure with intentional structural changes, simulating realistic marginal distributions, and testing the algorithm's ability to distinguish and recover the regimes.

      The test includes the following steps:

      1. Generate a random directed acyclic graph (DAG) as the backbone structure, and simulate data with Laplace-distributed errors for heavy-tailed characteristics.
      2. Create two regimes:
        • Regime A: Uses the original backbone DAG.
        • Regime B: Modifies the backbone by flipping the direction of some edges and scaling regression coefficients and noise variances.
      3. Simulate data for both regimes and combine them into a single dataset.
      4. Shuffle the data and assign labels to indicate the regime of origin.
      5. Run the causal unmixing algorithm using an expectation-maximization (EM)-based approach. Evaluate its performance via metrics such as Adjusted Rand Index (ARI), adjacency F1, arrow direction F1, and structural Hamming distance (SHD).
      6. Perform a baseline test with K=1 (single cluster assumption) for diagnostics and compute the difference in Bayesian Information Criterion (BIC) values between K=2 and K=1 to determine cluster separation quality.