18.38 Comparing nlmx with NONMEM
nlmx targets the same FO, FOCE, FOCE-I and Laplace objectives on NONMEM’s scale, omitting \(n_{obs}\log2\pi\). For aligned models and methods, estimates and OFV should reach the same optimum within declared numerical tolerance. Optimizer paths and iteration counts need not match.
Align data records, IGNORE/ACCEPT, event semantics, parameterization, bounds, OMEGA/SIGMA, residual equations, F_FLAG, approximation, covariance kind and solver tolerances. First compare predictions/objective at one fixed parameter vector with validate; only then compare estimation.
SAEM streams differ and are deferred to Chapter 19. Compare its importance-sampling OFV, not the SAEM stability objective. Covariance differences can persist if R/S definitions, scales or finite-difference steps differ.
Practical interpretation
Use a laddered comparison. First match one subject’s fixed-parameter predictions and residual variances. Second match per-subject and total OFV at fixed population parameters. Third estimate from identical starts without covariance. Fourth add covariance and derived outputs. A discrepancy first appearing on one rung sharply narrows the cause and prevents compensating errors from masquerading as agreement.
Report software versions, hardware-independent numerical settings and full-precision machine tables. Human-formatted listings are useful for review but may round away diagnostic differences.
When final estimates differ, cross-evaluate them: ask each implementation to evaluate the objective at both parameter vectors without optimization. This separates different optima from different objective implementations. Also compare per-subject contributions to localize event or likelihood translation errors.
Covariance comparison should begin only after the fitted objective and optimum agree. Otherwise SE differences are expected consequences of different locations, not isolated covariance defects.
Common mistakes
Do not attribute differences to optimizers before checking model translation, demand matching iterations, or claim equivalence from one run.
Checklist
- Freeze versions and input checksums.
- Match fixed-parameter predictions/OFV.
- Align estimation and covariance methods.
- Compare full precision and tolerances.
- Preserve discrepancies and diagnostics.
Further reading
Continue to acceptance tolerances and planned Chapter 40.