Class LgMnarSimulation
java.lang.Object
edu.cmu.tetrad.algcomparison.simulation.LgMnarSimulation
- All Implemented Interfaces:
Simulation,HasParameters,TetradSerializable,Serializable
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 Summary
ConstructorsConstructorDescriptionLgMnarSimulation(RandomGraph graph) Constructs a SemSimulation object with the given RandomGraph object. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateData(Parameters parameters, boolean newModel) Creates simulated data and associated graphs based on the given parameters.getDataModel(int index) Returns the data model at the specified index.Returns the data type of the data set.Returns the description of the simulation.intReturns the number of data models.Retrieves the parameters required for the simulation.Class<? extends RandomGraph> Returns the random graph class used in the simulation.Returns the short name of the simulation.Class<? extends Simulation> Returns the class of the current simulation.getTrueGraph(int index) Returns the true graph at the specified index.
-
Constructor Details
-
LgMnarSimulation
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
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:
createDatain interfaceSimulation- 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
Returns the true graph at the specified index.- Specified by:
getTrueGraphin interfaceSimulation- 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:
getNumDataModelsin interfaceSimulation- Returns:
- The number of data sets to simulate.
-
getDataModel
Returns the data model at the specified index.- Specified by:
getDataModelin interfaceSimulation- Parameters:
index- The index of the desired simulated data set.- Returns:
- The data model at the specified index.
-
getDataType
Returns the data type of the data set.- Specified by:
getDataTypein interfaceSimulation- Returns:
- The type of the data set--continuous if all continuous variables, discrete if all discrete variables; otherwise, mixed.
-
getDescription
Returns the description of the simulation.- Specified by:
getDescriptionin interfaceSimulation- Returns:
- a short, one-line description of the simulation.
-
getShortName
Returns the short name of the simulation.- Specified by:
getShortNamein interfaceSimulation- Returns:
- The short name of the simulation.
-
getParameters
Retrieves the parameters required for the simulation.- Specified by:
getParametersin interfaceHasParameters- Specified by:
getParametersin interfaceSimulation- Returns:
- A list of String names representing the parameters.
-
getRandomGraphClass
Returns the random graph class used in the simulation.- Specified by:
getRandomGraphClassin interfaceSimulation- Returns:
- The class of the random graph used in the simulation.
-
getSimulationClass
Returns the class of the current simulation.- Specified by:
getSimulationClassin interfaceSimulation- Returns:
- The class of the simulation extending the Simulation interface.
-