Documentation

39.11 Exit code 9: numerical or learner failure

39.11 Exit code 9: numerical or learner failure

What you will learn

  • Find the earliest numerical symptom
  • Diagnose scaling, domain, identifiability, and information
  • Use bounded, evidence-preserving retry

Prerequisites: Chapter 36 exit-code reference, Chapter 38 output completion, and the Chapter 39 overview.

This page describes nlmx 4.16.2. Troubleshooting must preserve the failed attempt: keep its exact command, working directory, log, resolved settings, input/model identities, partial outputs, and process exit code. Correct one causal condition at a time and compare the new evidence with the failed run. Never convert a nonzero exit into success in a wrapper, and never interpret exit 0 as scientific acceptance without the command-native verdict.

Exit 9 covers numerical computation: non-finite model/objective values, mode or population optimization failure, non-positive/singular matrices, covariance-step failure, simulation integration failure, or posterior learner failure. The last error is often downstream; search the transcript backward for the first warning, parameter/subject, gradient, boundary, or matrix symptom.

Use a diagnosis ladder. Confirm data/events/units and artifact identity first. Check parameter transforms, bounds, initial values, model domains (log, powers, denominators), ODE behavior/tolerances, residual variance, extreme subjects, and parameter correlations. Separate estimation convergence from covariance success. For learners, inspect feature scaling, sample/event count, constant columns, resampling failures, and fallback behavior.

Do not respond first by raising iterations, loosening tolerances, adding ridge, or retrying many random starts. Those may hide a structural defect. nlmx fit --retry retries only retryable numerical failures and preserves attempt lineage; usage, I/O, configuration, unsupported, artifact, and data failures are not retryable. Bound the number/perturbation policy and prespecify selection among successful attempts.

Qualify recovery by comparing objective, parameters, gradients, boundary flags, covariance/condition, predictions, residual diagnostics, and repeatability—not exit code alone. If two attempts converge to materially different solutions, investigate multimodality/identifiability rather than choosing the preferable estimate.

Page checklist

  • Did you retain the exact exit code, stage, message, hint, log, and partial output?
  • Did you identify one causal layer before changing anything?
  • Is the recovery a new, traceable attempt with the same intended estimand?
  • Did you check command-native and scientific acceptance after process completion?

See the previous page, next page, and complete error reference.