Class SimulationStudy
java.lang.Object
edu.cmu.tetrad.search.harness.tsc.SimulationStudy
Top-level harness for the TSC simulation study.
Runs two separate sub-studies:
- Study 1 — Rank-1 MIM. Four groups, each with one latent. Algorithms: TSC, BPC, FOFC.
- Study 2 — Rank-2 MIM. Four groups, each with two latents (bifactor). Algorithms: TSC, FTFC.
F1 computation
Precision is averaged over non-empty replications only (replications where the algorithm returned at least one cluster). Recall is averaged over all replications, with empty replications contributing recall = 0. The reported F1 is computed from these two means:
F1 = 2 * meanPrecision * meanRecall / (meanPrecision + meanRecall)This correctly penalises high empty-count algorithms whose per-replication precision looks good but whose overall recall is near zero.
- Author:
- josephramsey
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordMean metrics for one algorithm at one sample-size level.static final recordResults for one sample-size level within a study.static final recordAggregated results for one complete study (one rank condition). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidRuns both studies with default settings.runAll()Runs both studies and prints results to standard output.Runs Study 1 (rank-1 MIM) and returns its results.Runs Study 2 (rank-2 MIM) and returns its results.voidsetNumReplications(int n) Sets the number of replications per condition (default 100).
-
Constructor Details
-
SimulationStudy
public SimulationStudy()Constructs a new instance of theSimulationStudyclass. This class is designed to perform statistical simulations involving multiple groups and conditions, evaluating rank-1 and rank-2 measurement models (MIM). It provides methods to configure replication settings and run simulations for each study or both studies collectively. By default, the number of replications for each condition is set to 100. Users can modify this using thesetNumReplications(int)method. The simulation includes rank-specific configurations for sample sizes, significance levels, and analysis procedures.
-
-
Method Details
-
setNumReplications
public void setNumReplications(int n) Sets the number of replications per condition (default 100).- Parameters:
n- must be ≥ 1.
-
runAll
Runs both studies and prints results to standard output.- Returns:
- a list of two
SimulationStudy.StudyResultobjects, rank-1 first.
-
runStudy1
Runs Study 1 (rank-1 MIM) and returns its results.- Returns:
- the results of Study 1.
-
runStudy2
Runs Study 2 (rank-2 MIM) and returns its results.- Returns:
- the results of Study 2.
-
main
Runs both studies with default settings. Optional integer argument sets the number of replications (default 100).- Parameters:
args- ignored.
-