lepidoptera: Domain-Agnostic Causal Simulation Engine with Mixed Variable Types

A domain-agnostic simulation engine for structural causal models with heterogeneous variable types. Users define systems of continuous, categorical, and ordinal features, declare a directed acyclic graph (DAG) over them, attach typed generative mechanisms to each node, and simulate synthetic populations. A pre-built mechanism library covers all nine parent-type/child-type combinations. Vine copula mechanisms estimate full joint dependence from observed data via pair-copula constructions (Bedford and Cooke, 2002) <doi:10.1214/aos/1031689014>. Individual-level counterfactual queries are supported through partial propagation, which freezes unaffected random draws and resamples only the downstream subgraph, enabling individual treatment effect (ITE) estimation alongside population-level average treatment effects (ATE). Any pre-fitted predictive model can serve as a generative mechanism through three wrapper functions. Systems serialise to JSON for cross-language portability with the companion Python package.

Version: 0.1.2
Depends: R (≥ 4.1.0)
Imports: stats
Suggests: testthat (≥ 3.0.0), igraph, rvinecopulib (≥ 0.6.0), jsonlite, yaml, knitr, rmarkdown
Published: 2026-10-28
DOI: 10.32614/CRAN.package.lepidoptera (may not be active yet)
Author: Danilo Sarti [aut, cre]
Maintainer: Danilo Sarti <danilosarti at rcsi.ie>
BugReports: https://github.com/danilosarti/lepidoptera/issues
License: MIT + file LICENSE
URL: https://github.com/danilosarti/lepidoptera
NeedsCompilation: no
Citation: lepidoptera citation info
Materials: NEWS
CRAN checks: lepidoptera results

Documentation:

Reference manual: lepidoptera.html , lepidoptera.pdf
Vignettes: Getting Started with lepidoptera (source, R code)

Downloads:

Package source: lepidoptera_0.1.2.tar.gz
Windows binaries: r-devel: not available, r-release: not available, r-oldrel: not available
macOS binaries: r-release (arm64): not available, r-oldrel (arm64): not available, r-release (x86_64): not available, r-oldrel (x86_64): not available

Linking:

Please use the canonical form https://CRAN.R-project.org/package=lepidoptera to link to this page.