Class PostnonlinearCausalModel

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

public class PostnonlinearCausalModel extends Object
Represents a Post-nonlinear Causal Model (Zhang and Hyvarinen, 2009, 2012).

The form of the recursive model is Xi = f2i(f1i(Pa(Xi)) + Ni)

Zhang, K., & Hyvarinen, A. (2012). On the identifiability of the post-nonlinear causal model. arXiv preprint arXiv:1205.2599.

Chu, T., Glymour, C., & Ridgeway, G. (2008). Search for Additive Nonlinear Time Series Causal Models. Journal of Machine Learning Research, 9(5).

Bühlmann, P., Peters, J., & Ernest, J. (2014). "CAM: Causal Additive Models, high-dimensional order search and penalized regression". The Annals of Statistics.

Peters, J., Mooij, J. M., Janzing, D., & Schölkopf, B. (2014). "Causal Discovery with Continuous Additive Noise Models". Journal of Machine Learning Research.

Hastie, T., & Tibshirani, R. (1986). "Generalized Additive Models".

Hyvarinen, A., & Pajunen, P. (1999). "Nonlinear Independent Component Analysis: Existence and Uniqueness Results"

  • Constructor Summary

    Constructors
    Constructor
    Description
    PostnonlinearCausalModel(Graph graph, int numSamples, org.apache.commons.math3.distribution.RealDistribution noiseDistribution, double rescaleMin, double rescaleMax, int hiddenDimension, double inputScale, double coefLow, double coefHigh, boolean coefSymmetric)
    Constructs a PostnonlinearCausalModel object.
  • Method Summary

    Modifier and Type
    Method
    Description
    Generates synthetic data based on a directed acyclic graph (DAG) with causal relationships and post-nonlinear causal mechanisms.
    void
    Sets the activation function used in the model.

    Methods inherited from class java.lang.Object

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

    • PostnonlinearCausalModel

      public PostnonlinearCausalModel(Graph graph, int numSamples, org.apache.commons.math3.distribution.RealDistribution noiseDistribution, double rescaleMin, double rescaleMax, int hiddenDimension, double inputScale, double coefLow, double coefHigh, boolean coefSymmetric)
      Constructs a PostnonlinearCausalModel object. This model generates synthetic data based on a directed acyclic graph (DAG) with causal relationships, utilizing post-nonlinear causal mechanisms. The model allows for various parameter configurations to control noise, rescaling, dimensionality, and coefficient properties.
      Parameters:
      graph - The directed acyclic graph (DAG) containing the causal structure for the model. Must be acyclic; otherwise, an exception will be thrown.
      numSamples - The number of samples to generate for the synthetic data. Must be positive.
      noiseDistribution - The distribution from which noise values are generated. Often a standard distribution, such as Gaussian, but can be user-defined.
      rescaleMin - The minimum value for rescaling the data. Must be less than or equal to rescaleMax.
      rescaleMax - The maximum value for rescaling the data. Must be greater than or equal to rescaleMin.
      hiddenDimension - The dimensionality of the hidden variables affecting the model's behavior.
      inputScale - A scaling factor applied to the input variables before applying post-nonlinear operations.
      coefLow - The lower bound for randomly selected coefficients used in the model.
      coefHigh - The upper bound for randomly selected coefficients used in the model.
      coefSymmetric - A boolean flag indicating whether the randomly selected coefficients should be symmetric around zero.
      Throws:
      IllegalArgumentException - If the provided graph is not acyclic, the number of samples is less than one, or rescaleMin is greater than rescaleMax.
  • Method Details

    • generateData

      public DataSet generateData()
      Generates synthetic data based on a directed acyclic graph (DAG) with causal relationships and post-nonlinear causal mechanisms. The data generation process involves simulating parent-child relationships in the graph, applying noise, rescaling, and applying random piecewise linear transformations.
      Returns:
      A DataSet object containing the generated synthetic data, with samples and variables defined by the structure of the provided graph and simulation parameters.
    • setActivationFunction

      public void setActivationFunction(Function<Double,Double> activationFunction)
      Sets the activation function used in the model. The activation function is a mathematical function that transforms the input and can influence the relationships and behavior within the causal model.
      Parameters:
      activationFunction - The function to be used as the activation function. It must be a mapping from a Double input to a Double output, representing the non-linear transformation applied within the model.