30.18 Finite differences and the covariance trace term
nlmx obtains FIM derivatives with central finite differences. For parameter value x, it perturbs upward and downward by d = fim_step × max(|x|, 0.001), evaluates subject moments, and divides their difference by 2d. This supports any model nlmx can evaluate, but makes derivative accuracy dependent on step size and numerical smoothness.
Concepts to keep separate
- A step that is too large introduces truncation error by averaging nonlinear curvature over a wide interval.
- A step that is too small amplifies floating-point cancellation and solver noise.
- Parameters near zero use a minimum scale so the step does not vanish.
- The full trace term requires stable derivatives of every element of V and can be particularly sensitive.
Terminology matters because a single scenario can contain several denominators and several sources of randomness. Truth is the parameter vector used to generate a replicate. Estimate is the value recovered from that replicate. Design is the planned arrangement of subjects, arms, doses, and observations. Method is the approximation or simulation–estimation procedure used to predict performance. A credible report labels all four.
Mathematical or operational walkthrough
A practical stability check recomputes the same design with steps one-half and twice the default. Material changes in SE, rank, or target N indicate that the result needs investigation rather than extra decimal places.
For novices, read every expression from the inside out: identify the scientific effect, identify the null value, put both on the same parameter scale, identify the variance or information that belongs to the actual design, and only then calculate a test statistic or sample size. Units and parameterisation should cancel in a way that leaves a dimensionless statistic.
How this maps to nlmx
Central differences require two model evaluations per parameter per subject/draw. Increasing parameters, subjects, or FOCE draws increases cost, but remains much cheaper than repeated estimation.
Chapter 30 explains the statistical and implementation concepts. Chapter 31 gives the complete nlmx power command, every CLI and settings control, precedence, output schema, and production workflow. This separation is deliberate: choosing an option correctly requires understanding which estimand and assumption it changes.
Quality-control checklist
- Do step-size sensitivity runs preserve the ranking?
- Are derivatives finite and symmetric enough?
- Does the matrix remain positive semidefinite?
- Are discontinuous model branches present near the reference point?
The graph is explanatory; the CSV, JSON, resolved settings, model inputs, and replicate rows are the authoritative evidence. When a plotted point looks surprising, diagnose the underlying rows before changing the design.
Common mistakes
- Reporting unstable target N to one decimal place
- Using one global absolute step for all scales
- Ignoring a ridge or rank warning
Also avoid copying a sample size from a nearby project. Power is conditional on the model, tested effect, covariate distribution, schedule, residual and random variability, attrition, test, estimator, and success criteria. Similar-looking studies can have very different information.
Evidence to retain
- scientific question, estimand, hypothesis, alpha, target, and criteria;
- model/data/design inputs, parameter source and uncertainty distribution;
- software version, method, approximation, seed, threads, command, and resolved settings;
- scenario grid, row-level results, failures, denominators, intervals, diagnostics, and checksums;
- scripts that calculate derived tables and figures, plus the interpretation and limitations.
Navigation
See the previous page, next page, and formula and decision index.