Class HybridCgSimulation
java.lang.Object
edu.cmu.tetrad.algcomparison.simulation.HybridCgSimulation
- All Implemented Interfaces:
Simulation,HasParameters,TetradSerializable,Serializable
This class represents a Simulation using Structural Equation Modeling (SEM).
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionHybridCgSimulation(RandomGraph graph) Constructs a SemSimulation object with the given RandomGraph object.Constructs a GeneralSemSimulation object with the given SemIm object.Initializes a SemSimulation with the given SemPm object. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateData(Parameters parameters, boolean newModel) Creates data sets for simulation based on the given parameters and model reuse preference.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.getIms()Retrieves the list of SemIm objects used for simulation.intReturns the number of data models.Retrieves the parameters required for the simulation.Class<? extends RandomGraph> Retrieves the class of a random graph for the simulation.Returns the short name of the simulation.Class<? extends Simulation> Returns the class of the simulation.getTrueGraph(int index) Returns the true graph at the specified index.
-
Constructor Details
-
HybridCgSimulation
Constructs a SemSimulation object with the given RandomGraph object.- Parameters:
graph- the RandomGraph object used for simulation.- Throws:
NullPointerException- if graph is null.
-
HybridCgSimulation
Initializes a SemSimulation with the given SemPm object.- Parameters:
pm- the SemPm object used for simulation.- Throws:
NullPointerException- if pm is null.
-
HybridCgSimulation
Constructs a GeneralSemSimulation object with the given SemIm object.- Parameters:
im- the SemIm object used for simulation
-
-
Method Details
-
createData
Creates data sets for simulation based on the given parameters and model reuse preference.- Specified by:
createDatain interfaceSimulation- Parameters:
parameters- The parameters to use in the simulation.newModel- If true, a new model is created. If false, the model is reused.
-
getIms
Retrieves the list of SemIm objects used for simulation.- Returns:
- The list of SemIm objects.
-
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
Description copied from interface:SimulationRetrieves the class of a random graph for the simulation.- Specified by:
getRandomGraphClassin interfaceSimulation- Returns:
- The class of a random graph for the simulation.
-
getSimulationClass
Description copied from interface:SimulationReturns the class of the simulation. This method is used to retrieve the class of a simulation based on the selected simulations in the model.- Specified by:
getSimulationClassin interfaceSimulation- Returns:
- The class of the simulation.
-