Tutorials › Nonlinear Mixed-Effects Models (NLME) › Bayesian Information Criterion for NLME Models

Model Selection and Information Criteria · Tutorial 654 of 797

Bayesian Information Criterion for NLME Models

You will derive BIC from a Laplace approximation to model evidence and apply its sample-size-dependent penalty when comparing fitted NLME models.

Intermediate 11 min read

What You'll Learn

  • Derive the BIC penalty from a local quadratic approximation to the log likelihood.
  • State the regularity conditions behind the large-sample approximation.
  • Calculate BIC from a maximized log likelihood, parameter count, and sample size.
  • Explain how the penalty for additional parameters grows as sample size increases.
  • Recognize NLME features, such as boundary estimates, that can weaken the approximation.
  • Distinguish BIC’s evidence-based motivation from AIC and likelihood-ratio comparisons.

Why BIC penalizes model complexity

A more flexible model can often achieve a higher maximized likelihood because it has more parameters available to fit the data. Comparing models therefore requires more than asking which has the largest likelihood. The Bayesian Information Criterion (BIC) balances fit against model dimension, with a penalty that increases with sample size. Its standard large-sample form can be understood as an approximation to how well a model’s likelihood fits after averaging over its parameter space, rather than evaluating fit only at the best-fitting parameter values.

For an NLME model, the likelihood used in this comparison is ordinarily the likelihood for the observed data after integrating over the subject-level random effects. The parameter count \(K\) refers to the estimated model parameters, including relevant fixed-effect, random-effect distribution, and residual-error parameters, as appropriate to the fitted model. It does not ordinarily count each subject’s latent random effect as a separate population parameter. The likelihoods being compared must be defined on the same data and be comparable; parameter-counting issues are covered in the earlier material on counting parameters for NLME information criteria.

Definition: For a fitted model with maximized log likelihood \(\ell(\hat{\theta})\), \(K\) estimated parameters, and sample size \(n\), the Bayesian Information Criterion is $$ \mathrm{BIC}=-2\ell(\hat{\theta})+K\log(n). $$ Lower BIC indicates the preferred model among those compared by this criterion. The value is a relative selection score, not a probability that a model is true.

The sample-size term makes BIC’s complexity penalty grow with \(n\): each additional parameter adds \(\log(n)\) to BIC. The likelihood contribution is on the deviance scale, \(-2\ell(\hat{\theta})\). Thus a larger model is favored only when its improved fit is enough to offset the added penalty. In NLME applications, the choice of \(n\) requires care because observations may be clustered within subjects; the formula does not by itself resolve which sampling unit should determine \(n\).

Deriving the penalty from model evidence

For a model with parameter vector \(\theta\), its marginal likelihood, also called model evidence, averages the likelihood over a prior distribution \(\pi(\theta)\):

$$ m(y)=\int L(\theta;y)\pi(\theta)\,d\theta. $$

This integral rewards parameter regions that fit the data, not merely a single high-likelihood point. To approximate it, suppose \(\hat{\theta}\) is an interior maximum-likelihood estimate and the log likelihood is smooth and approximately quadratic near that estimate. Let \(J(\hat{\theta})\) be the observed information matrix, the negative Hessian of the log likelihood at \(\hat{\theta}\). A second-order Taylor expansion gives

$$ \ell(\theta)\approx \ell(\hat{\theta})-\frac{1}{2}(\theta-\hat{\theta})^\mathsf{T}J(\hat{\theta})(\theta-\hat{\theta}). $$

If the prior density changes little across the likelihood’s concentrated region, it can be approximated there by \(\pi(\hat{\theta})\). Substituting the quadratic approximation into the evidence integral and integrating the resulting \(K\)-dimensional Gaussian kernel gives the Laplace approximation:

$$ m(y)\approx \exp\{\ell(\hat{\theta})\}\pi(\hat{\theta})(2\pi)^{K/2}|J(\hat{\theta})|^{-1/2}. $$

The large-sample step follows when the data provide information at a rate proportional to \(n\): \(J(\hat{\theta})\) is approximately \(nI(\hat{\theta})\), where \(I\) is a per-unit information matrix. Therefore \(|J(\hat{\theta})|\) is approximately \(n^K|I(\hat{\theta})|\). Taking logarithms yields

$$ \log m(y) \approx \ell(\hat{\theta})-\frac{K}{2}\log(n) +\log\{\pi(\hat{\theta})\} +\frac{K}{2}\log(2\pi) -\frac{1}{2}\log|I(\hat{\theta})|. $$

For fixed \(K\), the prior and information terms do not grow like \(\log(n)\) under the regularity conditions below. Dropping these terms gives \(-2\log m(y)\approx -2\ell(\hat{\theta})+K\log(n)\), which is the BIC expression. This derivation explains both the form of the penalty and its asymptotic nature: BIC retains the term that grows with sample size and omits terms that remain bounded as the sample grows.

Conditions for the usual approximation: The model is identifiable, the parameter dimension \(K\) is fixed as \(n\) grows, the true or best-fitting parameter is in the interior of the parameter space, and the log likelihood is sufficiently smooth with nonsingular information. The likelihood must concentrate approximately normally around an interior maximum, with information increasing proportionally to \(n\). The prior density must be positive and smooth near that maximum. These conditions motivate the ordinary BIC approximation; they are not guaranteed merely because software returns a converged fit.

For NLME models, the subject effects are integrated out in the marginal likelihood before this approximation is applied. The regularity conditions can be strained when a random-effect variance is estimated at zero, when a covariance structure is singular, when parameters are weakly identified, or when the likelihood has multiple separated modes. These cases can make a single, interior, quadratic approximation a poor description of the evidence. BIC remains calculable, but its evidence-based interpretation should then be cautious.

Worked Example: Comparing Two NLME Fits

Suppose two hypothetical NLME models are fitted to the same data, with a specified sample size \(n=80\). Model A has \(K_A=5\) parameters and maximized log likelihood \(\ell_A=-142.0\). Model B has \(K_B=7\) and \(\ell_B=-136.8\). Assume both fits use comparable likelihoods, have converged to suitable maxima, and satisfy the regularity conditions well enough for BIC to be used as an approximation.

For Model A, $$ \mathrm{BIC}_A=-2(-142.0)+5\log(80) =284.0+5(4.3820) =305.91. $$

For Model B, $$ \mathrm{BIC}_B=-2(-136.8)+7\log(80) =273.6+7(4.3820) =304.27. $$

Model B has the lower BIC by \(305.91-304.27=1.64\) BIC units, so BIC favors Model B in this comparison. The larger model improved the maximized log likelihood by \(5.2\), reducing the deviance by \(2(5.2)=10.4\). Its two extra parameters add a penalty of \(2\log(80)=8.764\), just less than the fit improvement on the deviance scale. This is a criterion-based preference, not proof that Model B is the true model.

How the penalty changes with sample size

The fit improvement required to justify additional parameters follows directly by subtracting the two BIC values. Let the expanded model have \(q\) more parameters than the simpler model. Write \(\Delta\ell=\ell_{\mathrm{expanded}}-\ell_{\mathrm{simple}}\). If the models use the same \(n\), then

$$ \Delta\mathrm{BIC} =\mathrm{BIC}_{\mathrm{expanded}}-\mathrm{BIC}_{\mathrm{simple}} =-2\Delta\ell+q\log(n). $$

The expanded model has lower BIC precisely when \(\Delta\ell>(q/2)\log(n)\). For a fixed number of added parameters, that required log-likelihood gain rises as \(n\) increases. This is the specific sense in which BIC imposes a sample-size-dependent penalty; it does not mean that BIC must favor the simpler model in every large data set, since the observed fit gain can also change.

Worked Example: The Same Fit Gain at Two Sample Sizes

Consider a hypothetical comparison in which the expanded NLME model adds \(q=2\) parameters and improves the maximized log likelihood by \(\Delta\ell=4.5\). Assume each comparison uses comparable fits and the stated \(n\) is appropriate for that comparison.

At \(n=25\), the difference is $$ \Delta\mathrm{BIC}=-2(4.5)+2\log(25) =-9+6.4378=-2.562. $$ Because the difference is negative, BIC favors the expanded model at this sample size.

At \(n=200\), with the same log-likelihood gain and parameter increase, $$ \Delta\mathrm{BIC}=-2(4.5)+2\log(200) =-9+10.5966=1.597. $$ Now the simpler model has lower BIC. The fit gain is unchanged, but the penalty for the two extra parameters has increased from \(6.438\) to \(10.60\) BIC units. The example isolates the sample-size effect; it does not imply that real data sets of different sizes will have identical fit gains.

Worked evidence approximation

The Laplace derivation also helps explain why BIC is not the exact model evidence. The omitted terms can matter for particular data sets, priors, and parameterizations, even though they are lower order under the stated asymptotic conditions.

Worked Example: A Local Evidence Calculation

Suppose a hypothetical two-parameter model has \(\ell(\hat{\theta})=-50.0\), \(n=100\), and observed information \(J=100\operatorname{diag}(4,9)\). Assume the log likelihood is well approximated by its quadratic expansion near the interior maximum and that the prior density is approximately \(0.0100\) there. Since \(J=\operatorname{diag}(400,900)\), its determinant is \(400(900)=360{,}000\), so \(|J|^{1/2}=600\).

The Laplace approximation gives $$ m(y)\approx \exp(-50.0)(0.0100)\frac{2\pi}{600} =\exp(-50.0)(0.0001047). $$ Thus $$ \log m(y)\approx -50.0+\log(0.0001047)=-59.16, $$ and \(-2\log m(y)\approx118.3\).

BIC for this model is $$ \mathrm{BIC}=-2(-50.0)+2\log(100) =100.0+9.210=109.2. $$ The values differ because BIC drops bounded contributions involving the prior density and the local information determinant, as well as constants. This calculation illustrates the approximation’s structure; the local evidence value depends on the prior and parameter scale, whereas the leading BIC penalty is \(K\log(n)\).

Comparisons, diagnostics, and limitations

BIC is not interchangeable with every other model-comparison procedure. The earlier material on AIC and AICc motivates their penalties through a different objective: estimating relative predictive information loss, rather than approximating model evidence under the regularity conditions used here. A likelihood-ratio test instead uses a test statistic and a reference distribution for a specified nested-model hypothesis. BIC can compare non-nested models if their likelihoods and data basis are comparable, but it does not supply a hypothesis-test p-value.

ApproachMain basisImportant distinction
BICLarge-sample approximation to model evidencePenalty per parameter is \(\log(n)\)
AIC or AICcInformation-criterion comparison motivated by predictive fitUses a different penalty and target
Likelihood-ratio testNested-model likelihood difference and a reference distributionTests a specified null hypothesis; it is not an evidence approximation

Before interpreting BIC, check that models were fitted to the same observations and response definition, that their likelihood values are on a comparable basis, and that the parameter counts are defensible. Review optimization and identifiability diagnostics rather than treating a convergence message as sufficient. In particular, estimates near boundaries, very large parameter standard errors, near-singular covariance estimates, or materially different results from plausible starting values warn that the regular approximation may be fragile. BIC also depends on the chosen \(n\); applying a formula with an unjustified sample-size definition can alter the comparison.

A common mistake is to say, “The larger model has a higher likelihood, so it must be preferred.” Likelihood cannot decrease when parameters are added to a nested model, but BIC asks whether that gain offsets \(q\log(n)\). Another mistake is to interpret a BIC difference as the probability that one model is correct. BIC is a score; translating it into an evidence ratio requires additional asymptotic interpretation and assumptions, and it still does not establish that either candidate is true.

Key takeaway: BIC combines the maximized log likelihood with a \(K\log(n)\) penalty. Its penalty follows from the shrinking parameter region that contributes substantially to model evidence as data accumulate. The approximation is most credible for regular, identifiable models with an interior maximum and a well-behaved likelihood.

Check Your Understanding

For each question, try the calculation or explanation first, then check the solutions below.

  1. A model has \(\ell(\hat{\theta})=-90.0\), \(K=4\), and \(n=50\). Calculate its BIC.
  2. An expanded model adds one parameter and improves the log likelihood by \(2.0\). At \(n=40\), calculate the BIC difference, expanded minus simpler, and state which model BIC favors.
  3. In one sentence, explain why the BIC penalty for a fixed number of added parameters grows with \(n\).
  4. Name two conditions or diagnostic concerns that can make the usual evidence approximation unreliable for an NLME model.

Solutions. 1. \(\mathrm{BIC}=180+4\log(50)=180+15.648=195.65\). 2. \(\Delta\mathrm{BIC}=-2(2.0)+\log(40)=-4+3.689=-0.311\), so the expanded model has slightly lower BIC. 3. Each added parameter contributes \(\log(n)\), which increases as \(n\) increases. 4. Examples include a variance estimate on the boundary, weak identifiability, a singular information matrix, or a likelihood with multiple separated modes.