Documentation

22.18 Generating and comparing multiple equation forms

By default nlmx tries one typical equation per type: power for continuous, proportional for binary/categorical, and ordinal for an ordinal override. --all-equations adds power, exponential, and linear continuous forms and proportional/grouped categorical forms. Type lists and per-covariate lists provide finer control.

When a pair has several forms, --compare-forms auto refits every form and selects the lowest AIC. Forms within two AIC units are considered practically tied and the first listed form wins. refit always performs refits; score compares score-test p-values without refits and is faster.

Equation comparison precedes relationship selection

Score comparison cannot distinguish linear and exponential forms at theta = 0 because their local slopes are identical. Use refits when tail behavior matters. Even refits may not distinguish forms over narrow covariate ranges; prefer the prespecified, interpretable, stable equation rather than claiming proof.

Refit cost is roughly one base-model estimation per equation. Restrict forms for slow ODE models or use a staged analysis. Refit results are cached in frozen_refits.json; preserve cache identity.

Form choice and relationship selection are separate multiplicity layers. Only the chosen form represents the pair in subsequent selection. Withdrawn alternatives are not independent rejected biological relationships.

A fair comparison protocol

Hold the dataset, base model, reference, missingness policy, candidate scope, estimation settings, and random seed constant while comparing forms. A lower AIC is meaningful only when likelihoods are comparable and both fits are numerically credible. Review convergence, covariance, boundaries, coefficient uncertainty, and predicted curves before accepting the ranking. When forms fall within the configured two-AIC-unit tie region, nlmx prefers the first listed form; therefore that order should encode the prespecified scientific preference. Score-only comparison can screen quickly but may not distinguish forms whose derivatives are locally similar. Refit close or decision-critical candidates and preserve the evidence for every tried equation, not only the winner.

Common mistakes

  • Trying every form without data support or rationale.
  • Using score mode to separate locally identical forms.
  • Ignoring the prospective form order tie-breaker.
  • Counting withdrawn forms as separate biological rejections.
  • Comparing AIC from incompatible data or likelihoods.

Checklist

  • Prespecify plausible forms and order.
  • Choose auto/refit/score deliberately.
  • Review df, OFV, AIC, convergence, and shape.
  • Preserve form-refit caches and identities.
  • Carry one documented representative into selection.

Further reading

Continue with method map, multiplicity, and Chapter 23 candidate construction.