Documentation

20.42 Worked retry recovery under nlmx 4.14.3

This executed example uses the Chapter 20 oral one-compartment model and dataset. Its demonstration control stream starts CL at zero and limits every attempt to 65 iterations. The starting point is intentionally inefficient for teaching: attempt 0 gets very close to the reference OFV but reaches the iteration limit before meeting a convergence rule. This is not a recommendation to use zero clearance or to tune MAXEVAL so narrowly in practice.

nlmx fit documents/ch20/input/run20_retry.ctl `
  --max-iterations 65 --retry 3 --seed 20261110 `
  --output documents/ch20/results/retry_worked_4143 `
  --plots --plot-format both

Attempt 0 began at OFV 725.5085 and ended after 65 iterations at −423.6679. Its maximum internal-scale gradient was 0.04006 and its termination was “iteration limit (65) reached.” A completed covariance step does not change that nonconverged status.

Retry 1 then mapped autoinit estimates into the same model. The transcript records CL 0 → 3.85614, V 45 → 42.508, KA 1.2 → 1.15881, proportional-error start 0.15 → 0.999, additive-error start 0.02 → 0.005, and updated IIV variances. Retry 1 converged in 63 iterations at OFV −423.6680 by stable relative OFV change. Because it converged, retries 2 and 3 were not run.

attempt,starting_values,folder,status,ofv,converged
0,the initial values of the control stream,.,not converged,-423.6678906408737,false
1,autoinit estimates of the dataset,retries/retry_01,converged,-423.6680281283035,true
DV versus population prediction from the winning retry

The worked output deliberately illustrates why retry convergence is not the last review step. The winning run reports THETA(5), the additive residual SD, near its lower boundary. Its full correlation-matrix condition number is about 12,111, whereas the condition number excluding the boundary parameter is about 12.4. The contrast indicates that the near-zero additive component dominates the conditioning problem. The model therefore needs residual-error review even though the main PK estimates and OFV match the reference fit closely.

The preserved evidence is under documents/ch20/results/retry_worked_4143. The submitted attempt remains in the parent. The winner is retries/retry_01. The adjacent retry_01.ctl is the starting stream; the final fitted control stream is inside the winning directory. The command is also preserved in retry-worked-command.txt.

What the example establishes

  • The retry loop starts only after attempt 0 is marked nonconverged.
  • Autoinit values are placed into the existing model.
  • The first converged retry ends the loop.
  • Attempt 0 and the winner remain separate and auditable.
  • Similar OFVs do not make a nonconverged attempt converged.
  • A converged retry can still contain boundary and conditioning warnings.

Checklist

  • Reproduce the two-row ledger.
  • Confirm the winner’s 63-iteration convergence message.
  • Compare ending estimates with the Chapter 20 reference fit.
  • Review the additive-error boundary and both condition numbers.
  • Use the winning folder for subsequent analysis.

Further reading

See retry folders and provenance, boundary diagnostics, and worked FOCE-I fit.