Why the Same Model Can Have Different Objective Values
An objective function value is often treated as if it were a universal score: fit a model in two programs, compare the reported numbers, and expect them to match. That comparison is meaningful only when the numbers represent the same quantity, evaluated for the same data under compatible likelihood calculations. A difference may come from a simple reporting convention, such as using log-likelihood rather than negative twice the log-likelihood. It may also reflect different observations, likelihood contributions, or numerical approximations.
The goal is not to make unlike numbers look alike. It is to identify what each number measures, then decide whether the discrepancy is only a convention or evidence that the analyses differ. This matters when reviewing estimation output, comparing candidate models, and documenting a workflow across NONMEM, Monolix, and nlmixr2.
In nonlinear mixed-effects models, the likelihood commonly used for estimation is a marginal likelihood. For subject \(i\), it integrates over the subject’s random effects \(\eta_i\), rather than treating an estimated individual random effect as known:
Here \(y_i\) denotes the observations for subject \(i\), and \(N\) is the number of subjects. Evaluating this integral can require approximation or simulation. Different estimation methods can therefore yield different numerical evaluations even when the model specification and data are intended to be the same. An objective evaluated conditionally at individual estimates is not automatically the same as this marginal likelihood.
The labels in software output are useful clues, not complete definitions. NONMEM, Monolix, and nlmixr2 can report likelihood-related quantities whose meaning depends on the estimation method, output field, and settings. In particular, do not infer from a tool name alone that two values use the same constants, data records, approximation, or scale. Check the documentation for the specific version and the estimation run.
Constants in a Likelihood
A common source of a fixed difference is a parameter-independent constant. Consider independent normally distributed observations \(y_j\) with predictions \(f_j\) and residual variance \(\sigma^2\). The normal density includes its normalizing constant, so the full negative-two-log-likelihood is:
If a calculation omits the \(\log(2\pi)\) term, its value is smaller by \(n\log(2\pi)\). That offset does not depend on the fitted parameters when the number and type of observations are fixed. Thus, for this likelihood, omitting the constant does not change which parameter value maximizes the likelihood. It does change the reported absolute value. The same reasoning does not license comparing values across analyses with different data or different likelihood contributions.
Worked Example: Calculating a Gaussian Objective With and Without a Constant
Suppose a hypothetical analysis has three independent observations, residuals \(y_j-f_j\) of \(1\), \(-1\), and \(2\) concentration units, and residual standard deviation \(\sigma=2\) concentration units. Assume the stated normal model applies to all three observations and that these are the only likelihood contributions being considered. The residual sum of squares is \(1^2+(-1)^2+2^2=6\) concentration-units squared, and \(\sigma^2=4\) concentration-units squared.
The full objective is:
If the constant \(\log(2\pi)\) is omitted for each observation, the reduced value is:
The difference is \(11.17-5.659\approx5.514\), which is \(3\log(2\pi)\). Under the assumptions just stated, this difference is a convention, not evidence that the fitted residuals or parameter estimates disagree. The values are not directly interchangeable until the convention is established.
The normalizing constant is not the only possible constant or contribution. For example, a likelihood for a transformed response may include a Jacobian when it is expressed as a density on the original response scale. If \(Z=\log Y\), then the density on the \(Y\) scale is \(f_Y(y)=f_Z(\log y)/y\) for \(y>0\). Consequently, the negative-two-log-likelihood on the original scale includes \(2\log y\) in addition to the contribution calculated on the log scale. Such a term does not depend on model parameters for a fixed observed \(y\), but it affects absolute likelihood values and can matter when comparing analyses that use different response scales or data.
Check the Records and the Contributions
Before attributing a gap to constants, verify that both runs use the same observations and assign a likelihood contribution to each one in the same way. Counts should be checked at the level that matters: subjects, observation records, and records by type. Differences can arise from excluded rows, missing values, dose or event records mistakenly treated as observations, or different handling of below-quantification-limit data. A censored observation, for example, generally contributes a probability such as \(P(Y\leq L)\), not the point density at a substituted value \(L\).
A useful first check is to list the records that contribute to the likelihood in each run, with subject identifiers, times, response values, and record types. Matching the total number of records is not enough if the contributing records differ. Likewise, identical records do not ensure identical likelihoods if an observation is modeled on a different scale or assigned a different error model.
Worked Example: Finding the Effect of One Included Record
Suppose two hypothetical runs use the same normal observation model with residual standard deviation \(2\) concentration units. One run includes three observations; the other includes those same observations plus a fourth observation whose prediction residual is zero. Assume the parameters and predictions for the shared observations are unchanged, and that there are no other likelihood contributions.
For the added observation, the full negative-two-log-likelihood contribution is:
Thus, even though the added record has zero residual, including it increases the full objective by about \(3.224\). A lower objective from the run with three records would not establish that its model fits better: it was evaluated against less data. If one run reports an objective that omits \(\log(2\pi)\) per record, the added record’s contribution under that convention would instead be \(\log(4)\approx1.386\). Record counts and constants must therefore be checked together.
Check the Scale and the Likelihood Evaluation
A number labelled “objective” may use a different scale from another output. Common possibilities include \(\ell\), \(-2\ell\), \(-\ell\), or a per-observation value. If a reported log-likelihood is \(-12.40\), its negative twice log-likelihood is \(24.80\), not \(-24.80\). If that value is divided by four observations, the per-observation negative-two-log-likelihood is \(6.200\). These conversions are valid only when the underlying likelihood and observation count are known.
A second issue is how the random-effects likelihood was evaluated. NONMEM, Monolix, and nlmixr2 offer estimation workflows with different methods and implementation choices. A method may approximate the marginal likelihood, while another output may be a conditional criterion or a likelihood estimate calculated separately from the parameter-estimation step. Even if both outputs use the label “objective function,” they need not be evaluations of the same mathematical expression. For a valid comparison, identify the estimation method and the precise reported field in each run; do not assume that matching parameter estimates guarantee matching objective values.
If the objective includes a penalty or prior contribution, it is not simply the same likelihood-based criterion as an unpenalized \(-2\ell\). Such a value may be appropriate for its purpose, but it should not be compared as if the extra term were absent. Document whether the reported quantity is likelihood-based, penalized, or otherwise transformed.
Worked Example: Reconciling Two Reported Scales
Suppose, hypothetically, one output reports a log-likelihood of \(-18.60\), while another reports an objective of \(37.20\). Assume for this example that both refer to the same data and the same evaluated likelihood, with no extra penalty or differing constant convention.
On the negative-two-log-likelihood scale, the first value is:
The numerical agreement means the two outputs are consistent under the assumed scale conversion. It does not, by itself, prove that their models or likelihood evaluations are equivalent; those assumptions still need to be verified. If instead the second output were \(18.60\), it could represent \(-\ell\), but that would need confirmation from the output definition rather than inference from the number alone.
A Practical Reconciliation Workflow
When reported values differ, proceed from checks that are easiest to verify to those that require closer examination of the likelihood calculation. Keep a record of the field name, tool version, estimation method, and run settings for each number. Then use the following sequence:
Determine whether each output is \(\ell\), \(-\ell\), \(-2\ell\), a per-record value, a criterion with a penalty, or another quantity. Record its definition rather than relying on the label.
Compare contributing subjects and records, missing-data handling, censoring, response scale, and likelihood type. Confirm that the number of contributions used in any proposed constant adjustment is correct.
For a proposed offset, write down the term per contribution and multiply by the appropriate count. Check transformations and any additional likelihood terms rather than assuming that one universal constant applies.
Identify whether the values use compatible marginal likelihood calculations and approximations. If the methods differ, a residual discrepancy may reflect numerical or methodological differences rather than an omitted constant.
State the quantity, scale, data basis, and method. If a discrepancy remains unexplained, report it as unresolved rather than adjusting one value until it matches.
Interpreting Differences Without Overclaiming
For a fixed dataset and likelihood, adding a parameter-independent constant shifts the objective by the same amount at every parameter value. The maximizing parameter value is therefore unchanged. This follows directly: if \(Q(\theta)=-2\ell(\theta)+C\), where \(C\) does not depend on \(\theta\), then for any \(\theta_1,\theta_2\),
The constant cancels when comparing parameter values under that same likelihood. This justification has limits: it does not show that two programs used the same likelihood, and it does not make absolute objective values interchangeable. If the data, likelihood contributions, or approximation differ, there may be no single constant that reconciles the outputs.
Information criteria also require care. AIC and BIC are defined using a specified likelihood and parameter count; a difference caused only by a shared, fixed convention may cancel in some comparisons, but differences in data or likelihood definition do not. Ensure that candidate models are evaluated on comparable data with the same likelihood convention before interpreting a criterion difference.
Common Mistakes and Limitations
- Assuming every tool reports the same definition. A field called “objective” is not self-defining. Verify whether it is a log-likelihood, negative log-likelihood, negative twice log-likelihood, or another criterion.
- Calling any fixed gap a harmless constant. A constant explanation should be derived from the actual likelihood and the number of contributions. A gap that varies across records or model settings may have another cause.
- Comparing runs with different data as though they were competing fits. An objective depends on which observations contribute. More records can increase the objective even when added residuals are small.
- Equating parameter agreement with likelihood agreement. Similar estimates do not prove that the same likelihood or approximation was evaluated.
- Using a conversion without checking the output definition. Multiplying by \(-2\) is appropriate for converting a log-likelihood to negative twice log-likelihood, not for repairing a difference in records or likelihood methods.
The practical limitation is that output labels and defaults can vary across software versions and workflows. A short reconciliation note should therefore identify the exact output field, version, method, data basis, and any transformation or constant adjustment. This makes a reported comparison reviewable without implying more equivalence than the checks establish.
Check Your Understanding
Answer each question, then compare with the solutions below.
- For four independent normal observations, how far apart are the full and reduced negative-two-log-likelihoods if the reduced form omits \(\log(2\pi)\) per observation?
- One run includes an additional observation with zero residual under a normal model with \(\sigma=1\). What is its full negative-two-log-likelihood contribution?
- A tool reports \(\ell=-9.75\). What is the corresponding \(-2\ell\)?
- Why does matching the number of records not guarantee that two tools used the same likelihood?
- When does an additive constant leave the maximizing parameter value unchanged?
Solutions. (1) The difference is \(4\log(2\pi)\approx7.352\). (2) The contribution is \(\log(2\pi\times1)+0=\log(2\pi)\approx1.838\). (3) \(-2(-9.75)=19.50\). (4) The records may have different response scales, censoring treatment, error models, or random-effects likelihood evaluation methods. (5) When it is independent of the parameters and is added to the same likelihood at every candidate parameter value; then it cancels in comparisons of those values.