5.2 Results files and parameter labels
nlmx uses the NONMEM results-file family as a set of related numerical inputs. The control stream defines the parameter structure; .ext supplies estimates; .cov and .cor supply uncertainty; .phi or a table can supply subject-level random effects. These files are related by labels and stem, not by an embedded universal run identifier.
Figure 5.2. The control stream is the structural reference. The .ext file supplies a parameter vector; uncertainty and subject-level files are optional for some commands and required for particular analyses.
5.2.1 The .ext file
An .ext file is whitespace-delimited and can contain several TABLE NO. sections. Within a table, a header beginning with ITERATION defines the columns. Data rows must have the same width as that header. nlmx selects the last parsed table, so a trailing incomplete table is an error rather than an instruction to use the last earlier successful table.
The preferred final-estimate row has iteration code -1000000000. If it is absent, nlmx can fall back to the last ordinary iteration row and warns. Other special rows can contain standard errors or fixed-parameter information; they are not interchangeable with the final estimate row.
The objective column is found by a label beginning with OBJ. Parameter columns are matched to the parameter structure derived from the control stream. Values in an .ext file must use a standard numeric form (for example 1.5E-3); use E scientific notation in generated files rather than relying on a Fortran D exponent.
In the generated example, the start of the fitted file can be inspected with:
Get-Content documents/ch05/results/fit/base.ext -TotalCount 8
The fixture multi-step.ext deliberately places a teaching-only table before the real fit. This command still selects the trailing fitted table:
nlmx inspect `
--ctl documents/ch05/results/fit/base.ctl `
--ext documents/ch05/results/multi-step.ext `
--covariates CL=WT
The captured invocation and exit status are in documents/ch05/results/logs/last-step.txt.
5.2.2 Parameter-label grammar
Parameter order must never be reconstructed by visual position alone. Table 5.2 shows the label conventions that connect files.
Table 5.2. Parameter and subject-level labels
| Kind | Accepted or emitted examples | Interpretation |
|---|---|---|
| Fixed effect | THETA(1), normalised THETA1 |
one-based fixed-effect index |
| Random-effect covariance | OMEGA(1,1), OMEGA(2,1), OMEGA(2,2) |
lower triangle of OMEGA in natural covariance units |
| Residual covariance | SIGMA(1,1) |
lower triangle of SIGMA |
| Subject random effect | ETA(1), commonly also ETA1 |
empirical Bayes estimate coordinate |
| Conditional covariance | ETC(1,1), ETC(2,1) |
lower-triangular subject conditional covariance |
| Individual parameter | PHI(1) |
coordinate may be an individual/transformed parameter, not necessarily ETA |
Label normalisation removes case and spacing differences and handles common THETA variants. Do not assume every informal label is normalised. In particular, matrix indices and the lower-triangular order should be emitted explicitly.
5.2.3 .cov and .cor
nlmx reads labelled square matrices. A header names the matrix columns, and each following row starts with the matching row label. Header and row order must agree. A second labelled matrix header starts a new matrix; partial lower triangles are not a complete matrix input.
The estimated-parameter set excludes fixed and structurally absent parameters. Consequently the matrix dimension can be smaller than the number of columns in .ext. All-zero parameter rows can be treated as non-estimated and removed from the uncertainty mapping. nlmx checks diagonal validity, symmetrises small asymmetry, applies configured conditioning checks and can compare covariance-derived correlations with a supplied .cor file. A material .cov/.cor inconsistency is an input error.
The diagonal of an nlmx-written .cor file contains standard errors, while off-diagonal entries are correlations. It is therefore not a conventional correlation matrix with ones on the diagonal. Import code recognises both common layouts, but consumers outside nlmx must be told which convention was written.
Table 5.3. Result-file role and necessity
| File | Main content | Typical requirement | Important limit |
|---|---|---|---|
.ext |
estimates and objective by iteration/table | required by inspection/covariate workflows; optional initialisation for fit |
last parsed table is selected |
.cov |
labelled covariance of estimated population parameters | optional for estimates-only tasks; needed for uncertainty propagation | dimension follows estimated parameters, not all parameters |
.cor |
labelled SE/correlation representation | consistency check and reporting | nlmx output uses SE on the diagonal |
.phi |
subject ETA/ETC or PHI information | posterior workflows depending on EBEs | PHI coordinates are not automatically guaranteed to be ETA coordinates |
| table file | repeated subject rows and selected columns | fallback source for ID/ETA in some workflows | ETA values must be constant across a subject's repeated rows |
.lst |
run listing/provenance artifact | can be discovered as part of a run family | nlmx does not extract the numerical model from it |
5.2.4 .phi, ETA, PHI and conditional covariance
For each table in a .phi file, nlmx looks for an ID and subject coordinates. It prefers a table carrying ETA columns; if no such table exists, it can use PHI columns with a warning. That fallback must be reviewed: PHI often denotes an absolute or transformed individual parameter, and its coordinate system need not equal ETA. nlmx does not have enough information in every foreign file to prove equivalence.
ETC(i,j) columns describe the conditional covariance associated with a subject. Their presence is not, by itself, proof that every matrix is positive definite or statistically usable. Posterior workflows perform additional checks and can apply configured repairs. Record any repair because it changes an imported numerical artifact.
Numeric subject identifiers are normalised so equivalent integer spellings can match dataset IDs. Repeated rows for a subject in a table fallback must carry constant ETA values. Prefer numeric IDs and one contiguous subject block when exporting .phi; unusual string IDs or non-contiguous repeats can be ambiguous in a whitespace-oriented file.
5.2.5 Fit initialisation is explicit
Supplying an .ext path to fit is not sufficient by itself. Use --start-from-ext; otherwise the fit uses the control stream's initial values. The generated replay makes this contract visible:
nlmx fit documents/ch05/results/fit/base.ctl `
--start-from-ext `
--ext documents/ch05/results/fit/base.ext `
--max-iterations 0 `
--no-cov-step `
--keep-predose `
--output documents/ch05/results/replay
Commands differ in whether they search beside a control stream, in a results directory, or only after an explicit request. Do not transfer discovery expectations from fit to sims, power, vpc or another command. Section 5.4 gives the general discovery modes; each command chapter states its additions.
Assumptions and limits
The import path assumes that the control stream and numerical files describe the same parameterisation and ordering. Labels reduce that risk but cannot prove provenance. nlmx does not certify that a copied .cov, .phi or table came from the .ext beside it.
For major-software accuracy comparisons, hash the inputs, preserve the original precision, specify the table-selection rule, and compare both parameter labels and values. A close objective with a permuted covariance matrix is not a successful reproduction.
Common mistakes
- Selecting a visually plausible row instead of the final-estimate row.
- Treating the last successful table as the last parsed table.
- Assuming
.coralways has ones on its diagonal. - Mapping PHI columns directly to ETA without checking their definition.
- Including fixed parameters when interpreting
.covdimensions. - Passing
--exttofitwithout--start-from-ext.
Checklist
- The intended
.exttable is last and complete. - The final-estimate row and objective column are present.
- Parameter labels match the control stream's one-based indices.
-
.covand.corhave matching labels and acceptable conditioning. - ETA/PHI coordinates and subject IDs were verified.
- Imported initialization was explicitly enabled where required.
Further reading
Read Section 5.3 before handing nlmx output to another tool, and Section 5.4 before relying on automatic discovery. Chapter 23 will cover posterior-stability repairs and diagnostics in detail.