Three examples with low-dimensional X
Each CSV has directly observed baseline covariates X. The mediator columns distinguish the observed-variable and noisy-measurement paths. These are fixed synthetic draws for demonstrating the workflow.
Low-dimensional
n=100, X=2, M=2. Answer Observed covariates and mediators. The automatic method is Multiply robust, using the Díaz adapter with Z=NULL.
Download CSV · Seed: 2026091920.
All errors are independent standard normal. X and M are directly observed; there is no latent measurement layer. The sample-size preset uses 2 cross-fitting folds, which can be adjusted in Settings.
Sparsity · low-dimensional X
n=300, X=20, M=500. Answer Observed covariates and mediators. The automatic method is Sparsity. X remains unpenalized; L1 regularization applies to M only.
Download CSV · Seed: 20260917.
All errors are independent standard normal. The CSV retains readable covariate names; Z is just a known recoding of observed X, not a latent factor or an intermediate confounder. Only three mediator pathways contribute to the outcome. This is a simpler sparse DGP without interactions, separate from the original paper-inspired high-X example.
Preset K₁=K₂=2.75. Enabling sensitivity automatically checks the data and fills a feasible K grid. The range remains editable.
Factor · low-dimensional X
n=240, X=3, M=300. Answer Noisy measurements, then choose Linear factor or MediEncoder. Both keep X directly observed and apply a factor representation to M only.
Download CSV · Seed: 2026091910.
The latent mediator has dimension 2. Factor errors, loadings, measurement errors and outcome errors are independent standard-normal draws. X is observed directly, with no measurement error or factor extraction applied to it.
Choose Cumulative explained variance (50% by default; 10% to 95% in 5% steps, plus 99%) or Eigenvalue ratio to calculate the M dimension from the CSV. The true simulation dimension is not supplied as a preset. The sensitivity grid compares M dimensions 1 and 2 and can be edited. There is no X dimension grid because X remains observed.
Known effects for the saved draws
NIE is the total natural indirect effect E[Y(1,M(1))−Y(1,M(0))]; NDE is the pure natural direct effect E[Y(1,M(0))−Y(0,M(0))]. For the factor example, M in this definition denotes the latent mediator F_M.
| Example | Target | NIE | NDE | TE |
|---|---|---|---|---|
| Loading known effects… | ||||
Bootstrap and reproducibility
Each example initializes a target of 20 successful bootstrap refits. Increase it for final uncertainty analysis. Parameter sensitivity is available for Sparsity and the two factor methods; the low-dimensional multiply robust route has no corresponding K or factor-dimension grid.
Save the three Python files below together, then run python generate_routing_examples.py alongside the existing manifest.json. NumPy is required. The generator preserves the original public Sparsity and Factor records and adds these three cases.
These examples check computation and automatic routing. A single dataset and a small bootstrap run do not establish bias or interval coverage.