Documentation

Complete SCM command and settings index

This page is the version 4.8.0 interface map for refit-based stepwise covariate modelling. It includes every SCM-specific switch plus the shared cov controls that can change inputs, candidate definitions, likelihoods, execution, provenance, or outputs. Options belonging only to unrelated commands are intentionally omitted.

Commands at a glance

# Default both-direction SCM; refit the three best score-ranked candidates per forward step
nlmx cov --model-dir fit/run101 --run-stem run101 `
  --covariates "CL=WT,EGFR,SEX;V=WT,SEX" --method scm -o cov_scm

# Exhaustive forward and backward search: every remaining forward candidate is refitted
nlmx cov --model-dir fit/run101 --run-stem run101 `
  --covariates "CL=WT,EGFR,SEX;V=WT,SEX" --method scm `
  --scm-direction both --scm-candidates-per-step 0 `
  --alpha 0.05 --retention-alpha 0.01 -o cov_scm_full

# Full-model backward elimination only
nlmx cov --model-dir fit/run101 --run-stem run101 `
  --covariates "CL=WT,EGFR,SEX;V=WT,SEX" --method scm `
  --scm-direction backward --retention-alpha 0.01 -o cov_scm_backward

--method scm resolves the selection mode to refit_scm. A contradictory explicit selection mode is rejected. --selection refit-scm --method frozen reaches the same search machinery, but --method scm is the clearer and recommended expression.

SCM decision controls

Option Values/default Exact role
--method scm method token Selects the refit-based SCM engine.
--scm-direction forward, backward, both; default both Chooses inclusion only, elimination from the full model only, or forward then backward.
--scm-candidates-per-step N nonnegative integer; default 3 Refits the best N score-ranked candidates at each forward step; 0 refits all candidates as the exhaustive PsN-style coverage reference.
--alpha VALUE default 0.05 Forward entry threshold; a candidate enters only when refitted LRT p < alpha.
--p-forward VALUE alias of --alpha Alternate name for the same forward threshold. Do not specify conflicting aliases.
--retention-alpha VALUE default 0.01 Backward rule; a term with refitted LRT p >= retention-alpha is eligible for removal.
--p-backward VALUE alias of --retention-alpha Alternate name for the same retention threshold.
--no-final-refit flag; joint refit is default Skips the final joint refit. The path can still finish, but the result lacks the preferred joint endpoint for interpretation.
--max-candidates N default 500 Hard safety cap on generated/evaluated candidates. It is not the per-forward-step refit cap.

The candidate cap affects forward search only. Backward elimination fits one term-deleted model for every removable active relationship. both completes the forward stage and then prunes; it does not return to forward inclusion after a backward deletion.

SCM controls and search directions

Candidate scope, forms, and coding

Option Values/default Purpose
--covariates PARAM=COVS repeatable or semicolon-separated Replaces configuration scope, e.g. CL=WT,EGFR;V=WT.
--continuous-forms LIST default power Allowed continuous equations: power, exponential, linear, standardized_linear, spline.
--categorical-forms LIST default proportional Allowed categorical equations: proportional, grouped, ordinal; binary uses one proportional equation.
--all-equations flag Tries standard continuous power/exponential/linear and categorical proportional/grouped alternatives, retaining one form per relationship.
--covariate-forms COV=FORMS repeatable Overrides forms for one covariate.
--covariate-type COV=TYPE continuous/binary/categorical/ordinal Overrides automatic type detection.
--covariate-reference COV=VALUE value, median, or mean Sets continuous centering or categorical reference level.
--missing-covariates POLICY error (default), median, drop_subject Determines how missing covariate values are handled.
--compare-forms MODE auto (default), refit, score Selects how competing equations are compared. auto refits when several forms exist and uses lowest AIC.

Form comparison occurs before the stepwise path. The winning form represents that relationship during SCM; alternative forms are not independently retried after another effect enters.

Configuration adds [[relationships]] status values test, always_include, and always_exclude, plus [[competition_groups]], missing codes, allowed levels, minimum category counts, positivity/range declarations, time-varying declarations, and per-covariate policies. Preserve normalized_config.covar because it records their resolved form.

Inputs and run-family discovery

Purpose Options
Run-family discovery --model-dir, --run-stem, --recursive
Explicit manifest --files MANIFEST.txt
Model artifacts --ctl, --ext, --cov, --cor, --data, --lst, --phi, --table
Configuration -c / --config FILE

All artifacts must belong to the same fitted model and dataset. --ctl or --model-dir plus command-line scope can be used without a .covar file. The .cov file supports covariance-driven sensitivity; it does not replace refit convergence or make the path a NONMEM execution.

Likelihood, uncertainty, and numerical controls

Option Values/default SCM relevance
--approximation auto, fo, foce, foce-i, laplace Selects the nlmx likelihood approximation used by score prioritization and refits. auto follows the model where possible.
--uncertainty / --no-uncertainty flags Enables/disables covariance-draw sensitivity in the surrounding frozen evidence workflow; it does not replace refit LRT decisions.
--draws N default 200 Number of base-parameter uncertainty draws when enabled.
--seed N integer Master stochastic seed; record it even though the deterministic SCM path may not use every stream.
--fd-rel VALUE default 1e-4 Relative finite-difference step used by score/numerical components.
--ridge-max VALUE positive limit Largest permitted matrix-stabilizing ridge; exceeding it is a failure.
--threads N default all cores Worker parallelism. The documented contract is result independence from thread count.
--strict flag Promotes warnings to errors; use after expected warnings are understood.
--write-subject-scores flag Writes per-subject objective/score contributions; IDs are hashed unless retained.
--write-matrices flag Writes information matrices for validation.

Frozen-only controls such as --refine, --calibration, --information, --information-estimator, --nuisance-information, and --adjust can appear in the shared parser but do not replace the refitted LRT logic selected by --method scm. Avoid supplying irrelevant controls merely because help displays them.

Output, validation, logging, and privacy

Option Purpose
-o / --output DIRECTORY Selects the new result directory.
--run-dir DIRECTORY Identifies an existing run directory for resume-oriented workflows; identity must remain compatible.
--overwrite Permits a non-empty destination. Positively identify it before use.
--dry-run Runs validation without the full analysis.
`--suppress-console 0 1`
--log-file FILE Selects the transcript path.
-v / --verbose Increases detail; repeat for debug/trace.
-q / --quiet Limits terminal output to errors without reducing the log.
--no-color Removes ANSI color from terminal output.
--keep-subject-ids Disables subject-ID hashing. Use only under the applicable privacy policy.
--license Prints licensing/version-use information and exits.
-h / --help Prints the current executable interface and exits.

--no-checkpoint belongs to posterior replicate checkpointing and does not accelerate SCM refit caching. --format controls the separate schema command's representation, not an ordinary SCM analysis.

Configuration-only SCM controls

method = "scm"

[selection]
mode = "refit_scm"
forward_alpha = 0.05
retention_alpha = 0.01
scm_direction = "both"
scm_candidates_per_step = 3
refit_max_iterations = 60
final_refit = true

Command-line values override configuration. The normalized configuration is authoritative for resolved aliases/defaults. Backward-only constructs a full model with one equation per relationship; if that fit fails, the implementation can start deletion from the last iterate, which must be reported and confirmed with a clean final fit.

Companion commands and evidence to archive

Use nlmx inspect to review resolved scope, nlmx validate or --dry-run to validate inputs, nlmx resume with the compatible run directory to continue interrupted work, nlmx schema to capture the annotated settings reference, and nlmx forest to communicate final covariate and exposure effects. Chapter 25 documents the combined cov, posterior, and resume workflow.

Archive the executable/version, complete command, normalized configuration, input manifest/hashes, run manifest, trace, candidate table, equation table, refit cache, final-refit record, diagnostics, log, draft model, reports, and checksums.sha256.

SCM evidence bundle