# DagSim: Combining DAG-based model structure with unconstrained data types and relations for flexible, transparent, and modularized data simulation

arXiv: https://arxiv.org/abs/2205.11234 · HTML: https://mlsanity.com/paper/2205.11234/

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Builds on 8 of its 31 references that are in the map.
- First posted on arXiv 6 May 2022.

## Builds on (most cited first, 8 of 8)

- [On Disentangled Representations Learned From Correlated Data](https://mlsanity.com/paper/2006.07886/) (2020)
- [Desiderata for Representation Learning: A Causal Perspective](https://mlsanity.com/paper/2109.03795/) (2021)
- [Using simulation studies to evaluate statistical methods](https://mlsanity.com/paper/1712.03198/) (2017)
- [Feature Selection with the R Package MXM: Discovering Statistically-Equivalent Feature Subsets](https://mlsanity.com/paper/1611.03227/) (2016)
- [Explaining the Behavior of Black-Box Prediction Algorithms with Causal Learning](https://mlsanity.com/paper/2006.02482/) (2020)
- [Synth-Validation: Selecting the Best Causal Inference Method for a Given Dataset](https://mlsanity.com/paper/1711.00083/) (2017)
- [Additive Bayesian Network Modelling with the R Package abn](https://mlsanity.com/paper/1911.09006/) (2019)
- [Improving generalization of machine learning-identified biomarkers with causal modeling: an investigation into immune receptor diagnostics](https://mlsanity.com/paper/2204.09291/) (2022)

## Abstract (arXiv)

Data simulation is fundamental for machine learning and causal inference, as it allows exploration of scenarios and assessment of methods in settings with full control of ground truth. Directed acyclic graphs (DAGs) are well established for encoding the dependence structure over a collection of variables in both inference and simulation settings. However, while modern machine learning is applied to data of an increasingly complex nature, DAG-based simulation frameworks are still confined to settings with relatively simple variable types and functional forms. We here present DagSim, a Python-based framework for DAG-based data simulation without any constraints on variable types or functional relations. A succinct YAML format for defining the simulation model structure promotes transparency, while separate user-provided functions for generating each variable based on its parents ensure simulation code modularization. We illustrate the capabilities of DagSim through use cases where metadata variables control shapes in an image and patterns in bio-sequences.
