Class GeneralAdditiveModel
- All Implemented Interfaces:
Simulation, HasParameters, TetradSerializable, Serializable
The underlying SEM has the form
X_j = sum_{k in Pa(j)} f_{jk}(X_k) + e_j
where each f_{jk} is a separate random univariate MLP and e_j
is additive noise drawn from the configured noise sampler.
This wrapper intentionally aligns its user-facing controls with the deep-net additive-noise simulator where possible:
Params.NOISE_EXPRESSIONParams.HIDDEN_DIMENSIONSParams.INPUT_SCALEParams.SAMPLE_SIZEParams.STANDARDIZEParams.SEED
In this wrapper, Params.STANDARDIZE is used only for post-processing
of the final dataset, matching the behavior of other algcomparison wrappers.
Parent-input standardization inside the simulator is enabled by default for
numerical stability.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGeneralAdditiveModel(RandomGraph graph) Constructs a GeneralAdditiveModel instance with the specified random graph. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateData(Parameters parameters, boolean newModel) Creates data models and their corresponding graphs based on the provided parameters.getDataModel(int index) Retrieves the data model located at the specified index within the collection of data models.Returns the data type associated with this model.Provides a description of the Generalized Additive Model (GAM) with its associated random graph.intRetrieves the number of data models currently stored in the class.Retrieves a list of configuration parameters used by the model, including both parameters from the associated random graph (if applicable) and those specific to this implementation.Class<? extends RandomGraph> Retrieves the class type of the random graph associated with the model.Retrieves the short name associated with the General Additive Model (GAM).Class<? extends Simulation> Retrieves the class type of the simulation associated with the General Additive Model.getTrueGraph(int index) Retrieves the true graph specified by the given index from the list of graphs.
-
Constructor Details
-
GeneralAdditiveModel
Constructs a GeneralAdditiveModel instance with the specified random graph.- Parameters:
graph- The random graph to be used in the model. Must not be null.- Throws:
NullPointerException- if the provided graph is null.
-
-
Method Details
-
createData
Creates data models and their corresponding graphs based on the provided parameters. This method initializes a series of data sets and graphs by repeatedly generating random graphs, modifying them, and simulating data. The number of simulations executed is determined by the number of runs specified in the parameters.If a seed is provided in the parameters, it will be used to initialize the random number generator, ensuring reproducibility.
- Specified by:
createDatain interfaceSimulation- Parameters:
parameters- An object that encapsulates various configuration settings for data generation, including: - Params.NUM_RUNS: The number of data models to generate. - Params.SEED: A long value specifying the random seed for reproducibility (optional).newModel- A boolean flag indicating whether to generate a new model. If set to true, additional operations might be performed based on the application's logic.
-
getTrueGraph
Retrieves the true graph specified by the given index from the list of graphs.- Specified by:
getTrueGraphin interfaceSimulation- Parameters:
index- The index of the graph to retrieve. Must be within the bounds of the graph list.- Returns:
- The graph at the specified index.
- Throws:
IndexOutOfBoundsException- if the index is out of range.
-
getNumDataModels
public int getNumDataModels()Retrieves the number of data models currently stored in the class.- Specified by:
getNumDataModelsin interfaceSimulation- Returns:
- The total number of data models present, determined by the size of the internal dataSets list.
-
getDataModel
Retrieves the data model located at the specified index within the collection of data models.- Specified by:
getDataModelin interfaceSimulation- Parameters:
index- The index of the data model to retrieve. Must be within the bounds of the dataSets list.- Returns:
- The data model at the specified index.
- Throws:
IndexOutOfBoundsException- if the index is out of range.
-
getDataType
Returns the data type associated with this model. The data type specifies whether the data set consists of continuous, discrete, mixed variables, or other possible types defined in theDataTypeenumeration.- Specified by:
getDataTypein interfaceSimulation- Returns:
- The
DataTypevalue, indicating that the model's data type is continuous.
-
getDescription
Provides a description of the Generalized Additive Model (GAM) with its associated random graph. The description includes details about the underlying random graph utilized in the model.- Specified by:
getDescriptionin interfaceSimulation- Returns:
- A string containing a description of the Generalized Additive Model, including the description of the associated random graph.
-
getShortName
Retrieves the short name associated with the General Additive Model (GAM).- Specified by:
getShortNamein interfaceSimulation- Returns:
- A string representing the short name of the model, specifically "GAM".
-
getParameters
Retrieves a list of configuration parameters used by the model, including both parameters from the associated random graph (if applicable) and those specific to this implementation.The parameters include various configuration options such as noise expression, dimensional settings, and simulation controls. If the random graph associated with the model is not an instance of
SingleGraph, its parameters are also included.- Specified by:
getParametersin interfaceHasParameters- Specified by:
getParametersin interfaceSimulation- Returns:
- A list of parameter names as
String, containing both graph-specific parameters and additional parameters specific to the General Additive Model.
-
getRandomGraphClass
Retrieves the class type of the random graph associated with the model.- Specified by:
getRandomGraphClassin interfaceSimulation- Returns:
- A
Classobject representing the type of the random graph associated with the model, which extendsRandomGraph.
-
getSimulationClass
Retrieves the class type of the simulation associated with the General Additive Model.- Specified by:
getSimulationClassin interfaceSimulation- Returns:
- A
Classobject representing the type of the simulation, which extendsSimulation.
-