Class AdditiveNoiseSimulation

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

public class AdditiveNoiseSimulation extends Object
Represents a Causal Perceptron Network designed to generate synthetic data by traversing an acyclic graph while applying random multi-layer perceptron (MLP) computations to represent node relationships. This class provides functionality to create a dataset that respects the causal structure defined by the graph, optionally applying noise, rescaling, and activation functions to the generated data.

Each node of the graph can be represented as being driven by other parent nodes, constructed through a random MLP. The MLP structure, activation function, and other parameters can be customized in the constructor.

  • Constructor Summary

    Constructors
    Constructor
    Description
    AdditiveNoiseSimulation(Graph graph, int numSamples, org.apache.commons.math3.distribution.RealDistribution noiseDistribution, double rescaleMin, double rescaleMax, int[] hiddenDimensions, double inputScale, Function<Double,Double> activationFunction)
    Creates a AdditiveNoiseSimulation for generating data with a causal structure based on the provided graph.
  • Method Summary

    Modifier and Type
    Method
    Description
    Generates a dataset based on the causal structure defined by the network's graph.

    Methods inherited from class java.lang.Object

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

    • AdditiveNoiseSimulation

      public AdditiveNoiseSimulation(Graph graph, int numSamples, org.apache.commons.math3.distribution.RealDistribution noiseDistribution, double rescaleMin, double rescaleMax, int[] hiddenDimensions, double inputScale, Function<Double,Double> activationFunction)
      Creates a AdditiveNoiseSimulation for generating data with a causal structure based on the provided graph.
      Parameters:
      graph - The acyclic graph representing the causal structure of the network.
      numSamples - The number of samples to generate by the network. Must be greater than 0.
      noiseDistribution - The probability distribution used to sample noise for the network.
      rescaleMin - The minimum value for rescaling output data. Must be less than or equal to rescaleMax.
      rescaleMax - The maximum value for rescaling output data. Must be greater than or equal to rescaleMin.
      hiddenDimensions - An array representing the number of hidden neurons per layer. All entries must be at least 1.
      inputScale - A scaling factor applied to the inputs of the network.
      activationFunction - A function applied as the activation function for the perceptron network. Must be provided and not null.
      Throws:
      IllegalArgumentException - If the graph is not acyclic, numSamples is less than 1, rescaleMin is greater than rescaleMax, or if any hidden dimensions are less than 1.
      NullPointerException - If noiseDistribution, hiddenDimensions, or activationFunction are null.
  • Method Details

    • generateData

      public DataSet generateData()
      Generates a dataset based on the causal structure defined by the network's graph. This method uses a causal graph to determine the order of nodes, processes the parent's data, adds noise, and forwards it through a randomly initialized multilayer perceptron (MLP) with the specified parameters. The data is optionally rescaled between specified minimum and maximum values, and the resulting data is returned as part of a structured dataset.
      Returns:
      A dataset containing generated data with causal relationships derived from the network's graph structure and the associated processing logic.