Package edu.cmu.tetrad.search.unmix
Class TestCausalUnmixer
java.lang.Object
edu.cmu.tetrad.search.unmix.TestCausalUnmixer
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 SummaryNested ClassesModifier and TypeClassDescriptionstatic classRepresents labeled data consisting of a dataset and corresponding labels.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidThis test evaluates the performance of a causal unmixing algorithm in a semi-synthetic setting.
- 
Constructor Details- 
TestCausalUnmixerpublic 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_semisyntheticpublic 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: - Generate a random directed acyclic graph (DAG) as the backbone structure, and simulate data with Laplace-distributed errors for heavy-tailed characteristics.
- 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.
 
- Simulate data for both regimes and combine them into a single dataset.
- Shuffle the data and assign labels to indicate the regime of origin.
- 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).
- 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.
 
 
-