Chapter 20 — fit: estimating a population model
nlmx fit estimates a NONMEM control stream with nlmx’s own FO, FOCE, FOCE-I, Laplace or SAEM estimator. It reads the model, dataset and run records; resolves settings; performs estimation and optional covariance; calculates individual estimates, predictions and residuals; and writes a complete NONMEM-style evidence bundle without modifying the source control stream.
This is the operational centerpiece of the book. Chapter 18 explains classical likelihoods and optimization; Chapter 19 explains SAEM and importance sampling. Here every concept becomes a reproducible workflow. The chapter documents the complete applicable option surface, supported structural/event/error syntax, parameter records, settings precedence, output files and schemas, six frozen workflows, recovery strategies, and validation boundaries.
The text is now supplemented and rechecked against nlmx 4.14.3. Frozen examples live under documents/ch20, separate from the program. They include a converged FOCE-I run with covariance and plots, Laplace, block OMEGA, deliberately short nonconverged fitting, evaluate-only reuse of EXT estimates, a short SAEM run that intentionally demonstrates a stationarity warning, and an executed --retry recovery in which attempt 0 reaches its iteration limit and retry 1 converges from mapped autoinit values.
How to use this chapter
New users should read the first-run, control-stream and data/event pages before the parameter and option sections. Practicing pharmacometricians can use the complete command index, output bundle map, or troubleshooting pages directly. Pages 20.35–20.44 form the 4.14.3 supplement for retry recovery, resolved settings, current curvature review, and post-retry qualification. The worked examples preserve commands, summaries, machine tables, plots and checksums.
Scope boundary
Successful estimation is not model qualification. Always review event interpretation, convergence, boundaries, covariance, shrinkage and diagnostics. Chapter 21 expands goodness-of-fit interpretation. Chapter 42 will define the external cross-software validation matrix.
Chapter size
The chapter contains 44 focused numbered pages plus overview and option index. Each page is deliberately dense because fit is expected to be a daily tool for pharmacometricians.