23.17 Finite-difference steps and derivative sensitivity
Numerical derivatives approximate slopes and curvature by evaluating the likelihood at nearby parameter values. The default relative step is 1e-4 and the configuration-only absolute floor is 1e-7. A relative rule scales perturbations with parameter magnitude; the absolute floor prevents a zero or tiny parameter from receiving a meaningless step.
A step that is too small suffers cancellation, conditional-mode noise, and floating-point error. A step that is too large measures curvature over a region where the quadratic approximation is no longer local. ODE tolerances, event discontinuities, boundaries, and parameter transforms can compound both problems. The best step is therefore model-specific rather than a universal constant.
When an information matrix is unstable, repeat a labeled sensitivity with a moderately larger --fd-rel, such as 1e-3, and compare scores, eigenvalues, rank, and classifications. Do not tune the step candidate by candidate until a preferred result appears. Any changed step belongs in normalized settings and the report.
Derivative validation can compare central differences across several step sizes, exploit analytic checks for simple models, and compare score-predicted ΔOFV with targeted refits.
A reproducible step-size study
Choose a small global grid, for example relative steps 3e-5, 1e-4, 3e-4, and 1e-3. Run identical candidate scope and information settings into separate directories. Compare raw scores, efficient statistics, minimum eigenvalues, ranks, one-step betas, subject-mode failures, and classifications. A stable result changes little across the central settings. Monotone drift or sign changes suggest truncation, cancellation, mode, or boundary problems. Do not average statistics across steps. Select a qualified setting based on numerical stability and refit agreement, then apply it to the complete candidate family rather than only the troublesome pair.
Common mistakes
- Assuming more decimal places require a smaller step.
- Changing the step only for an inconvenient candidate.
- Ignoring conditional-mode tolerance when derivatives are noisy.
- Using a large step that crosses a parameter boundary.
- Reporting p-values without the derivative settings.
Checklist
- Start from the validated default.
- Inspect stability across a small step-size grid when warned.
- Review eigenvalues and subject-mode convergence.
- Keep sensitivity settings global and documented.
- Confirm important evidence with refits.
Further reading
Continue to rank and ridge, observed information, and Chapter 42 when drafted.