20.30 Evaluate-only runs, iteration limits, and a disciplined rescue sequence
Two deliberately controlled runs show why termination state matters. The first set --max-iterations 1. It improved OFV from −414.2249 to −422.6980, but stopped with “iteration limit (1) reached” and a maximum gradient of 18.43. The estimates may look close to the converged solution, yet the large gradient says they are not a stationary solution. Do not relabel this as convergence or use it for inference.
The second run started from the converged FOCE-I EXT and set --max-iterations 0. It performed one objective evaluation, preserved the estimates, and reproduced OFV −423.6680 exactly at the displayed precision. The listing identifies “evaluation only (MAXEVAL=0).” This mode is valuable for checking a fixed parameter vector, validating model translation, or measuring an OFV under controlled settings. It does not optimize and normally provides no new uncertainty assessment.
# Diagnostic nonconvergence
nlmx fit documents/ch20/input/run20.ctl --max-iterations 1 `
--output documents/ch20/results/iteration_limit --overwrite
# Evaluate final estimates imported from an EXT file
nlmx fit documents/ch20/input/run20.ctl --start-from-ext `
--ext documents/ch20/results/oral_focei/run20.ext --max-iterations 0 `
--output documents/ch20/results/evaluate_only --overwrite
Rescue a difficult run in a controlled sequence. First freeze and validate input identity, event logic and units. Second inspect initials, bounds, transformations and parameter redundancy. Third simplify one dimension at a time: remove an unsupported covariance, fix a weak variance, simplify residual error, or use a stable approximation for initialization. Fourth obtain a sound base solution, then restart from its EXT. Fifth restore intended complexity incrementally. Sixth rerun covariance and diagnostics. Preserve every attempt in a distinct output directory and record why it was tried.
Changing gradient tolerance, covariance policy or iteration count can expose whether a run merely needed more work, but it cannot repair a misspecified likelihood. Never cycle through settings until one prints “successful” without understanding what changed.
In nlmx 4.14.3, --retry N automates the starting-value portion of this rescue sequence while preserving every attempt. Retry 1 normally maps autoinit estimates into the submitted model; later attempts use reproducible ±15% perturbations. It does not automate model correction or qualification. Start with the retry supplement, and use the worked recovery to see the attempt ledger and winning folder.
Common mistakes
- Treating an improved OFV as convergence.
- Calling MAXEVAL=0 an estimation run.
- Starting from an EXT generated by different data or parameter ordering.
- Changing several model components in one rescue attempt.
- Deleting failed runs that contain diagnostic evidence.
Checklist
- Read the exact termination message and gradient.
- Verify EXT compatibility before restart.
- Change one cause at a time and use new output folders.
- Restore the intended model after obtaining stable initials.
- Re-run covariance, plots and scientific review.
Further reading
See nonconvergence and local optima, EXT files, and logging and reproducibility.