cascade.sim.simulate_regimes
- cascade.sim.simulate_regimes(dag, design, interv, random_state=None)[source]
Simulate interventional data based on a causal structure with multiple sets of intervention effect in parallel
- Parameters:
dag (
DiGraph) – A directed acyclic graph representing the causal structuredesign (
Mapping[Targets,int]) – A mapping from intervention targets to sample numbersinterv (
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)random_state (
RandomState|int|None) – Random state
- Return type:
- Returns:
Simulated dataset
Note
The signal-to-noise ratio for each simulated variable should be provided as a node attribute in
dagcalled"snr".The activation function for each simulated variable should be provided as a node attribute in
dagcalled"act".