Class LgMnarSimulation

java.lang.Object
edu.cmu.tetrad.algcomparison.simulation.LgMnarSimulation
All Implemented Interfaces:
Simulation, HasParameters, TetradSerializable, Serializable

public class LgMnarSimulation extends Object implements Simulation
This class represents a continuous MNAR simulation. The simulation generates a random graph, applies a layout to the graph, simulates data according to the graph structure, and performs post-processing on the data.
Author:
josephramsey
See Also:
  • Constructor Details

    • LgMnarSimulation

      public LgMnarSimulation(RandomGraph graph)
      Constructs a SemSimulation object with the given RandomGraph object.
      Parameters:
      graph - the RandomGraph object used for simulation.
      Throws:
      NullPointerException - if graph is null.
  • Method Details

    • createData

      public void createData(Parameters parameters, boolean newModel)
      Creates simulated data and associated graphs based on the given parameters. This method generates a specified number of graphs and datasets using a random graph creation process, applies a layout to the graphs, simulates data according to the graph structure, and performs post-processing on the data.
      Specified by:
      createData in interface Simulation
      Parameters:
      parameters - The parameters used to control the simulation process, including settings for seed, number of runs, and other configurations.
      newModel - A flag indicating whether a new model should be created for the simulation.
    • getTrueGraph

      public Graph getTrueGraph(int index)
      Returns the true graph at the specified index.
      Specified by:
      getTrueGraph in interface Simulation
      Parameters:
      index - The index of the desired true graph.
      Returns:
      The true graph at the specified index.
    • getNumDataModels

      public int getNumDataModels()
      Returns the number of data models.
      Specified by:
      getNumDataModels in interface Simulation
      Returns:
      The number of data sets to simulate.
    • getDataModel

      public DataModel getDataModel(int index)
      Returns the data model at the specified index.
      Specified by:
      getDataModel in interface Simulation
      Parameters:
      index - The index of the desired simulated data set.
      Returns:
      The data model at the specified index.
    • getDataType

      public DataType getDataType()
      Returns the data type of the data set.
      Specified by:
      getDataType in interface Simulation
      Returns:
      The type of the data set--continuous if all continuous variables, discrete if all discrete variables; otherwise, mixed.
    • getDescription

      public String getDescription()
      Returns the description of the simulation.
      Specified by:
      getDescription in interface Simulation
      Returns:
      a short, one-line description of the simulation.
    • getShortName

      public String getShortName()
      Returns the short name of the simulation.
      Specified by:
      getShortName in interface Simulation
      Returns:
      The short name of the simulation.
    • getParameters

      public List<String> getParameters()
      Retrieves the parameters required for the simulation.
      Specified by:
      getParameters in interface HasParameters
      Specified by:
      getParameters in interface Simulation
      Returns:
      A list of String names representing the parameters.
    • getRandomGraphClass

      public Class<? extends RandomGraph> getRandomGraphClass()
      Returns the random graph class used in the simulation.
      Specified by:
      getRandomGraphClass in interface Simulation
      Returns:
      The class of the random graph used in the simulation.
    • getSimulationClass

      public Class<? extends Simulation> getSimulationClass()
      Returns the class of the current simulation.
      Specified by:
      getSimulationClass in interface Simulation
      Returns:
      The class of the simulation extending the Simulation interface.