Tutorials › Pharmacometric Workflows and Reproducible Modeling › Gradient-Based Convergence Criteria

Initial Estimates and Estimation Settings · Tutorial 117 of 399

Gradient-Based Convergence Criteria

Learn how to construct and interpret a scaled-gradient convergence criterion, and why its threshold must be considered alongside parameter scales, objective scaling, and curvature.

Advanced 11 min read

What You'll Learn

  • Derive a dimensionless gradient by rescaling both parameters and the objective.
  • Interpret a scaled-gradient threshold as a bound on local first-order change, not proof of an optimum.
  • Calculate and compare scaled gradients when parameters have different units or transformations.
  • Explain how curvature determines the parameter error that can remain despite a small gradient.
  • Recognize when bounds, flat directions, or poor scaling make a gradient-based stopping decision unreliable.

Why Gradient Size Needs a Scale

An optimizer can stop when its objective changes very little or when its parameter updates are small, but neither condition directly answers whether the objective is locally stationary. A gradient-based criterion addresses that question: it measures the rate at which the objective would change for a small parameter change. However, a raw gradient is unit-dependent. Its components may be expressed in objective units per litre per hour, per volume unit, or per unit of a dimensionless parameter. Their numerical magnitudes cannot be compared fairly without accounting for parameter and objective scales.

This matters in pharmacometric estimation because parameters can differ substantially in magnitude and units. A small raw derivative for a parameter measured in a large unit may still imply a meaningful change over a plausible parameter step. Conversely, a large derivative for a parameter with a very small natural scale may correspond to little change over a relevant step. Scaling makes this comparison explicit, but it does not make every small scaled gradient conclusive: local curvature and constraints still matter.

Definition: Let \(F(\theta)\) be a differentiable objective to be minimized, where \(\theta=(\theta_1,\ldots,\theta_p)\) is the parameter vector. Choose positive parameter scales \(s_i\), reference values \(c_i\), a positive objective scale \(F_{\mathrm{scale}}\), and an objective reference \(F_{\mathrm{ref}}\). Define scaled coordinates \(u_i=(\theta_i-c_i)/s_i\), the normalized objective \(\phi=(F-F_{\mathrm{ref}})/F_{\mathrm{scale}}\), and the scaled-gradient components \(g_i^{\mathrm{scaled}}=\partial\phi/\partial u_i\). A common criterion is \(\lVert g^{\mathrm{scaled}}\rVert_\infty=\max_i|g_i^{\mathrm{scaled}}|\leq\tau\), where \(\tau\) is a chosen tolerance.

The scales and references must be stated to interpret the criterion. The \(s_i\) describe meaningful changes in each parameter, in that parameter's units. \(F_{\mathrm{scale}}\) describes a meaningful objective change and must be positive; \(F_{\mathrm{ref}}\) only shifts the objective and has no effect on its gradient. A convenient choice in a particular implementation is not a universal standard. Estimation software may use different scaling rules, norms, or tolerances, so the reported convergence test must be interpreted according to its documented definition.

Deriving the Scaled Criterion

The chain rule gives the scaled derivative. Since \(\theta_i=c_i+s_i u_i\), a unit change in \(u_i\) corresponds to a change of \(s_i\) in the original parameter. Since \(\phi=(F-F_{\mathrm{ref}})/F_{\mathrm{scale}}\), differentiation yields:

$$ g_i^{\mathrm{scaled}} =\frac{\partial\phi}{\partial u_i} =\frac{1}{F_{\mathrm{scale}}} \frac{\partial F}{\partial\theta_i} \frac{\partial\theta_i}{\partial u_i} =\frac{s_i}{F_{\mathrm{scale}}}\frac{\partial F}{\partial\theta_i}. $$

Thus each component is the objective change, in units of \(F_{\mathrm{scale}}\), per one parameter-scale change \(s_i\), to first order. This is the rationale for comparing its magnitude with a dimensionless tolerance. The criterion uses the largest component, so every individual scaled direction must satisfy the threshold. It does not directly bound the combined first-order change for an arbitrary simultaneous change in many parameters.

Interpretation: If \(\lVert g^{\mathrm{scaled}}\rVert_\infty\leq\tau\), then the absolute first-order objective change from changing only parameter \(i\) by one scale unit \(s_i\) is at most \(\tau F_{\mathrm{scale}}\), for every \(i\). This is evidence of small local slopes in the chosen coordinates and scales. It is not, by itself, proof that the point is a minimum or that the parameter estimates are accurate.

The objective may be a negative log-likelihood or another minimized estimation criterion. If an estimation method instead maximizes an objective, the same reasoning applies after defining the minimized objective as its negative. The derivative's sign indicates the direction of local increase or decrease; the stopping criterion uses its magnitude.

Worked Example: Scaling Two Parameters With Different Units

Suppose a hypothetical minimized objective has parameters clearance \(CL\), in L/h, and volume \(V\), in L. At a candidate estimate, let \(F_{\mathrm{scale}}=1\) objective unit, \(s_{CL}=5\) L/h, \(s_V=20\) L, and suppose the derivatives are \(\partial F/\partial CL=0.012\) objective units per L/h and \(\partial F/\partial V=-0.004\) objective units per L. The objective reference does not affect these derivatives.

The scaled components are:

$$ g_{CL}^{\mathrm{scaled}}=\frac{5}{1}(0.012)=0.060,\qquad g_V^{\mathrm{scaled}}=\frac{20}{1}(-0.004)=-0.080. $$

Therefore, \(\lVert g^{\mathrm{scaled}}\rVert_\infty=\max(0.060,0.080)=0.080\). With a stated tolerance \(\tau=0.10\), this candidate passes this particular scaled-gradient test. That conclusion concerns the specified scaling and criterion only; it does not establish that the estimate is a minimum. The raw derivatives, 0.012 and \(-0.004\), would not give a fair comparison because their units differ.

Curvature Determines What a Small Gradient Means

The gradient describes local slope, while curvature describes how quickly that slope changes. Near a candidate point, suppose the objective is well approximated by a quadratic with a positive-definite Hessian \(H\), the matrix of second derivatives. In scaled coordinates, its Hessian is \(\widetilde{H}=S H S/F_{\mathrm{scale}}\), where \(S\) is diagonal with entries \(s_i\). If \(u_*\) is the local minimizer of this quadratic and \(\delta=u-u_*\), then the quadratic approximation gives \(g^{\mathrm{scaled}}=\widetilde{H}\delta\). When the smallest eigenvalue of \(\widetilde{H}\) is \(m>0\), the relation implies:

$$ \lVert\delta\rVert_2 \leq \frac{\lVert g^{\mathrm{scaled}}\rVert_2}{m}, \qquad \phi(u)-\phi(u_*) =\frac{1}{2}\delta^\mathsf{T}\widetilde{H}\delta \leq \frac{\lVert g^{\mathrm{scaled}}\rVert_2^2}{2m}. $$

The first inequality follows from \(\lVert\widetilde{H}\delta\rVert_2\geq m\lVert\delta\rVert_2\) for a symmetric positive-definite matrix. The second follows by writing \(\delta=\widetilde{H}^{-1}g^{\mathrm{scaled}}\), so the quadratic excess is one half of \(g^{\mathrm{scaled}\mathsf{T}}\widetilde{H}^{-1}g^{\mathrm{scaled}}\), which is at most \(\lVert g^{\mathrm{scaled}}\rVert_2^2/(2m)\). These statements apply to the local positive-definite quadratic approximation, not to arbitrary nonlinear objectives far from the candidate point.

If \(m\) is small, a small gradient may coexist with a substantial distance to the minimizer: the objective is nearly flat in at least one direction. If curvature is large, a larger gradient can occur close to the minimizer because the slope changes rapidly. A small gradient at a saddle point or local maximum is also possible; a gradient test alone does not determine curvature or establish a minimum. These facts explain why the threshold is meaningful only in relation to scaling, curvature, and the other evidence available from the estimation run.

Worked Example: The Same Gradient, Different Curvature

Consider two hypothetical one-parameter objectives in a scaled coordinate \(u\), each with \(F_{\mathrm{scale}}=1\), and suppose the candidate is \(u=0\). Let the first objective be \(\phi_1(u)=0.5(0.01)(u-2)^2\), and the second be \(\phi_2(u)=0.5(1)(u-0.02)^2\). Both are quadratics with positive curvature.

For the first objective, the derivative at zero is \(0.01(0-2)=-0.020\), and the curvature is \(0.01\). Its minimizer is 2 scaled units away, and its objective excess above the minimum is \(0.5(0.01)(2^2)=0.020\).

For the second objective, the derivative at zero is \(1(0-0.02)=-0.020\), and the curvature is 1. Its minimizer is only 0.020 scaled units away, and its objective excess is \(0.5(1)(0.02^2)=0.000200\). The scaled gradient magnitudes are identical, but the remaining parameter displacement and objective excess differ because the curvatures differ. A threshold of 0.025 would pass both; it cannot, on its own, distinguish these situations.

Parameterization, Constraints, and Practical Checks

Scaling depends on the coordinates in which the optimizer evaluates derivatives. For a positive parameter represented as \(\eta=\log(CL)\), the chain rule gives \(\partial F/\partial\eta=CL\,\partial F/\partial CL\). A scale of \(s_\eta\) in log coordinates therefore represents a multiplicative, rather than additive, change in \(CL\). A scaled gradient computed in \(\eta\) need not equal one computed in \(CL\). The scale should reflect meaningful changes in the actual parameter while remaining consistent with the coordinates used by the algorithm.

At an active parameter bound, the unconstrained gradient may not be zero at a constrained minimum. For a lower bound, a positive derivative can indicate that moving into the feasible region increases the objective, even though the derivative is nonzero. In this setting, the relevant first-order condition concerns feasible directions; a projected-gradient criterion or equivalent bound-aware test is more appropriate than demanding that every unconstrained component approach zero. The bound and parameter-transformation conventions established in the earlier material on parameter bounds and parameter transformations help determine which directions are feasible and which coordinates are being optimized.

A practical review of a gradient-based stopping decision should therefore ask:

  • Are the derivatives computed reliably, rather than distorted by finite-difference steps or noisy objective evaluations?
  • Are parameter scales appropriate for the chosen parameterization, and is the objective scale documented?
  • Is the reported norm and tolerance defined clearly, and does each relevant component satisfy it?
  • Could weak curvature, strong parameter dependence, an active bound, or a non-minimum stationary point explain the result?

Gradient-based convergence complements, rather than replaces, objective-function and parameter convergence tolerances. Agreement among several checks is more informative than passing one criterion in isolation. A very small objective change can occur along a flat region while the gradient remains consequential in another direction; small parameter steps can also result from conservative updates rather than stationarity. Conversely, scaling choices can make an otherwise reasonable raw gradient look large or small. A documented, scale-aware test makes the reasoning inspectable, but it does not remove the need to examine the optimizer's behavior and the local geometry.

Worked Example: A Log-Parameter Gradient

Suppose a hypothetical positive clearance parameter is represented by \(\eta=\log(CL)\). At \(CL=4\) L/h, let \(\partial F/\partial CL=0.020\) objective units per L/h, and set \(F_{\mathrm{scale}}=1\). The chain rule gives:

$$ \frac{\partial F}{\partial\eta} =\frac{\partial F}{\partial CL}\frac{\partial CL}{\partial\eta} =0.020(4)=0.080. $$

If one scale unit in the chosen log coordinate is \(s_\eta=0.20\), then \(g_\eta^{\mathrm{scaled}}=(0.20/1)(0.080)=0.016\). The criterion concerns a 0.20-unit log change, which corresponds to multiplying clearance by \(e^{0.20}\), approximately 1.221, rather than adding 0.20 L/h. The result is meaningful only if that multiplicative scale and the objective scale are appropriate to the analysis.

Common Pitfall

Wrong reasoning: “The optimizer reports a gradient norm below the tolerance, so the estimates must be correct and the optimum must be well determined.” This confuses a stopping condition with a guarantee about the solution. A small gradient can arise in a flat region, at a stationary point that is not a minimum, or under scaling that makes the test insufficiently demanding. It may also be misleading at an active bound if the test ignores feasible directions.

Correction: State what gradient norm, parameter scales, objective scale, and tolerance were used. Interpret the result as evidence about local first-order slopes in those coordinates. Consider curvature and feasible directions before drawing a conclusion about proximity to a minimum, and compare the gradient result with objective and parameter convergence evidence.

Key takeaway: A scaled-gradient criterion is derived by measuring objective derivatives per meaningful parameter-scale change and normalizing by an objective scale. Its threshold is interpretable only with those scales specified; curvature, constraints, and the quality of the gradient determine what passing the test supports.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. If \(s_i=3\), \(F_{\mathrm{scale}}=2\), and \(\partial F/\partial\theta_i=-0.04\), what is the scaled-gradient component?
  2. Why can two candidates with the same scaled-gradient magnitude be different distances from their local minimizers?
  3. What does passing an infinity-norm criterion with tolerance \(\tau\) guarantee about the individual components?
  4. Why may an unconstrained zero-gradient condition be inappropriate at an active parameter bound?

Solutions. (1) \(g_i^{\mathrm{scaled}}=(3/2)(-0.04)=-0.060\). (2) Curvature differs: in a locally quadratic objective, gradient equals curvature times displacement, so a flatter direction can have a greater displacement for the same gradient. (3) It guarantees that every component has absolute value at most \(\tau\); it does not by itself bound arbitrary simultaneous first-order changes or prove a minimum. (4) A constrained optimum need only resist feasible directions; the unconstrained derivative can be nonzero when moving inward from the bound would increase the objective.

Clinical Biostats