causally.scm.scm.AdditiveNoiseModel
- class causally.scm.scm.AdditiveNoiseModel(num_samples: int, graph_generator: GraphGenerator, noise_generator: RandomNoiseDistribution | Distribution, causal_mechanism: PredictionModel, scm_context: SCMContext | None = None, seed: int | None = None)
Class for data generation from a nonlinear additive noise model.
- Parameters:
num_samples (int) – Number of samples in the dataset.
graph_generator (GraphGenerator) – Random graph generator implementing the
get_random_graphmethod.noise_generator (Distribution) – Sampler of the noise random variables. It must be an instance of a class inheriting from
causally.scm.noise.Distribution, implementing thesamplemethod.causal_mechanism (PredictionModel) – Object for the generation of the nonlinear causal mechanism. It must be an instance of a class inheriting from
causally.scm.causal_mechanism.PredictionModel, implementing thepredictmethod.scm_context (SCMContext, default None) –
SCMContextobject specifying the modeling assumptions of the SCM. IfNonethis is equivalent to anSCMContextobject with no assumption specified.seed (int, default None) – Seed for reproducibility. If
None, then the random seed is not set.
Methods
sample()Sample a dataset of observations.