Documentation

20.2 Your first fit

Run a validated control stream with an explicit output path:

nlmx fit run101.ctl -o results/run101 --no-color

By default, method comes from $ESTIMATION; without one, FOCE-I is used. Initial values come from $THETA/$OMEGA/$SIGMA; data from $DATA; covariance runs when $COVARIANCE exists. The source control stream is never edited.

Read console/listing in order: problem/control/data/model; method; termination, iterations/evaluations and gradient; initial/final OFV; parameter table; OMEGA/SIGMA; covariance/condition; notes; data-column interpretation. Do not jump directly to estimates.

Then open fit_summary.txt, parameters.csv, predictions.csv, report.html, and fit_command.txt. Verify source counts and excluded records. Re-run the recorded command in a clean directory if the analysis is pivotal.

The frozen example is:

nlmx fit run20.ctl --data oral.csv -o oral_focei \
  --carry-columns WT,GROUP --plots --plot-format both

It uses 24 subjects and 192 fitted observations, excluding 24 predose observations by default. It converges in 17 iterations with OFV −423.6680 and sandwich covariance.

What to inspect immediately after the command

Start with the console termination line, then open fit_summary.txt. Confirm the resolved control and data paths, subject and observation counts, model description and estimation method. If any differ from expectation, stop before interpreting parameters. Next verify convergence and gradient, review parameter units and bounds, and reconcile warnings. Open predictions.csv and at least the observed-versus-predicted and residual-versus-time plots.

Use a new output directory for each meaningful attempt. --overwrite is convenient for a tutorial but is usually unsuitable for preserving a development history. Prefer names that encode the run purpose, such as run020_base_focei or run021_blockomega, while keeping the scientific rationale in a run log.

The first fit is a pipeline test, not automatically the final model. It should prove that parsing, record selection, dosing, predictions, estimation and artifact creation behave as intended. Only then should covariate search, random-effect expansion or formal model comparison begin.

Common mistakes

Do not reuse a nonempty output without deliberate --overwrite, confuse observations with all records, or assume no console error means convergence. --quiet changes terminal display, not the logged evidence.

Checklist

  • Validate control stream/data first.
  • Set explicit output and no-color for transcripts.
  • Confirm resolved model/method/counts.
  • Review termination, covariance and notes.
  • Archive/checksum complete output.

Further reading

See input resolution and worked FOCE-I example.