Class TrainedDagSimulatorGNM1.SimResult
- Enclosing class:
TrainedDagSimulatorGNM1
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal double[][]A two-dimensional array representing continuous values for all variables in a simulation result.final int[][]Discrete codes for all variables in a simulation result.final longNumber of samples simulated in this result.final GraphGraph representing the true causal structure of the simulation.List of variables in the simulation result.final long[]Tracks the count of occurrences where a specific variable index exceeds a certain z-score warning threshold during simulation.final long[]Tracks the count of occurrences where a specific variable index exceeds a certain z-score warning threshold during simulation.final doubleTracks the count of occurrences where a specific variable index exceeds a certain z-score warning threshold during simulation.final doubleTracks the count -
Method Summary
Modifier and TypeMethodDescriptiongetSimReportText(double lambdaParents, boolean bootstrapRoots) Generates a simulation report as a string, summarizing details of the simulation and support warnings based on input parameters and internal state.Converts the current simulation result into a DataSet object, combining both continuous and discrete data variables.voidwriteSimReportTxt(File outFile, double lambdaParents, boolean bootstrapRoots) Writes the simulation report generated by thegetSimReportTextmethod to a specified output file in plain text format.
-
Field Details
-
cont
public final double[][] contA two-dimensional array representing continuous values for all variables in a simulation result. This array includes numerical data corresponding to continuous variables, while discrete columns are also present but are considered irrelevant in this context. Each row typically corresponds to a sample, and each column corresponds to a variable. -
disc
public final int[][] discDiscrete codes for all variables in a simulation result. This array includes numerical data corresponding to discrete variables, while continuous columns are also present but are considered irrelevant in this context. Each row typically corresponds to a sample, and each column corresponds to a variable. -
variables
-
trueDag
Graph representing the true causal structure of the simulation. This field contains a Graph object representing the true causal structure of the simulation. It is used to compare against the simulated structure and assess the accuracy of the simulation. -
nSamples
public final long nSamplesNumber of samples simulated in this result. -
zExceedWarn1
public final long[] zExceedWarn1Tracks the count of occurrences where a specific variable index exceeds a certain z-score warning threshold during simulation. These counts are indexed by variable.This field is primarily used to support warnings and validations in simulation reports where z-score thresholds are monitored. The array size matches the number of variables being simulated, allowing each index to correspond to a specific variable.
Modifications to this field are expected to occur internally within simulation processes that monitor and track z-score exceedance events.
-
zExceedWarn2
public final long[] zExceedWarn2Tracks the count of occurrences where a specific variable index exceeds a certain z-score warning threshold during simulation. These counts are indexed by variable.This field is primarily used to support warnings and validations in simulation reports where z-score thresholds are monitored. The array size matches the number of variables being simulated, allowing each index to correspond to a specific variable.
Modifications to this field are expected to occur internally within simulation processes that monitor and track z-score exceedance events.
-
zWarn1
public final double zWarn1Tracks the count of occurrences where a specific variable index exceeds a certain z-score warning threshold during simulation. These counts are indexed by variable.This field is primarily used to support warnings and validations in simulation reports where z-score thresholds are monitored. The array size matches the number of variables being simulated, allowing each index to correspond to a specific variable.
Modifications to this field are expected to occur internally within simulation processes that monitor and track z-score exceedance events.
-
zWarn2
public final double zWarn2Tracks the count
-
-
Method Details
-
getSimReportText
Generates a simulation report as a string, summarizing details of the simulation and support warnings based on input parameters and internal state.- Parameters:
lambdaParents- The regularization parameter applied to parent weights.bootstrapRoots- A flag indicating whether roots were bootstrapped during simulation.- Returns:
- A string containing the simulation report, including the number of samples, parameter values, and support warnings if thresholds were tracked.
-
writeSimReportTxt
public void writeSimReportTxt(File outFile, double lambdaParents, boolean bootstrapRoots) throws IOException Writes the simulation report generated by thegetSimReportTextmethod to a specified output file in plain text format.- Parameters:
outFile- The file to which the simulation report will be written. Must not be null.lambdaParents- The regularization parameter applied to parent weights.bootstrapRoots- A flag indicating whether roots were bootstrapped during simulation.- Throws:
IOException- If an I/O error occurs while writing to the file.
-
toDataSet
Converts the current simulation result into a DataSet object, combining both continuous and discrete data variables. This method processes the stored continuous and discrete data arrays, validates their consistency with the variable list, and organizes the data in a format compatible with the MixedDataBox structure. An IllegalStateException is thrown if there are mismatches in the variables or data arrays.- Returns:
- A
DataSetobject containing the combined continuous and discrete data variables, organized in row-major format. - Throws:
IllegalStateException- If both continuous and discrete arrays are empty, or if there are inconsistencies between the variable list and the data arrays.
-