Documentation

Chapter 5. NONMEM files nlmx reads and writes

A familiar suffix does not by itself guarantee identical semantics. nlmx deliberately uses the NONMEM control-stream and results-file conventions that are useful for reproducible pharmacometric work. It also rejects, warns about, or ignores constructs that its own engine cannot interpret safely. This chapter defines that boundary for nlmx 4.3.0.

What you will learn

  • which control-stream records nlmx interprets, records as metadata, or refuses;
  • how final estimates, uncertainty matrices and empirical Bayes estimates are selected from .ext, .cov, .cor, .phi and table files;
  • what nlmx preserves when it writes NONMEM-format files, and what it normalises;
  • how explicit paths, file manifests and model-directory discovery differ;
  • how to check a conversion with a numerical round trip;
  • where NONMEM-format compatibility ends and independent validation must begin.

Prerequisites. Read Section 4.1 for run families and stems, Section 4.2 for fresh output folders, and Section 4.6 for data conventions.

Scope and evidence

The behavior described here was checked against the nlmx 4.3.0 source and regenerated with a release build of that version. The runnable fixtures live in documents/ch05, their captured results in documents/ch05/results, and the generator in pytools/ch05_examples.py. The Chapter 3 analysis data were generated for nlmx 4.2.1; Chapter 5 reads and fits that unchanged dataset with nlmx 4.3.0. The BLOCK example is generated independently by the Chapter 5 script.

These examples test nlmx's own import/export path. They are not a vendor validation of NONMEM and do not establish numerical equivalence with any particular NONMEM release. Chapter 42 will define the cross-software validation suite.

The sections of this chapter

Section Topic Main evidence Planned pages
5.1 Control-stream records and parser support records, abbreviations, parameters and method selection Figure 5.1; Table 5.1 8
5.2 Results files and parameter labels .ext, .cov, .cor, .phi and tables Figure 5.2; Tables 5.2–5.3 7
5.3 Writing NONMEM-format output emitted files, precision and preservation limits worked fit 4
5.4 Artifact discovery and ambiguity explicit paths, manifests and directory scanning Figure 5.3 4
5.5 Round trips and worked conversions replay and covariance parameterisations Examples 5.1–5.2 3

The page counts are production targets from DOCUMENTATION.md; Markdown length is not a claim about rendered pagination.

A practical rule

Treat every imported run as three layers:

  1. Text syntax: can nlmx parse the record and its tokens?
  2. Model meaning: does nlmx implement the same mathematical operation?
  3. Numerical evidence: do a reference implementation and nlmx agree on prespecified test cases?

A successful parse answers only the first question. A successful nlmx fit answers the first two for the exercised path. Only a controlled cross-software comparison answers the third.