causally.scm.scm.PostNonlinearModel
- class causally.scm.scm.PostNonlinearModel(num_samples: int, graph_generator: GraphGenerator, noise_generator: RandomNoiseDistribution | Distribution, causal_mechanism: PredictionModel, invertible_function: InvertibleFunction, scm_context: SCMContext | None = None, seed: int | None = None)
Class for data generation from a postnonlinear 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.invertible_function (InvertibleFunction) – Invertible post-nonlinearity. Invertibility is required for identifiability.
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.