simulate_data
Generate synthetic data from a linear Gaussian structural equation model matching your DAG. Set sample size, edge coefficients, and seed for reproducible sensitivity analysis.
Instructions
Generate synthetic data from a Linear Gaussian Structural Equation Model consistent with the DAG. Root variables are sampled N(0,1); each non-root is a linear combination of its parents (default β = 0.5 per edge, overridable via coefficients) plus N(0, 0.25) noise. Output is deterministic given seed (default 42).
Useful for sensitivity analysis and for demonstrating structural claims (e.g., 'adjustment for {age, smoking} eliminates the confounding shown by these data'). Outputs are consistent with the DAG under the linear Gaussian model only — real datasets generated under unknown processes will not in general match these distributions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | Sample size. Default 1000, maximum 10000. | |
| dag | Yes | ||
| seed | No | Deterministic seed. Default 42. | |
| format | No | Output format. Default 'json'. | |
| coefficients | No | Optional edge-keyed coefficient overrides, e.g. {'X->Y': 0.8}. Edges not listed use the default 0.5. |