Tutorials › Nonlinear Mixed-Effects Models (NLME) › Prior Sensitivity Analysis for Variance Components

Bayesian NLME with MCMC · Tutorial 259 of 797

Prior Sensitivity Analysis for Variance Components

Learn to compare defensible priors for random-effect scales and correlations and determine whether posterior and predictive conclusions are robust to those choices.

Advanced 13 min read

What You'll Learn

  • Calibrate priors for random-effect standard deviations in the model’s parameter units.
  • Compare alternative priors for random-effect correlations, including LKJ priors.
  • Repeat Bayesian inference while holding the likelihood, data, and model fixed.
  • Summarize how prior choices affect posterior estimates and intervals.
  • Translate changes in random-effect scales into individual-level variability and predictions.
  • Distinguish prior sensitivity from inadequate MCMC sampling.

Why Examine Prior Sensitivity?

In a Bayesian nonlinear mixed-effects model, a prior on the random-effect covariance structure can influence inference, particularly when the data provide limited information about one or more variance components or correlations. Prior sensitivity analysis asks a focused question: if scientifically defensible prior choices were changed, would the substantive posterior conclusions change? It is not a search for the prior that produces the preferred answer. It is a transparent check on how much the analysis depends on assumptions that are not supplied by the likelihood.

For subject \(i\), write the individual parameters as \(\phi_i=f(\theta,b_i)\), where \(\theta\) denotes population parameters and \(b_i\) is a vector of random effects. In the usual multivariate normal random-effects model, \(b_i\mid\Omega\sim N(0,\Omega)\). A convenient decomposition is \(\Omega=D R D\), where \(D=\operatorname{diag}(\omega_1,\ldots,\omega_q)\) contains random-effect standard deviations and \(R\) is a correlation matrix. The prior sensitivity question here concerns alternative plausible priors on the \(\omega_k\) and on \(R\), while keeping the data, likelihood, and other model choices fixed.

Definition: Prior sensitivity analysis for variance components is a comparison of posterior inferences obtained from the same model and data under a prespecified set of scientifically defensible alternative priors for random-effect standard deviations, variances, correlations, or their joint covariance structure. It assesses the consequences of prior choice; it does not establish that one prior is correct.

Specify and Calibrate Alternative Priors

A prior should be interpreted in the units and parameterization of the model. If the random effect is on log clearance, for example, its standard deviation is on the log scale, not in clearance units. A prior that looks numerically small or large cannot be judged without checking that scale. For a standard deviation \(\omega>0\), common possibilities include a half-normal distribution, a half-\(t\) distribution, or a prior on \(\log\omega\). These choices differ in how much probability they place near zero and in their upper tails. None is automatically suitable in every application.

For correlations, one common choice is an LKJ prior on the correlation matrix \(R\), with density proportional to \(|R|^{\eta-1}\), where \(\eta>0\). In dimension two, this induces a density for the single correlation \(\rho\) proportional to \((1-\rho^2)^{\eta-1}\) on \((-1,1)\). When \(\eta=1\), the correlation is uniform; larger \(\eta\) places relatively more weight near zero. This prior choice is distinct from a prior on the standard deviations: changing one does not require changing the other.

Priors for covariance parameters should be stated clearly, including their parameterization and scale. Proper priors generally help ensure a proper posterior, but a proper prior is not necessary for a proper posterior. An improper prior can yield a proper posterior; whenever an improper prior is used, verify that the resulting posterior is proper. Proper priors also make prior predictive implications easier to examine and can support meaningful comparisons between prior specifications.

Worked Example: Calibrating a Half-Normal Prior

Suppose a random effect on log clearance has standard deviation \(\omega\), and a proposed prior is \(\omega\sim\operatorname{HalfNormal}(0,a)\). The half-normal is the distribution of the absolute value of a \(N(0,a^2)\) variable. A team wants 95% of prior probability below \(\omega=0.30\) log units. Find a scale \(a\) that meets this target.

For \(x\geq 0\), the half-normal cumulative distribution function is \(P(\omega\leq x)=2\Phi(x/a)-1\), where \(\Phi\) is the standard normal cumulative distribution function. Set this probability to 0.95 at \(x=0.30\):

$$ 2\Phi(0.30/a)-1=0.95 $$

Thus \(\Phi(0.30/a)=0.975\), so \(0.30/a\approx1.960\). Therefore \(a=0.30/1.960\approx0.1531\) log units. By construction, this prior assigns 5% probability to \(\omega>0.30\). This calculation calibrates one prior to an interpretable scale; it does not prove that the half-normal shape or the 95% threshold is scientifically appropriate.

Worked Example: Comparing Correlation Priors

Consider two random effects with correlation \(\rho\). Under an LKJ prior with \(\eta=1\), \(\rho\) is uniform on \((-1,1)\), so \(P(|\rho|>0.8)=0.2\). Under LKJ\((2)\), the normalized density is \(f(\rho)=\frac{3}{4}(1-\rho^2)\). The prior probability of a correlation whose magnitude exceeds 0.8 is

$$ P(|\rho|>0.8) =2\int_{0.8}^{1}\frac{3}{4}(1-\rho^2)\,d\rho =\frac{3}{2}\left[\rho-\frac{\rho^3}{3}\right]_{0.8}^{1} =0.05600. $$

Thus LKJ\((2)\) assigns 5.6% probability to \(|\rho|>0.8\), compared with 20% under LKJ\((1)\). This is a prior comparison only: it says nothing by itself about the posterior correlation after observing data. It does show why correlation-prior choices should be described rather than treated as interchangeable defaults.

Repeat the Inference and Compare Like With Like

A fair sensitivity comparison changes the prior specification of interest and leaves the likelihood and data unchanged. Use the same random-effects structure, residual model, covariate definitions, and observation model in each fit. If several prior features are changed simultaneously, a posterior difference may be hard to attribute; when practical, compare one change at a time as well as any justified combined alternatives. The alternatives should be selected before inspecting which produces the most appealing estimate.

For prior specification \(j\), posterior inference follows \(p_j(\theta,\Omega\mid y)\propto p(y\mid\theta,\Omega)p_j(\theta,\Omega)\), with all other parameters included as needed. A useful justification for comparing specifications is the identity

$$ \frac{p_j(\theta,\Omega\mid y)}{p_k(\theta,\Omega\mid y)} = \frac{p_j(\theta,\Omega)}{p_k(\theta,\Omega)} \frac{p_k(y)}{p_j(y)}, $$

where \(p_j(y)\) and \(p_k(y)\) are the marginal likelihoods under the respective priors. For fixed data and likelihood, the prior density ratio is the source of differences in posterior weighting; the marginal-likelihood ratio is a constant in the parameters that normalizes each posterior. The identity does not require calculating marginal likelihoods to do sensitivity analysis. It clarifies why the same likelihood can yield different posterior distributions under different priors.

Compare quantities relevant to the scientific question: posterior medians or means, credible intervals, probabilities of decision-relevant events, and predictions. Report the priors, parameter scales, and posterior summaries together. Differences should be interpreted against both Monte Carlo error and a meaningful scientific scale. A small numerical difference relative to sampling error is not persuasive evidence of sensitivity; conversely, a material shift that exceeds Monte Carlo error should not be dismissed simply because both fits converged.

Worked Example: Comparing Posterior Scale Summaries

Suppose a hypothetical oral pharmacokinetic analysis uses the same model and data in two fits. Fit A uses a half-normal prior with scale 0.25 for the log-clearance random-effect standard deviation and LKJ\((1)\) for the correlation matrix. Fit B uses a half-\(t\) prior with 3 degrees of freedom and scale 0.50 for that standard deviation, and LKJ\((2)\) for the correlation matrix. The values below are hypothetical posterior summaries, assumed for illustration to have negligible Monte Carlo error.

QuantityFit AFit B
Posterior median \(\omega_{\mathrm{CL}}\)0.180 log units0.220 log units
90% credible interval for \(\omega_{\mathrm{CL}}\)0.070 to 0.360 log units0.080 to 0.480 log units
Posterior median correlation-0.310-0.180
90% credible interval for correlation-0.760 to 0.360-0.630 to 0.340

For a lognormal random effect, the coefficient of variation implied by a standard deviation \(\omega\) on the log scale is \(\sqrt{\exp(\omega^2)-1}\). Applying this increasing transformation to each posterior median gives, for Fit A, \(\sqrt{\exp(0.180^2)-1}=\sqrt{\exp(0.0324)-1}\approx0.1815\), or 18.2%. For Fit B, \(\sqrt{\exp(0.220^2)-1}=\sqrt{\exp(0.0484)-1}\approx0.2227\), or 22.3%. These are transformed posterior medians, not posterior means of the coefficient of variation.

The hypothetical fits suggest a higher typical between-subject clearance variability under Fit B, while both intervals remain broad and overlap. They do not establish that the priors are equivalent or that the difference is scientifically important. The analyst should also compare the posterior distributions and relevant predictions, and check that the summary differences exceed Monte Carlo uncertainty.

Predictive Consequences and a Short Derivation

A change in a variance-component posterior can matter even when the population typical value barely changes, because it changes the distribution of individual parameters. For a lognormal random effect \(b\sim N(0,\omega^2)\), the individual-to-typical parameter multiplier is \(\exp(b)\). Its conditional mean and variance, given \(\omega\), are

$$ E[\exp(b)\mid\omega]=\exp(\omega^2/2), \qquad \operatorname{Var}[\exp(b)\mid\omega] =\exp(\omega^2)\{\exp(\omega^2)-1\}. $$

These expressions follow from the normal moment-generating function: for \(b\sim N(0,\omega^2)\), \(E[\exp(tb)]=\exp(t^2\omega^2/2)\). Taking \(t=1\) gives the mean; taking \(t=2\) gives the second moment \(\exp(2\omega^2)\). Subtracting the squared mean yields \(\exp(2\omega^2)-\exp(\omega^2)=\exp(\omega^2)\{\exp(\omega^2)-1\}\).

Worked Example: Translating Scale Differences Into Variability

Use the posterior medians from the previous hypothetical fits as fixed scale values to illustrate conditional population variability. At \(\omega=0.180\), the mean clearance multiplier is \(\exp(0.180^2/2)=\exp(0.0162)\approx1.016\), and its variance is \(\exp(0.0324)\{\exp(0.0324)-1\}\approx1.0329(0.03293)=0.03401\). Its standard deviation is therefore \(\sqrt{0.03401}\approx0.1844\) multiplier units.

At \(\omega=0.220\), the corresponding mean is \(\exp(0.0484/2)=\exp(0.0242)\approx1.0245\), and the variance is \(\exp(0.0484)\{\exp(0.0484)-1\}\approx1.0496(0.04959)=0.05205\). The standard deviation is \(\sqrt{0.05205}\approx0.2281\) multiplier units. Thus the larger scale implies a wider distribution of individual clearance multipliers. These calculations condition on a fixed \(\omega\); a full posterior predictive distribution additionally averages over posterior uncertainty in \(\omega\) and other parameters.

More generally, if \(Y_{\mathrm{new}}\) is a future observation and \(\psi\) denotes all model parameters, the posterior predictive distribution is \(p(y_{\mathrm{new}}\mid y)=\int p(y_{\mathrm{new}}\mid\psi)p(\psi\mid y)\,d\psi\). Its variance separates into expected conditional variance and variance of the conditional mean:

$$ \operatorname{Var}(Y_{\mathrm{new}}\mid y) = E\{\operatorname{Var}(Y_{\mathrm{new}}\mid\psi,y)\mid y\} + \operatorname{Var}\{E(Y_{\mathrm{new}}\mid\psi,y)\mid y\}. $$

A prior sensitivity comparison can therefore assess predicted concentrations or individual parameter values by generating predictions from each fit, using the same target population and dosing scenario. Compare quantities such as predictive medians, intervals, or probabilities of exceeding a clinically relevant threshold. A change in \(\omega\) need not translate uniformly into a change in every prediction; it depends on the model’s nonlinear mapping from individual parameters to observations.

Diagnostics, Alternatives, and Limitations

Before attributing differences to priors, establish that each fit samples its posterior adequately. Check trace plots, rank-normalized \(\hat R\), effective sample sizes, Monte Carlo standard errors, and HMC warnings such as divergent transitions. Poor mixing or unresolved divergences can make summaries unreliable; rerunning with better sampling is not itself a prior sensitivity analysis. Compare prior predictive implications as well: priors that routinely imply implausible individual variability or concentration profiles may be rejected on scientific grounds before fitting.

Common signs that a comparison needs closer examination include posterior intervals that shift substantially between reasonable priors, posterior mass near zero that changes materially, correlations whose sign or magnitude changes, and predictions that differ enough to alter a scientific decision. These patterns are evidence that conclusions are prior-dependent under the tested specifications, not proof of a particular cause. If alternative priors yield similar summaries and predictions, report that robustness with the range of priors examined rather than claiming universal insensitivity.

Prior sensitivity is not the same as choosing a prior by fit quality. Frequentist likelihood-based estimates are an alternative inferential framework, but they do not answer the same posterior-probability questions. Within Bayesian analysis, one can also compare parameterizations or jointly structured priors, but such changes should be described because they may alter the prior induced on \(\Omega\). Sensitivity analysis has limits: a finite set of priors cannot represent every plausible belief, and agreement across a narrow or implausible set offers little reassurance. It also cannot repair a misspecified likelihood or establish that the model predicts well.

Common pitfall: “The posterior medians are close, so the variance-component conclusions are insensitive to the prior.” This reasoning ignores interval width, posterior tail probabilities, correlation uncertainty, predictive consequences, and Monte Carlo error. Instead, compare full posterior summaries and decision-relevant predictions across explicitly stated, scientifically defensible priors, and distinguish meaningful shifts from simulation noise.
1
Define plausible alternatives.
State the scale and shape of each prior for random-effect standard deviations and correlations, and explain its scientific calibration.
2
Hold the analysis fixed.
Use the same data, likelihood, structural model, and other priors unless a specific additional change is being evaluated.
3
Verify sampling and compare outcomes.
Check MCMC diagnostics, then compare posterior summaries, intervals, relevant probabilities, and predictions with Monte Carlo uncertainty in view.
4
Report the scope of the conclusion.
Describe which conclusions were robust or sensitive across the tested priors; do not generalize beyond those alternatives.

Check Your Understanding

Answer each question, then check the brief solutions below.

  1. Why should a prior on a log-scale random-effect standard deviation be calibrated in log units?
  2. For a two-effect LKJ prior, what does increasing \(\eta\) do to the relative prior weight near zero correlation?
  3. What must remain fixed for a comparison to isolate the effect of changing the variance-component prior?
  4. Why is it insufficient to compare posterior medians alone?
  5. What is the distinction between a conditional prediction at a fixed variance-component value and a posterior predictive distribution?

Solutions. (1) The prior’s numerical scale has meaning only in the parameter’s units; log units determine the implied spread in the original parameter. (2) It places relatively more weight near zero and less near correlations near \(-1\) or \(1\). (3) The data, likelihood, model structure, and other prior choices should remain fixed, except for the prior feature deliberately varied. (4) Intervals, tail probabilities, predictions, and Monte Carlo uncertainty may reveal important differences hidden by similar medians. (5) A conditional prediction fixes parameters such as the random-effect scale; the posterior predictive distribution averages the observation model over posterior uncertainty in all relevant parameters.