Tutorials › Quantitative Systems Pharmacology (QSP) › Numerical Diagnostics for Profile Optimization

Practical Identifiability and Estimability · Tutorial 569 of 799

Numerical Diagnostics for Profile Optimization

Learn a systematic way to test whether a computed profile likelihood is numerically trustworthy before interpreting its shape or interval.

Advanced 12 min read

What You'll Learn

  • Define the profile log likelihood and likelihood-ratio deviance used in numerical checks.
  • Diagnose failed convergence using optimizer status, gradients, and independent starting values.
  • Detect local minima in nuisance-parameter optimization through multistart comparisons.
  • Refine a parameter grid near profile features and likelihood-ratio cutoffs.
  • Check that likelihood evaluations are reproducible and agree with an analytic benchmark.
  • Distinguish computational failures from a genuinely flat or weakly identified profile.

Why Numerical Checks Matter

A profile likelihood is produced by repeatedly solving an optimization problem. For each fixed value of a parameter of interest, the remaining parameters are optimized, and the resulting likelihood values are assembled into a curve. A numerical optimizer can report an answer even when it has stopped at a poor point, missed a better solution, or evaluated the objective inconsistently. The resulting curve may look plausible while giving the wrong profile shape or crossing point.

The purpose of numerical diagnostics is not to make an optimizer infallible. It is to collect reproducible evidence that the computed profile is sufficiently accurate for its intended use. In particular, a flat profile can reflect limited information in the data, but it can also result from an optimization failure that has artificially depressed some profile values. The two explanations must not be confused.

Definition: Let \(\ell(\psi,\lambda)\) be the log likelihood, where \(\psi\) is the parameter being profiled and \(\lambda\) denotes all other model parameters. The profile log likelihood is $$ \ell_p(\psi)=\max_{\lambda\in\Lambda(\psi)}\ell(\psi,\lambda), $$ where \(\Lambda(\psi)\) is the allowed set of nuisance-parameter values when \(\psi\) is fixed. If \(\hat{\ell}\) is the maximized log likelihood over all parameters, the profile likelihood-ratio deviance is $$ D(\psi)=2\{\hat{\ell}-\ell_p(\psi)\}. $$ A correct global profile has \(D(\psi)\geq 0\), apart from negligible numerical error.

These definitions presume that the statistical model, data, likelihood, parameter constraints, and treatment of any nuisance parameters have been specified consistently. The optimizer must maximize the same log likelihood at every profile point, and the reported unconstrained maximum must be at least as large as any constrained maximum. A stopping flag by itself does not establish that these conditions have been met.

A Reproducible Diagnostic Sequence

At each fixed \(\psi\), the numerical task is to find the best supported nuisance-parameter solution, not merely a converged solution. A practical check records the objective value, optimizer status, parameter estimates, and a measure of the remaining gradient or constrained optimality error. Then it tries independent starting values and compares the resulting objective values. A candidate with a better likelihood replaces a worse one, whether or not it came from the warm start used at the preceding grid point.

1
Verify the optimization result.
Check that the optimizer terminated successfully, that its final parameters satisfy bounds, and that the gradient or constrained optimality residual is small enough for the scale of the problem.
2
Search for a better nuisance solution.
Repeat the fit from the previous profile solution, from other plausible starts, and, when useful, from starts sampled across the allowed parameter region. Retain the highest valid log likelihood.
3
Refine the profile where needed.
Add grid points around sharp curvature, apparent irregularities, and any crossing that determines an interval endpoint. Reoptimize at those points instead of relying only on a coarse-grid interpolation.
4
Repeat and audit the calculation.
Evaluate selected points again, preferably in a fresh run or with a different initialization order. Confirm that the data, model settings, parameter transformations, and likelihood implementation are unchanged.

The checks have different purposes. A small gradient supports local optimality but cannot rule out a better, distant local maximum. Multiple starts help reveal such alternatives but cannot prove that every possible basin has been found. Grid refinement tests whether the reported curve resolves its important features; it cannot repair a systematically incorrect likelihood. Reproducibility checks can reveal inconsistent computation, but repeated agreement alone does not prove global optimality.

Worked Examples of Numerical Checks

Worked Example: Competing Nuisance-Parameter Solutions

Suppose a hypothetical QSP model profiles \(\psi\) at \(\psi=0.8\), maximizing over nuisance parameters \(\lambda\). The best unconstrained log likelihood is \(\hat{\ell}=-120.400\). A warm-start optimization reports \(\ell=-123.100\), while two independent starts report \(-121.300\) and \(-121.250\). Assume the latter solution has satisfied parameter bounds and has a small constrained gradient residual.

The warm-start result is not the profile maximum simply because the optimizer returned it. The better valid candidate is \(\ell_p(0.8)=-121.250\). The deviance based on the warm start would be $$ D_{\mathrm{warm}}(0.8)=2\{-120.400-(-123.100)\}=5.400. $$ Using the better nuisance solution gives $$ D(0.8)=2\{-120.400-(-121.250)\}=1.700. $$

The difference is substantial: the warm-start fit would make this profile point appear much less supported. The appropriate response is to compare the nuisance parameter estimates, retry from additional starts, and retain the highest reliable likelihood. If the best likelihood varies across repeated runs, the profile is not yet numerically settled. A small gradient for the warm-start result would not change the conclusion: it could be a local maximum rather than the global maximum.

Worked Example: Refining a Coarse Profile Grid

Consider a hypothetical one-parameter profile whose coarse-grid deviances are \(D(0.50)=2.56\) and \(D(0.60)=6.76\). Suppose the endpoint is defined by the one-parameter 95% likelihood-ratio cutoff \(c=3.841\), under the regularity conditions for that cutoff. Linear interpolation between the coarse points gives $$ \psi_{\mathrm{end}}\approx 0.50+ \frac{3.841-2.56}{6.76-2.56}(0.60-0.50) =0.5305. $$

This estimate is only a grid-based approximation. Reoptimizing at finer points gives \(D(0.53)=3.61\) and \(D(0.54)=4.00\). Interpolation within this narrower bracket gives $$ \psi_{\mathrm{end}}\approx 0.53+ \frac{3.841-3.61}{4.00-3.61}(0.01) =0.5359. $$ The coarse grid misplaced the endpoint by about \(0.0054\) parameter units. The refined values bracket the cutoff, and the local interpolation is better supported. The calculation still depends on the profile optimizations at each point being reliable; a dense grid of biased objective values would not fix failed optimization.

The deviance rises across both brackets, consistent with an upper crossing. If nearby refinements instead showed a reversal or large run-to-run changes, that would be a reason to investigate optimization and likelihood evaluation before reporting an endpoint.

Worked Example: Checking a Likelihood Calculation Against a Benchmark

A numerical test can compare an implementation with a case whose likelihood is known analytically. Let the hypothetical observation be \(y=0\), with \(Y\sim N(\mu,\sigma^2)\), where \(\sigma=e^{-2}/\sqrt{2\pi}\) is fixed. For this one observation, the log likelihood is $$ \ell(\mu)=-\log(\sigma\sqrt{2\pi})-\frac{(y-\mu)^2}{2\sigma^2} =2-\frac{\mu^2}{2\sigma^2}. $$ The unrestricted maximum occurs at \(\hat{\mu}=0\), with \(\hat{\ell}=2\). Fix \(\mu=\sigma\sqrt{2(2-\tfrac12\log(2\pi))}\). Substitution gives $$ \ell_p(\mu)=2-\frac{2(2-\tfrac12\log(2\pi))}{2} =\tfrac12\log(2\pi)\approx 0.91894. $$ Therefore the likelihood-ratio deviance is $$ D(\mu)=2\{2-0.91894\}\approx 2.162. $$

A test implementation should reproduce this value up to its stated numerical tolerance. The positive value of \(\hat{\ell}\) is valid: a continuous probability density, unlike a probability of a discrete outcome, may exceed one, and its log may therefore be positive. This benchmark checks the objective calculation and the deviance convention. It does not test whether a complicated QSP model's nuisance optimization finds a global maximum.

Why the Profile Deviance Is Nonnegative

The nonnegativity check follows directly from the optimization domains. The unrestricted fit searches over all allowed parameter values, including any values considered by a constrained fit at \(\psi\). Thus, if both fits use the same model and likelihood, $$ \hat{\ell}=\max_{\psi,\lambda}\ell(\psi,\lambda) \ \geq\ \max_{\lambda\in\Lambda(\psi)}\ell(\psi,\lambda)=\ell_p(\psi). $$ Subtracting the right side and multiplying by two gives \(D(\psi)\geq 0\). A small negative value may arise from rounding or optimizer tolerance when the constrained fit is effectively at the unrestricted estimate. A material negative value indicates an inconsistency: for example, the constrained fit found a better solution than the claimed unrestricted fit, or the runs used different likelihood settings, data, bounds, or numerical approximations.

This argument also explains a useful diagnostic: the best constrained profile value should not exceed the best unrestricted value. If it does, update or recheck the unrestricted optimization before interpreting the curve. Do not silently truncate a substantial negative deviance to zero; that hides evidence that the fits are inconsistent.

Failure Modes, Comparisons, and Limitations

Numerical checkWhat it can revealWhat it cannot establish alone
Optimizer status and gradientFailed termination, bound violations, or poor local stationarityThat no better distant maximum exists
Multiple starting valuesCompeting local solutions and sensitivity to initializationA guarantee that every possible solution has been found
Grid refinementMissed curvature, irregularities, or inaccurate cutoff interpolationCorrectness of the likelihood function or the fits themselves
Repeated evaluation and analytic benchmarksNon-reproducibility, coding errors, or inconsistent objective conventionsGlobal optimality in a complex model

These diagnostics complement rather than replace one another. A Hessian-based local approximation evaluates behavior near a fitted point, whereas profile optimization checks the likelihood after allowing nuisance parameters to adjust at fixed values of \(\psi\). A local approximation may be computationally cheaper, but it cannot by itself verify that the profile optimizer has found the best nuisance solution across a range of fixed values. Conversely, profiling can be computationally demanding and is not automatically reliable just because it uses repeated optimization.

Numerical failure often has recognizable signs: abrupt jumps in nuisance estimates accompanied by a better solution from another start; profile deviance that decreases as \(\psi\) moves farther from the best fit without a plausible reason; a cutoff crossing that moves markedly when the grid is refined; or different objective values for identical parameter values. A genuinely weakly identified parameter can also produce a broad profile and unstable nuisance estimates. The distinction is whether the likelihood values themselves are reproducible and well optimized. If they are, broadness may be substantive; if they are not, the profile is inconclusive.

Tolerances should be chosen relative to the scale and purpose of the analysis. An endpoint should not be reported to more precision than is supported by changes in the profile deviance, optimization tolerances, and grid spacing. Stochastic simulators, approximate likelihoods, and numerical solutions of differential equations may require additional control of simulation seeds, solver tolerances, and approximation error. Repeating a run under unchanged settings is especially useful for detecting such variability.

Common Mistake

Common pitfall: Treating optimizer convergence as proof that a profile point is correct. A solver can converge to a local maximum, and a small gradient only indicates local stationarity. The correction is to compare the likelihood across independent starts, check constraints and optimality residuals, and verify that no better valid solution is available. If the best result changes with these checks, do not interpret the profile as settled.
Key takeaway: A profile is trustworthy only when its likelihood evaluations are consistent, its nuisance fits are sufficiently optimized, and its grid resolves the features being interpreted. Report numerical uncertainty or limitations when those checks do not support a stable result.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. At a fixed \(\psi\), two valid nuisance fits have log likelihoods \(-45.20\) and \(-44.70\). Which value defines the profile log likelihood, and why?
  2. An unconstrained fit has \(\hat{\ell}=-80.00\), while a constrained profile fit reports \(\ell_p(\psi)=-79.90\). What diagnostic issue does this raise?
  3. A profile endpoint moves substantially after adding grid points between the original grid values. What can be concluded, and what still needs checking?
  4. Why does a small gradient at one profile point fail to rule out a local-minimum problem?

Solutions. (1) Use \(-44.70\), the higher log likelihood among the valid fits, because profiling maximizes over nuisance parameters. (2) The constrained value exceeds the claimed unrestricted maximum, contradicting the optimization-domain inequality. Recheck the unrestricted fit and confirm identical likelihood settings and data; do not retain a negative deviance without investigation. (3) The original grid was inadequate for stable endpoint estimation, so the refined grid is needed. The constrained fits and likelihood evaluation must still be checked, since refinement alone cannot correct them. (4) A small gradient supports local stationarity only; a different, distant starting point may reach a higher local maximum.

Clinical Biostats