Class NonlinearFunctionOfLinear
If additively, the model is Xi = fi(a1 Xi_1 + a2 Xi_2 + ... + ak Xi_k) + Ni.
If post-nonlinearly, the model is Xi = fi(a1 Xi_1 + a2 Xi_2 + ... + ak Xi_k + Ni).
Additively, the model is a special case of the nonlinear additive model in Hoyer et al. (2008),
xi = fi(Paj) + Ni
We have interpreted fi here as a nonlinear function over a linear combination of parents.
Post-nonlinearly, the error is added inside the fi function. In the bivariate case, this is a special case of the post-nonlinear model in Zhang and Hyvarinen (2012); we are using the term 'post-nonlinear' in a more general sense here, allowing for arbitrary smooth nonlinear functions.
In either case, we choose random functions fi using multilayer perceptrons from R to R with one hidden layer and tanh activation functions. The number of hidden neurons is a parameter.
Hoyer, P., Janzing, D., Mooij, J. M., Peters, J., & Schölkopf, B. (2008). Nonlinear causal discovery with additive noise models. Advances in neural information processing systems, 21.
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.
Zhang, K., & Hyvarinen, A. (2012). On the identifiability of the post-nonlinear causal model. arXiv preprint arXiv:1205.2599.
Hastie, T., & Tibshirani, R. (1986). "Generalized Additive Models".
Hyvarinen, A., & Pajunen, P. (1999). "Nonlinear Independent Component Analysis: Existence and Uniqueness Results"
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents the type of distortion applied in a nonlinear additive causal model. -
Constructor Summary
ConstructorsConstructorDescriptionNonlinearFunctionOfLinear(Graph graph, int numSamples, org.apache.commons.math3.distribution.RealDistribution noiseDistribution, double rescaleMin, double rescaleMax, double coefLow, double coefHigh, boolean coefSymmetric, int hiddenDimension, double inputScale) Constructs a NonlinearFunctionOfLinear instance, which generates synthetic data based on a directed acyclic graph (DAG) using post-nonlinear causal relationships and associated modeling parameters. -
Method Summary
Modifier and TypeMethodDescriptionGenerates synthetic data based on a directed acyclic graph (DAG) with causal relationships and post-nonlinear causal mechanisms.voidsetDistortionType(NonlinearFunctionOfLinear.DistortionType distortionType) Sets the type of distortion to be applied in the nonlinear additive causal model.
-
Constructor Details
-
NonlinearFunctionOfLinear
public NonlinearFunctionOfLinear(Graph graph, int numSamples, org.apache.commons.math3.distribution.RealDistribution noiseDistribution, double rescaleMin, double rescaleMax, double coefLow, double coefHigh, boolean coefSymmetric, int hiddenDimension, double inputScale) Constructs a NonlinearFunctionOfLinear instance, which generates synthetic data based on a directed acyclic graph (DAG) using post-nonlinear causal relationships and associated modeling parameters.- Parameters:
graph- The directed acyclic graph defining causal relationships between variables. Must not contain cycles.numSamples- The number of samples to be generated. Must be a positive integer.noiseDistribution- The distribution from which the random noise will be sampled.rescaleMin- The minimum value for rescaling the generated data. Must be less than or equal to rescaleMax.rescaleMax- The maximum value for rescaling the generated data. Must be greater than or equal to rescaleMin.coefLow- The lower bound for the uniform sampling of coefficients.coefHigh- The upper bound for the uniform sampling of coefficients.coefSymmetric- Indicates whether coefficient sampling should be symmetric around zero.hiddenDimension- The dimensionality of hidden variables in the model.inputScale- A scaling factor applied to the inputs of the nonlinear functions.
-
-
Method Details
-
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.
-
setDistortionType
Sets the type of distortion to be applied in the nonlinear additive causal model.- Parameters:
distortionType- The DistortionType to set. Determines the distortion mechanism used to modify the data in the causal model. Valid values are: - NONE: No distortion applied. - PRE_NOISE: Noise added after the nonlinear distortion. - POST_NONLINEAR: Noise added before the nonlinear distortion.
-