1.4 What nlmx is not
A tool is easier to trust when its edges are drawn. This section says what nlmx does not do, where it differs from the tools you may be comparing it with, and what "validated" can and cannot mean for a program of this kind. The details of each limit are in Chapter 40 (limits and workarounds) and Chapter 42 (validation).
1.4.1 Not a NONMEM replacement for every model class
nlmx interprets NM-TRAN abbreviated code and estimates the model with its own engine. It supports the model classes that most population PK/PD work uses; it does not support all of NONMEM. A control stream that uses an unsupported record is refused with the name of the record, not run with the record dropped.
Table 1.4.1. Supported and unsupported parts of the NONMEM language (version 4.2.1).
| Area | Supported | Not supported, or handled differently |
|---|---|---|
| Subroutines | ADVAN1–4, 11 and 12 solved analytically; ADVAN5, 7, 10; ADVAN6, 8, 9, 13, 14 and 15 integrated from $DES |
verbatim Fortran and user-supplied subroutines |
| Model code | $PK, $DES, $ERROR, $PRED in abbreviated code; MU-referencing, IOV, time-varying covariates |
$MIX, $PRIOR, $LEVEL, $AES/$AESINITIAL, $THETAP and the other prior records, $INCLUDE, $BIND |
| Estimation | FO, FOCE, FOCE-I, Laplace, SAEM with an importance-sampling objective | METHOD=IMP, BAYES and NUTS on their own are fitted with the Laplace likelihood and a warning; no MCMC Bayesian estimation |
| Records noted and ignored | $DESIGN, $NONPARAMETRIC, $INFN, $SIMULATION, $MSFI |
their effect is not reproduced |
| Dosing and events | bolus, zero-order infusion (RATE, Rn, Dn), Fn, ALAGn, ADDL/II, SS, EVID 3 and 4 |
DATE columns are refused; give a numeric time |
| Residual error | whatever $ERROR codes: combined, proportional, additive, log-transformed, M3/M4 with F_FLAG |
M3 records are not simulated by simulate-study or the parametric-bootstrap calibration (vpc does simulate them) |
| Covariate effects | power, exponential, linear, proportional and grouped forms on parameters with a random effect or not | covariates on OMEGA or on the residual error; covariate–covariate interactions |
Two consequences follow. First, a model that nlmx accepts is a model it estimates itself: its objective function
value is on NONMEM's scale (without the constant n log 2π), and validate reproduces the .ext OFV of a NONMEM run
so that you can see whether the two agree (Chapter 5). A difference larger than about 0.1 means the model was not
interpreted as NONMEM ran it, and the later results should not be trusted until that is resolved. Second, the
numbers will not match NONMEM's to the last digit, because optimisers, random numbers and finite-difference steps
differ (Section 40.1).
1.4.2 Not a graphical environment, and not a model-writing assistant
nlmx is a command-line program. It has no graphical user interface and no project window; it writes figures and HTML
reports that you open in a viewer. It does not write a model for you from nothing: autoinit and screen propose
starting values and a structural model from the data, and generate writes a complete example project, but the model of
your analysis is yours. Maxson can explain commands and write settings files from their real templates; it cannot decide
which model is right for your question.
1.4.3 Not a validated GxP system out of the box
Regulated work asks for more than a program that is tested. nlmx comes with validation evidence, and with the parts of a validation that only you can supply.
What exists:
- Tests. The program ships with 355 unit tests and 119 end-to-end tests, run on Linux, macOS and Windows by the
project's continuous-integration workflow (
.github/workflows/ci.yml). A change is a release (Section 2.5), and every release repeats the tests. - Agreement checks.
validatereproduces the objective function value of a NONMEM run; the README reports that the analytic example reproduces its.extOFV exactly, that its$DESversion reproduces the same value, and that a more complex model with lag time, inter-occasion variability and M3 handling agrees within 0.0005. - Recovery and operating characteristics.
simulate-studymeasures sensitivity, false-positive rate and the recovery of a known truth for the covariate engines (Chapters 29 and 42). - Independent checks. A separate Python simulator (supplied with the project) checks the accuracy of
autoinit,screenandncaagainst known parameters. - Traceability. The version is in every log; every file written has a checksum; every release has a CHANGELOG entry (Section 2.5).
What you must add for a regulated use:
- an installation and operational qualification on your own systems, with your own record of which build you installed and its checksum (Chapter 2);
- a fit-for-purpose assessment for the models and the decisions you will support, with the comparison against a reference tool that your quality system requires;
- procedures: who may run what, how the outputs are reviewed, how a change of version is assessed. Chapter 42 lists what the project can supply and what remains with the user.
One property of the licence matters for such an assessment: it is CC BY-ND 4.0, so you may use and share the program unmodified, but you may not distribute a modified version without the author's permission (Section 2.3).
1.4.4 How it compares with other tools
Table 1.4.2 is a high-level comparison with the tools named in Section 1.1. It reflects each tool's published description at the level of "what can I do without another program", not a judgement of quality; the tools differ in history, in the size of their communities and in what they were built for, and Chapter 40 gives the detailed matrix.
Table 1.4.2. Capability comparison, at a high level. A dash means "not assessed in this book; see Chapter 40 and the tool's own documentation". "Separate tool" means that the capability exists around the tool, in another program.
| Capability | nlmx | NONMEM | PsN | PopED | Monolix Suite |
|---|---|---|---|---|---|
| Estimates population models | yes (FO, FOCE, FOCE-I, Laplace, SAEM) | yes (classical and EM methods, Bayesian methods) | no, it drives NONMEM | no | yes (SAEM) |
| Needs NONMEM at run time | no | it is NONMEM | yes | no | no |
| Reads NONMEM datasets and control streams | yes | yes | yes | no, models are re-coded | imports NONMEM-style data; models are re-coded |
| Dataset and control-stream checks | yes (qc-data, qc-nm) |
at run time, by NM-TRAN | — | no | — |
| Non-compartmental analysis | yes (nca) |
no | no | no | separate tool in the suite |
| Covariate search | yes (cov, without a run per candidate) |
by hand or with PsN | yes (stepwise covariate modelling) | no | yes |
| Predictive checks | yes (vpc) |
no | yes | no | yes |
| Sample size and power | yes (power: SSE and FIM) |
no | yes (SSE) | yes (FIM-based design) | — |
| Exposure-response | yes (er) |
no | — | no | — |
| Plain-word assistant | yes (ask) |
no | no | no | no |
| Graphical user interface | no | no | no | no | yes |
If your project depends on a capability in a "no" cell that matters to you (a graphical interface, a Bayesian estimation method, a prior, a mixture model), say so early: Chapter 40 lists the workarounds.
1.4.5 When to use nlmx, and when not to
| Use nlmx when | Use something else, or add it, when |
|---|---|
| you want the checks, the exploration, a first model and the covariate search in one reproducible workflow | the model uses $MIX, $PRIOR, user-supplied subroutines or an estimation method nlmx does not offer |
| you need to test many covariate candidates quickly | the submission requires a NONMEM run of the final model (nlmx prepares it; NONMEM runs it) |
| you plan a study from a model you already have | you need a graphical interface for people who will not use a terminal |
| you teach or learn, and want a complete project that runs in seconds | your quality system requires a validation package that the project does not supply |
Common mistakes in this chapter's territory
- Reading "no NONMEM needed" as "NONMEM-identical". The program reproduces NONMEM's objective function on the models it
supports; run
validateon your own model before relying on the covariate screen. - Expecting a refused feature to be approximated. An unsupported record stops the run. If nlmx accepts your control stream, the model it estimates is the one the code describes.
- Treating a "ready" verdict as a licence to model. The checks find what can be checked mechanically; they do not know your protocol.
- Treating the recommendation of a screen or a covariate engine as the final model. Both write drafts for a confirmatory fit that you review.
Checklist for Chapter 1
- I can name the seven stages of the workflow and one command for each.
- I know that every command writes to a fresh output folder, and why.
- I know what the seed and
--threadsdo to the results. - I have checked that my model's records are not in the unsupported list (Table 1.4.1).
- I know which parts of a validation I must supply myself.
Further reading
- Next: Chapter 2, installing, licensing and upgrading.
- The guided tour: Chapter 3, a complete analysis in about an hour.
- The shared rules of every command: Chapter 4.
- Limits and workarounds in detail: Chapter 40; validation and testing: Chapter 42.
- The short guides that this book extends:
README.mdanddocs/COMMANDS.mdin the project folder.