Class PostnonlinearSem
The form of the recursive model is X_i = f_{2,i}( f_{1,i}(Pa(X_i)) + N_i ), where N_i is an exogenous noise term independent across variables.
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
ConstructorsConstructorDescriptionPostnonlinearSem(Graph graph, int numSamples, org.apache.commons.math3.distribution.RealDistribution noiseDistribution, int hiddenDimension, double inputScale) Constructs a PostnonlinearCausalModel object. -
Method Summary
Modifier and TypeMethodDescriptionGenerates synthetic data based on the directed acyclic graph (DAG) with post-nonlinear causal mechanisms.voidsetActivationFunction(Function<Double, Double> activationFunction) Sets the activation function used in the model.
-
Constructor Details
-
PostnonlinearSem
public PostnonlinearSem(Graph graph, int numSamples, org.apache.commons.math3.distribution.RealDistribution noiseDistribution, int hiddenDimension, double inputScale) Constructs a PostnonlinearCausalModel object. This model generates synthetic data based on a directed acyclic graph (DAG) with causal relationships, utilizing post-nonlinear causal mechanisms of the form X_i = f_{2,i}( f_{1,i}(Pa(X_i)) + N_i ).- 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.hiddenDimension- The dimensionality of the hidden layer in the MLPs approximating f1 and f2.inputScale- A scaling factor applied to the input variables before applying post-nonlinear operations.- 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
Generates synthetic data based on the directed acyclic graph (DAG) with post-nonlinear causal mechanisms. The data generation process involves simulating parent-child relationships in the graph, applying noise, optional rescaling, and then applying an invertible post-nonlinear distortion.- 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
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.
-