Class SimulationStudy

java.lang.Object
edu.cmu.tetrad.search.harness.tsc.SimulationStudy

public final class SimulationStudy extends Object
Top-level harness for the TSC simulation study.

Runs two separate sub-studies:

  1. Study 1 — Rank-1 MIM. Four groups, each with one latent. Algorithms: TSC, BPC, FOFC.
  2. 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
  • Constructor Details

    • SimulationStudy

      public SimulationStudy()
      Constructs a new instance of the SimulationStudy class. 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 the setNumReplications(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.StudyResult objects, rank-1 first.
    • runStudy1

      public SimulationStudy.StudyResult runStudy1()
      Runs Study 1 (rank-1 MIM) and returns its results.
      Returns:
      the results of Study 1.
    • runStudy2

      public SimulationStudy.StudyResult runStudy2()
      Runs Study 2 (rank-2 MIM) and returns its results.
      Returns:
      the results of Study 2.
    • main

      public static void main(String[] args)
      Runs both studies with default settings. Optional integer argument sets the number of replications (default 100).
      Parameters:
      args - ignored.