Documentation

20.37 Attempt zero and the retry handoff

Attempt 0 is the same fit that would run without --retry. It uses the requested control stream, resolved dataset, configuration, CLI overrides, estimation method, iteration limit, covariance policy, seed, and output settings. Its files remain in the parent output directory. nlmx does not move or overwrite them when a retry starts.

Attempt zero and recovery handoff

This preservation matters because the original attempt answers a different audit question from the winner: what happened from the submitted starting values? The retry answers: did an explicitly generated alternative start recover a converged solution? Both are needed when judging sensitivity to initialization.

The handoff occurs only after attempt 0 returns either a retryable numerical error or a completed result marked nonconverged. nlmx then resolves the original model and dataset again, prepares the recovery start, writes a new control stream under retries/, and calls the ordinary fit implementation for that stream. Estimation controls such as approximation, gradient tolerance, maximum iterations, covariance choice, plotting, and table creation remain in force.

output/
  fit_summary.json       attempt 0
  <stem>.ext             attempt 0 history and estimates
  plots/                 attempt 0 diagnostics, if requested
  retries/
    retry_01.ctl         the first alternative starting stream
    retry_01/            a separate ordinary fit bundle

If attempt 0 converges, the command returns immediately. This means a routine production command may safely include --retry 3 without paying for three extra fits on every run. It also means that the absence of retries/ is meaningful: no recovery attempt was required.

Do not overwrite the parent folder between review steps. The parent’s final control stream contains attempt 0’s ending estimates, whereas the converged retry’s final control stream is inside its retry folder. Downstream work should use the converged row identified in retries.csv, not automatically the parent directory.

Interaction with other controls

  • --start-from-ext determines attempt 0’s starting estimates. The retry machinery then centers recovery on the resolved start and autoinit behavior described on the next page.
  • --max-iterations applies to every attempt. An unrealistically small value can cause every retry to stop prematurely.
  • --cov-step and plotting options apply to every completed attempt and can increase retry cost substantially.
  • --overwrite permits use of a non-empty target but does not turn retry folders into a single merged run.

Common mistakes

  • Assuming the parent output is replaced by the winner.
  • Giving every attempt too few iterations to converge.
  • Comparing attempt outputs without checking their starting control streams.
  • Deleting attempt 0 after a retry succeeds.

Checklist

  • Preserve the parent result as attempt 0.
  • Confirm identical estimation controls across attempts.
  • Locate the converged row in retries.csv.
  • Point downstream commands to the winning retry folder.

Further reading

Continue with autoinit for retry 1 and the retry output tree.