20.35 nlmx 4.14.3 fit supplement and retry overview
The --retry N option adds a controlled starting-value recovery loop to nlmx fit. It is intended for an estimation that ends with a numerical error or does not converge from the requested starting values. It does not alter the model, dataset, estimation method, covariance method, or scientific question. Instead, it preserves the original attempt and, only when needed, makes up to N additional attempts from documented alternative starts. N may range from 0 through 10; zero is the default and means that no retry is attempted.
The distinction between an attempt and a retry is important. Attempt 0 is the ordinary fit exactly as requested. Retry 1 normally uses data-derived autoinit estimates mapped into the model. Retries 2 through N make reproducible changes of up to ±15% around that autoinit center. The loop stops at the first converged retry. If attempt 0 converges, nlmx creates no retries/ directory and behaves as if --retry had not been supplied.
# Permit as many as three recovery attempts.
nlmx fit run101.ctl --retry 3
# Make random perturbations reproducible under an explicit master seed.
nlmx fit run101.ctl --retry 5 --seed 20261110 -o run101_retry
Use retry when the model and input have already passed structural and data checks but the optimizer appears sensitive to its starting point. Typical triggers include an iteration limit, a line-search failure, or a numerical failure during likelihood evaluation. Do not use it as a substitute for repairing malformed syntax, missing files, unsupported model constructs, impossible event records, incorrect units, or a structurally unidentified model.
The feature is especially useful in automated pharmacometric pipelines because it provides a bounded recovery policy rather than an unrecorded series of manual edits. That advantage depends on preserving the entire attempt ledger. A converged retry should be described as “converged from an alternative start generated by nlmx,” not as if the original starting values had succeeded.
What this supplement adds
Pages 20.36–20.44 explain the failure classifier, attempt-zero preservation, autoinit mapping, random perturbations, output tree, exit semantics, an executed 4.14.3 example, resolved-option capture, and the review required after convergence. These pages supplement—rather than replace—the estimation theory in Chapters 18–19 and the original Chapter 20 workflow.
Common mistakes
- Assuming
--retry 3always runs four fits; it stops when an attempt converges. - Calling retry a different estimation method.
- Treating convergence from another start as proof of model adequacy.
- Omitting the seed and retry ledger from the run record.
Checklist
- Confirm model, data, units, and event logic first.
- Choose a bounded retry count from 0 to 10.
- Set and archive the seed when random retries may occur.
- Review the winning folder, not only the parent output.
- Re-run the full convergence and diagnostic review.
Further reading
Continue with failure classification, the existing rescue sequence, and starting values and local optima.