Class GeneralNoiseSimulation

java.lang.Object
edu.cmu.tetrad.sem.GeneralNoiseSimulation

public class GeneralNoiseSimulation extends Object
General-noise simulator: X_j = f_j(Pa(X_j), e_j)

Noise enters as an extra input column, allowing nonlinear interaction between parents and noise. The noise distribution is determined entirely by the supplied Sampler; no clipping or positivity constraint is imposed here.

  • Constructor Summary

    Constructors
    Constructor
    Description
    GeneralNoiseSimulation(Graph graph, int numSamples, Sampler sampler, int[] hiddenDimensions, double inputScale, Function<Double,Double> activationFunction)
    Constructs a GeneralNoiseSimulation instance based on the provided parameters.
    GeneralNoiseSimulation(Graph graph, int numSamples, Sampler sampler, int[] hiddenDimensions, double inputScale, Function<Double,Double> activationFunction, boolean reportSaturation, double saturationAbsActivationThreshold)
    Constructs a GeneralNoiseSimulation instance based on the provided parameters.
  • Method Summary

    Modifier and Type
    Method
    Description
    Generates a dataset based on the current graph structure, incorporating random noise and a multi-layer perceptron (MLP) for each node in the graph.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GeneralNoiseSimulation

      public GeneralNoiseSimulation(Graph graph, int numSamples, Sampler sampler, int[] hiddenDimensions, double inputScale, Function<Double,Double> activationFunction)
      Constructs a GeneralNoiseSimulation instance based on the provided parameters.
      Parameters:
      graph - The graph structure representing the network or model to be simulated.
      numSamples - The number of data samples to generate during the simulation.
      sampler - The sampler instance used to generate noise or random data.
      hiddenDimensions - An array defining the number of hidden units in each layer of the network.
      inputScale - A scaling factor applied to the input data.
      activationFunction - The activation function applied to the network's nodes.
    • GeneralNoiseSimulation

      public GeneralNoiseSimulation(Graph graph, int numSamples, Sampler sampler, int[] hiddenDimensions, double inputScale, Function<Double,Double> activationFunction, boolean reportSaturation, double saturationAbsActivationThreshold)
      Constructs a GeneralNoiseSimulation instance based on the provided parameters.
      Parameters:
      graph - The graph structure representing the network or model to be simulated. The graph must be acyclic; otherwise, an exception will be thrown.
      numSamples - The number of data samples to generate during the simulation. Must be a positive integer.
      sampler - The sampler instance used to generate noise or random data. Cannot be null.
      hiddenDimensions - An array defining the number of hidden units in each layer of the network. Each value must be a positive integer. Cannot be null.
      inputScale - A scaling factor applied to the input data.
      activationFunction - The activation function applied to the network's nodes. Typically used to introduce non-linearity. Cannot be null.
      reportSaturation - A boolean flag indicating whether to report saturation statistics during the simulation.
      saturationAbsActivationThreshold - The absolute activation threshold used to determine activation saturation. Only applicable if reportSaturation is set to true. Must be a non-negative value.
      Throws:
      IllegalArgumentException - If the graph contains cycles, if numSamples is less than 1, if any element in hiddenDimensions is less than 1, or if saturationAbsActivationThreshold is negative.
      NullPointerException - If sampler, hiddenDimensions, or activationFunction is null.
  • Method Details

    • generateData

      public DataSet generateData()
      Generates a dataset based on the current graph structure, incorporating random noise and a multi-layer perceptron (MLP) for each node in the graph. The method uses topological sorting to determine the order of computation, propagates values through the graph, and applies noise to ensure variability.

      Note: the returned dataset's columns are in topological order, not graph.getNodes() order.

      Returns:
      A DataSet containing the computed values for all nodes in the graph and their corresponding topological order.