Documentation

43.11 Models I: initial estimates, structure and estimation

Three stages, autoinit, screen and fit, with their output files and a Next step note

What you will learn

  • What autoinit, screen and fit do, and what files each writes.
  • How the Models app keeps options, settings and earlier runs together.
  • How progress and chaining work.

The app you live in

Models is the core of a population analysis: build the model, estimate it, find the covariates, check it and describe the covariate effects. This page covers the first three steps; the next page covers cov, vpc and forest.

The command buttons at the top follow the workflow: autoinit, screen, fit, cov, vpc, forest. Choosing one changes the description, the inputs it needs and its options. Each command keeps its own options and settings text, so you can switch back and forth without losing work.

The six commands

Command Needs What it does Main outputs
autoinit dataset Initial estimates from the data alone (non-compartmental analysis, individual least squares, machine learning), plus OMEGA and residual error initial_estimates.csv, individual_estimates.csv, nca_results.csv, init_blocks.txt
screen dataset Fits one- to three-compartment models, with and without lag, transit absorption or TMDD, and compares OFV, AIC, BIC, likelihood-ratio tests and precision model_comparison.csv, lrt_tests.csv, best_model.ctl
fit control stream, dataset Estimates the model with FO, FOCE, FOCE-I, Laplace or SAEM, the covariance step, and goodness-of-fit plots .ext .cov .cor .coi .phi, parameters.csv, predictions.csv, report.html

Inputs

  • Control stream. Type, paste, open a file or choose an example. The editor highlights $records and folds them; Expand shows it over the whole window.
  • Dataset. Drop a file or choose one; Browse the dataset opens every row in the paginated viewer, with a column profile showing type, missing values and range.
  • Results of a fitted model (for VPC, Forest and Covariates; optional for Fit). Add the .ext, .cov, .phi, .cor and .lst of the fit, or pick an earlier run of yours: its control stream, dataset and estimate files are used. The file with the same stem as the control stream wins when several are present.

Options and the settings file

Every flag of the command is in the form, in groups. The first group opens; groups with something set stay open and show a count. Empty means the nlmx default. Column options offer the dataset's header as suggestions and as buttons, and options that take several values, such as the covariates to test, take one NAME=VALUE per line.

Optionally the settings file of the command (settings.init, .screen, .covar, .vpc, .forest) is edited in full, with the annotated template loaded straight from the engine. Options set in the form win over the same setting in the file. A form session therefore is a scripted analysis: copy the settings file and the command, and the same analysis runs anywhere nlmx runs.

Reading the three results

autoinit answers: where should I start? It estimates typical values from the data alone, which saves the hand-tuning of initial estimates that makes many first fits fail. The tables show individual estimates and the NCA results used, so you can judge whether the starting values are plausible.

screen answers: one, two or three compartments? Lag time? Transit absorption? TMDD? The comparison table ranks candidates by OFV, AIC and BIC, with likelihood-ratio tests where models are nested and a measure of parameter precision. The recommended model is written as best_model.ctl, ready to fit.

fit answers: what are the typical values, variability and uncertainty? Results show parameter estimates with standard errors, the OFV, predictions and the goodness-of-fit plots. The .ext, .cov and .phi files are exactly the files NONMEM writes, so the next steps in this app can read them, and so can other tools.

Progress

The bar follows what nlmx reports. Counts such as progress 3/25 (12%) — replicates move it with a line showing "3 of 25 replicates" and the time left. When nlmx gives no count, as with the iterations of a fit, the bar shows the iteration number and a moving stripe, not an invented percentage. A run with one step does not show "Step 1 of 1".

Chaining

On the Overview of a finished run, Next step with these results prepares the following command:

  • after Fit: VPC, Forest plot, Covariates;
  • after Screen: Fit the recommended model (best_model.ctl);
  • after Covariates: Fit the final covariate model (draft_model.ctl).

The run is prepared with the control stream, dataset and estimates of the finished one. Nothing starts by itself: change anything you like, then press Run.

Examples

Six datasets with 19 one-click uses fill the command, control stream, dataset, estimate files, options and settings. They include the QC example datasets with their control streams, and a 120-subject oral two-compartment study with the base model, the true model and the results of the fitted true model, so VPC, Forest and Covariates can be run at once. Fit followed by Covariates is the longer, realistic path.

Working with NONMEM

Because the file formats are NONMEM's, you can bring a model fitted in NONMEM to the covariate, VPC and forest steps, and take the files from any step back to NONMEM. The apps do not force a choice between tools; they remove the conversions between them.

See the previous page, next page, and the chapter overview.