cascade.sim.simulate_random_regimes

cascade.sim.simulate_random_regimes(dag, n_obs, rate, interv, random_state=None)[source]

Simulate interventional data based on a causal structure with random interventions

Parameters:
  • dag (DiGraph) – A directed acyclic graph representing the causal structure

  • n_obs (int) – Number of samples

  • rate (float) – Interventional rate per node

  • interv (Mapping[str, float | Callable[[int, RandomState | int | None], Sequence[float]]]) – Intervention scaling factor \(\lambda\) of each intervention target or sampler function of such (\(\lambda = 0\) for knockout, \(0 \lt \lambda \lt 1\) for knockdown, \(\lambda \gt 1\) for knockup)

  • act – Activation function

  • snr – Signal to noise ratio

  • random_state (RandomState | int | None) – Random state

Return type:

AnnData

Returns:

Simulated dataset