Documentation

29.1 Choosing generate or simulate-study

Choosing `generate` or `simulate-study`

Chapter 29 contains two related but different tools. generate creates one complete project: design, known truth when synthetic, simulated or supplied data, control streams, fitted artifacts, and settings for later commands. simulate-study repeats a fixed known-truth generate–fit–analyse process and estimates operating characteristics of covariate-selection engines. The first produces a reusable example or analysis starting point; the second produces method-performance evidence.

Why this matters

The choice on this page changes either the generated truth, the information available to the fit, the analysis decision rule, or the denominator of an operating characteristic. A novice should be able to point to the corresponding setting and output column. A reviewer should be able to trace every aggregate back to a generated project, completed engine run, and relationship-level row.

Detailed behavior

  • Use generate for tutorials, test fixtures, workflow rehearsals, design examples, or scaffolding a model around an existing dataset.
  • Use simulate-study when sensitivity, false-positive behavior, proxy selection, exact recovery, engine agreement, estimate bias, RMSE, failures, and runtime across repeated datasets are the endpoints.
  • Neither command proves that a structural model or covariate method will perform identically in a population not represented by its generator.
  • sims from Chapter 28 predicts exposure under new scenarios; simulate-study repeatedly fits and selects relationships against known truth.

Keep four layers separate: design truth defines what was generated; realised data contain finite random variation; fitted artifacts estimate the model from those data; and analysis decisions classify relationships under a method and threshold. Mixing these layers is the most common source of incorrect recovery claims.

Example command or settings fragment

nlmx generate --output demo
nlmx simulate-study --output study --scenarios rich,sparse --study-replicates 20 --subjects 150

Begin with an inexpensive smoke run, inspect every generated artifact and warning, and only then increase subjects, scenarios, engines, or replicates. Use a new output directory for each analytical run. In a regulated or validation setting, preserve both the command as issued and the resolved settings or generated configuration because defaults and precedence are versioned behavior.

Interpretation and quality control

Write the objective before choosing the command. ‘Create a dataset with a known 2-compartment truth’ is a generate objective. ‘Estimate how often an engine recovers CL~WT under sparse sampling’ is a simulate-study objective. Mixing those questions leads to incorrect denominators and overstated validation claims.

At minimum, verify subject/record counts, truth coefficients and forms, fit convergence, covariance status, relationship scope, classifications, completed denominators, and checksums. Read the row-level result before trusting a scenario metric. A graph is a compact diagnostic view; numerical tables remain authoritative.

Common mistakes

  • Calling one generated project an operating-characteristic study
  • Calling selection sensitivity exposure-response power
  • Comparing commands whose truth, fitting, and decision rules differ

Also avoid describing a failed or skipped cell as a zero rate. Missing, undefined, failed, rejected, and uncertain are different states and must remain distinguishable.

Evidence to retain

  • nlmx version, command, configuration, seed behavior, threads, and runtime environment;
  • generated truth/control stream, data, group/design definition, base and optional covariate fits;
  • engine settings, relationship scope, row-level results, summaries, metrics, report, failures, and completed denominators;
  • checksums, scripts used to regenerate figures, tolerances, acceptance rules, and scoped interpretation.

See the previous page, next page, and complete command and settings index.