Documentation

23.21 Equation-form comparison and AIC refits

Relationship selection and equation selection are different questions. When one form is requested, the frozen score evaluates that form. When several forms are requested through --all-equations, type-level lists, or --covariate-forms, nlmx must decide which form represents the parameter–covariate pair before the relationship competes in selection.

Equation selection

--compare-forms auto refits multiple equations and chooses the lowest AIC when more than one exists. refit explicitly requests that behavior. score compares score evidence only; it is faster but cannot reliably distinguish forms with the same local derivative at the null—for example, linear and exponential alternatives can look identical near coefficient zero.

When refitted AIC values are within two units, the first listed form is preferred. Order therefore encodes a prospective scientific preference. Review convergence and predicted curves in addition to AIC. A flexible form can gain likelihood through sparse tails or numerical behavior that is not clinically transportable.

Form refits are cached in frozen_refits.json. Cache reuse requires identical model identity, scope, equations, data, and relevant settings.

Common mistakes

  • Assuming score-only comparison can distinguish every nonlinear form.
  • Treating the two-AIC-unit tie rule as arbitrary output ordering.
  • Comparing AIC from failed or noncomparable likelihoods.
  • Keeping only the winning equation evidence.
  • Reusing form caches after data or model changes.

Checklist

  • Prespecify forms and preference order.
  • Use refit comparison for decision-critical alternatives.
  • Review convergence, AIC, curves, and tail support.
  • Preserve every attempted equation.
  • Validate cache identity before reuse.

Further reading

See form generation, candidate construction, and refit caching.