10.15 Draft control streams and unconfirmed code
Some workflows generate model statements or a draft control stream to accelerate the next modeling step. nlmx labels these outputs UNCONFIRMED nlmx draft. That label is a scientific boundary: generated syntax is a proposal for expert review, not an approved model conclusion.
What the draft generator does
Draft statements are selected from supported covariate transforms and functional forms. The control-stream generator inserts effects and new THETA records in locations chosen from the parsed model structure, including ETA/MU-related context. Spline effects require a manually defined basis and therefore cannot become a fully specified scientific model merely by code generation.
Mechanical correctness and scientific appropriateness are separate. A statement can parse and execute while using the wrong reference category, units, centering value, parameterization or clinical interpretation.
Review gates
| Gate | Reviewer question |
|---|---|
| Provenance | Which run, settings, data and candidate produced this draft? |
| Placement | Was the effect inserted in the intended parameter block and scope? |
| Parameterization | Are transform, centering, exponentiation and MU/ETA relationships correct? |
| Initialization | Are new THETA values and bounds defensible? |
| Identifiability | Does the model have information to estimate the added effect? |
| Execution | Does the revised model parse, fit and reproduce expected baseline behavior? |
| Scientific approval | Is the effect interpretable and pre-specified or otherwise justified? |
Promotion workflow
Copy a draft into a new model revision rather than editing the generated artifact in place. Retain the original draft, its checksum and the comparison. Review the textual diff, run parser/QC checks, confirm that the no-effect or reference case matches the parent model, and execute appropriate estimation/validation. Remove the unconfirmed label only through an explicit controlled approval process; do not delete it simply because the code compiled.
Generated code should never overwrite the control stream that produced the evidence bundle. Source/output separation and a new revision identifier make rollback and review possible.
Accuracy implications
When reproducing another pharmacometrics package, compare the full parameterization, not just the displayed covariate formula. Centering, scale, categorical coding, interpolation of time-varying values and placement relative to interindividual variability can change predictions. A fast automatically drafted model is useful only when those semantics remain reviewable.
Common mistakes
- Treating syntactic validity as model validation.
- Editing the generated draft and losing the original proposal.
- Omitting reference-level and unit checks.
- Removing
UNCONFIRMEDbefore a documented review.
Checklist
- Preserve the draft and provenance unchanged.
- Promote into a new version-controlled model file.
- Review placement, parameterization, bounds and reference behavior.
- Record independent scientific approval and validation results.
Further reading
See covariate type and centering, source/output separation and the planned covariate-modeling Chapters 22–25.